I am trying to solve a Nonlinear optimization problem with Mathematica. Since the maximization problem includes exponentiation with fractional power, the result generates the complex numbers that stop the maximization. I used "Reduce" and "Rationalize" to get real values, but still, I get the following error.
NMaximize::nrnum: The function value "1.87153*10^9-105366. I" is not a real number at {y1,y2,y3,z1,z2,z3} = {0.102046,0.0181095,0.879844,0.273829,0.00536371,0.720807}.
Here is my code:
g=((500 y1+1595 y2-405 y3)^(0.4)*(700 z1+1757 z2-243 z3)^0.6*(0.4 (900 y1-121 y2+1879 y3)+0.6(900 z1-121 z2+1879 z3)))
Rationalize[g,0]
Reduce[(500 y1+1595 y2-405 y3)^(2/5) (700 z1+1757 z2-243 z3)^(3/5)==a && a∈Reals, Reals]
cons={500 y1+1595 y2-405 y3>=500 z1+1595 z2-405 z3 , 700 z1+1757 z2-243 z3>=700 y1+1757 y2-243 y3 , y1+y2+y3==1 , z1+z2+z3==1 , y1>=0 , y2>=0 , y3>=0 , z1>=0 , z2>=0 , z3>=0}
cons3=Join[cons,{z1>=1/700 (-1757 z2+243 z3) && y1>=1/100 (-319 y2+81 y3)}]
vars={y1,y2,y3,z1,z2,z3}
sol3=Maximize[{g,cons3},vars]
I would appreciate if someone can help me.
Maximize
to theRe
(real) part of your function? $\endgroup$Im[g]==0
to the constraints. $\endgroup$