Question: how to minimize this penalty function which has max(x,y)

f1 := -2*x1 - x2;
f2 := -x1 - 4*x2;
g1 := 2*x1 + 3*x2 - 6;
g2 := -x1;
g3 := -x2;
penalty := lambda1*Max(f1-M,0)+lambda2*Max(f2-M,0)+(M^2)*(max(g1,0) + max(g2,0) + max(g3,0));
M := 1;
k := 1;
s := 1;
lambda1 := 0.5;
lambda2 := 0.5;
with(Optimization):
Minimize(subs(lambda2=0.5, subs(lambda1=0.5, subs(M=1, penalty))));

correct answer for these parameters should be below, however, Minimize got error

when lambda1 = 0.5, lambda2 = 0.5
(x1, x2) = 1.551123, 0.965918
f(x1, x2) = (–4.068164, –5.414795);

Please Wait...