I am working on LNG plant optimization and using Matlab and Hysys as optimization and process simulation software, I already interface them.
When I am using the compressor outlet pressures as decision variables, it's working. But, whenever I am using the mixed refrigerant mass fraction value as decision variables, after one iteration the optimization gets stopped because of the change in mass fraction.
Now, Hysys calculates values of variables x1, x2, x3, x4 and send to MATLAB, which optimizes them and send back the values to Hysys.
The sum of these four variables should be equal to one, that is x1+x2+x3+x4=1, that is if the value of x1 is reduced by MATLAB then the values of remaining variables should be increased to make the sum equals 1.
I am not figuring out a way to correctly write in MATLAB. How should I formulate it?