Dear all, I'm trying to find the maximum of a polynomial function G numerically over [0,1]x[0,1]. I used the simple code below and I got 0, which is clearly wrong as one can easily check plotting the surface z=G(x,y). Any help? Thanks, Nicola
var('x,y') c1(x,y)=x c2(x,y)=y c3(x,y)=1-x c4(x,y)=1-y
G(x,y) = -(56x^2y^2 - 4x^2y - 4xy^2 - 4x^2 - xy - 4y^2 - x - y - 1)(x - 1)*(y - 1)
M = minimize_constrained(-G(x,y), [c1(x,y),c2(x,y),c3(x,y),c4(x,y)],[0.5,0.5])
print(G(M[0],M[1]))