Question: Procedure of constrained optimum

Hello people in mapleprime

 

maxi:=proc(obj,expre,x,y)
local eq1,eq2,eq3,lagrangean;
lagrangean:=obj+lambda*expre;
eq1:=diff(lagrangean,x)=0:
eq2:=diff(lagrangean,y)=0:
eq3:=diff(lagrangean,lambda)=0:
solve({eq1,eq2,eq3},{x,y});
end proc;

Using the above procedure, next code will not return the values of a and b, or a[2] and b[2].

Can you teach me the reason why?

maxi(a*b,z-a-b,a,b);

maxi(a[2]*b[2],z-a[2]-b[2],a[2],b[2])

Thanks in advance.

 

taro

Please Wait...