I have to maximize the objective function
subjected to constraints
By solving this equation using KKT condition,
L(b,s,lambda1,lambda2)=b*Eby-s*Esl+gb*(Esl-Eby)+lambda1(gb-s)+lambda2(b-gs)
solution obtained is,
case1 : lambda1=0;lambda2=0
s*=3.302;b*=6.928
case1 : lambda1=0;lambda2>0
s*=3.302;b*=8
case1 : lambda1>0;lambda2=0
s*=3;b*=6.928
case1 : lambda1>0;lambda2>0
s*=3;b*=8
I solving this function using fmincon ,but didn't got the correct solution.
ES=4.5;is=20;EB=1.5;ib=40;
f = @(s,b)(b*Eby-s*Esl+gb*(Esl-Eby));
[sb,fv] = fmincon(@(sb) -f(sb(1),sb(2)), rand(2,1), [],[],[],[],[3 -Inf],[inf 8])
Problem appears unbounded.
fmincon stopped because the objective function value is less than
the value of the objective function limit and constraints
are satisfied to within the value of the constraint tolerance.
Is this code is correct? Is it possible to get a solution between 3 and 8.That is case 1 have to be excecute.How to solve this problem?Is there any other method? Please help me to correct this code.
NB:values of ES,EB,is,ib are changable variables.