%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%
%~~~~~~~~~~   The file has stored the data from optimization~~~~~~~~~~~~~~%
%~~~~~~~~~~~~~~~~  from optimization in  Unisim    ~~~~~~~~~~~~~~~~~~~~~~~%
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%



pD=1.4; %Ration between price of the distillate and the feed
pB=1; %Ration between price of the bottom product and the feed
F= 6.5732E+04; %Feed rate [kg/h]
pv=0.01; %Ration between vap and combostion enthalpy


%X_B
X=[0.25 0.5 0.75 1 1.25 1.75 2.25 3];

% X_D=2%
B1= [4.292E+04 4.304E+04 4.315E+04 4.325E+04 ...
    4.337E+04 4.359E+04 4.382E+04 4.416E+04];
D1= [2.281E+04 2.270E+04 2.258E+04 2.248E+04 ...
    2.236E+04 2.214E+04 2.192E+04 2.157E+04];
V1= [2.885E+05 2.638E+05 2.522E+05 2.449E+05...
    2.397E+05 2.323E+05 2.271E+05 2.210E+05];

pDD1=pD*D1;
pBB1=pB*B1;
pVV1=pv*V1;

J1= F+pVV1-pDD1-pBB1; %Cost function

% X_D=4%
B2= [4.244E+04 4.256E+04 4.267E+04 4.277E+04 ...
    4.290E+04 4.312E+04 4.336E+04 4.370E+04];
D2= [2.329E+04 2.317E+04  2.306E+04 2.296E+04...
    2.283E+04 2.261E+04 2.238E+04 2.203E+04];
V2= [2.804E+05 2.558E+05 2.443E+05 2.371E+05... 
    2.319E+05 2.247E+05 2.194E+05 2.134E+05];

pDD2=pD*D2;
pBB2=pB*B2;
pVV2=pv*V2;

J2= F+pVV2-pDD2-pBB2; %Cost function

clear B1 B2 D1 D2 V1 V2
save Opt_data