

example problem required for understanding.
//Hi All,
//i want to solve the following MINLP optimization problem using scilab, but i am new to scilab optimization toolbox, can you please post some example or solve //the bellow problem.
clc;
clf;
//problem statement:
//minimise : fenske_err
// by changing:
//lk,hk integer from 1 to 25
// Rlk,Rhk continuous from 0.5 to 0.999
// constraint: lk<hk
// solution: optimised lk, hk, Rlk, Rhk
Fi=[131.0796,127.4439,151.6167,185.0476,185.6320,179.2677,172.5071,160.2259,148.6672,134.9301,121.8694,108.2484,97.2993,89.2256,81.6741,74.5860,67.6739,94.3831,69.7915,54.9432,46.1657,32.8283,39.2493,29.5557,27.0888]
Ki=[26.01625197,24.9019,23.8856,22.3736,20.6820,18.9222,17.2725,15.6624,14.1555,12.6832,11.2771,9.9420,8.6803,7.5003,6.4170,5.4155,4.5198,3.4637,2.3508,1.5117,0.9441,0.5555,0.2480,0.0677,0.0165]
EBP=[22.6037384,48.80585632,73.88614807,98.64582214,123.5531403,148.9769836,174.1597534,199.4192902,224.6507355,249.9072968,275.1638428,300.4605347,325.8098389,351.0825439,376.3668457,401.6058289,431.1366516,470.3650146,515.2020508,559.4735046,603.3208252,655.7137085,728.6522766,812.7724243,894]
Mwt=[57.8,67.0,78.3,90.8,102.2,115.2,130.2,146.5,164.5,184.1,205.6,228.8,254.0,280.6,307.7,333.7,364.2,409.8,466.5,523.5,582.6,657.2,748.0,880.2,1020.6]
SG=[0.6654,0.6867,0.7065,0.7253,0.7400,0.7551,0.7708,0.7858,0.8002,0.8141,0.8275,0.8403,0.8529,0.8652,0.8770,0.8885,0.8997,0.9141,0.9319,0.9494,0.9660,0.9838,1.0043,1.0328,1.0600]
function F=fenske(lk,hk,Rlk,Rhk,Fi,Ki,EBP,Mwt,SG)
Alpha_lkhk=Ki(1,lk)/Ki(1,hk);//incorporate actual Alpha or k
Nmin=(log((Rlk/(1-Rlk))/((1-Rhk)/Rhk)))/(log(Alpha_lkhk))
disp(Nmin, 'Nmin=');
j=1
while j<=25
Alpha_ihk(1,j)=Ki(1,j)/Ki(1,hk)
j=j+1;
end
i=1;
D=[0];
B=[0];
I=[0];
RiD=[0];
RiB=[0];
A=[0];
while i<=25;
A(1,i)=(Alpha_ihk(1,i)^Nmin)*((1-Rhk)/Rhk);
RiD(1,i)=(A(1,i)/(1+A(1,i)));
RiB(1,i)=1-RiD(1,i);
D(1,i)=Fi(1,i)*RiD(1,i);
B(1,i)=Fi(1,i)*(1-RiD(1,i));
I(1,i)=i;
i=i+1;
end
i=1;
totpro=0;
while i<=25;
totpro=totpro+B(1,i)
i=i+1
end
i=1;
CUTV=0;
CUTVP=0;
totv=0;
while i<=25;
CUTV(1,i)=Mwt(1,i)*B(1,i)/SG(1,i);
i=i+1;
end
i=2;
while i<=25;
totv(1,1)=CUTV(1,1);
totv(1,i)=totv(1,i-1)+CUTV(1,i);
i=i+1;
end
i=1;
while i<=25;
CUTVP(1,i)=totv(1,i)*100/totv(1,25);
i=i+1;
end
plot(I, B,'xb')
CALC=0;
CALC(1,1)=interpln([CUTVP;EBP],5);
CALC(1,2)=interpln([CUTVP;EBP],50);
CALC(1,3)=interpln([CUTVP;EBP],95);
CALC(1,4)=totpro;
F=CALC;
endfunction
function err=fenske_err(Pinit,Fi,Ki,EBP,Mwt,SG)
a=Pinit(1);
b=Pinit(2);
c=Pinit(3);
d=Pinit(4);
CALC=fenske(a,b,c,d,Fi,Ki,EBP,Mwt,SG)
err=sqrt((320-CALC(1))^2+(481.00-CALC(2))^2+(810.00-CALC(3))^2+(571.00-CALC(4))^2)
endfunction
CALC=fenske(lk,hk,Rlk,Rhk,Fi,Ki,EBP,Mwt,SG)
disp(CALC,'CALC=');
Pinit=[12;18;0.9339;0.9324]
err=fenske_err(Pinit,Fi,Ki,EBP,Mwt,SG)
disp(err,'err=');
Scilab Toolbox Optimization Toolbox


Please go through the examples listed under each function- http://scilab.in/fossee-scilab-toolbox/optimization-toolbox/functions
Login to add comment