Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The following code works for me:

var("x,y")
N(x,y) =  ((10-2*x+y)/(1.25 + y)) * ((20-2*x+y)/(1.25+y))
c1(x,y) = 1.25 - (y-0.003) - 2*(x-0.03)
c2(x,y) = x
c3(x,y) = y
minimize_constrained(N(x,y), [c1(x,y),c2(x,y),c3(x,y)], [0,0])

Alternatively:

N = lambda x:  ((10-2*x[0]+x[1])/(1.25+x[1])) * ((20-2*x[0]+x[1])/(1.25+x[1]))
c1 = lambda x: 1.25 - (x[1]-0.003) - 2*(x[0]-0.03)
c2 = lambda x: x[0]
c3 = lambda x: x[1]
minimize_constrained(N, [c1,c2,c3], [0,0])