# Question:How to minimize cost function

## Question:How to minimize cost function

Maple

Dear Maple Users

I am trying to minimize a cost function C subject to conditions t1>0 , t2>0 and t1< t2 by using maple 10

C:=(a*c1*(m*t1^2/2-m*alpha*beta*t1^(beta+2)/((beta+1)*(beta+2))-t1*t2+t2^2/2+alpha*t2*t1^(beta+1)/(beta+1)+alpha*beta*t2^(beta+2)/((beta+1)*(beta+2))-alpha*t1*t2^(beta+1)/(beta+1))+b*c1*(m*t1^3/6-m*alpha*beta*t1^(beta+3)/(2*(beta+2)*(beta+3))+t2^3/3+alpha*beta*t2^(beta+3)/((beta+1)*(beta+3))-t1*t2^2/2-alpha*t1*t2^(beta+2)/(beta+2)+alpha*t2^2*t1^(beta+1)/(2*(beta+1)))+a*c3*(m*t1-t2)+b*c3*(m*t1^2-t2^2)/2+alpha1*m*(a^(2-gamma)-(a+b*t1)^(2-gamma))/(b*(gamma-2)))/t2;

The result obtained by following 3 methods is different.

First method is by minimizing cost

C1:=subs(a=20,b=12,c1=4,c3=8,alpha=0.1,beta=1,alpha1=16,gamma=1.2,m=4,C):

Optimization:-Minimize(C1,[t1>=0,t2>=0]);

−160.915832591470007,   t1=-2.61162665277369786  10     t2=0.228068450853471050

Second method is solve

Cdt:=diff(C,t1):

CdT:=diff(C,t2):

X1:=subs(a=20,b=12,c1=4,c3=8,alpha=0.1,beta=1,alpha1=16,gamma=1.2,m=4,Cdt):

X2:=subs(a=20,b=12,c1=4,c3=8,alpha=0.1,beta=1,alpha1=16,gamma=1.2,m=4,CdT):

X3:=solve({X1,X2});

solution obtained is a set of real n complex values and my feasible solution is

t1=28.52464208,  t2=34.18227899

Third method is fsolve

X1:=subs(a=20,b=12,c1=4,c3=8,alpha=0.1,beta=1,alpha1=16,gamma=1.2,m=4,Cdt):

X2:=subs(a=20,b=12,c1=4,c3=8,alpha=0.1,beta=1,alpha1=16,gamma=1.2,m=4,CdT):

X3:=fsolve({X1,X2});

t1=−1.237023441, t2=−2.497087959

I am confused to decide which of the solution is correct. Also for some other values of alpha and beta (say alpha=0.1 and beta=1.1 ) one of the method is giving that solution is lost while the other one is giving a feasible solution.