I am using AMPL to solve a non-linear program and, although I know the answer is (x, y) = (6, 4), the solver returns (x, y) = (0, 0) and I really cannot understand why. This is my attempt:
var x >= 0;
var y >= 0;
maximize distance: (1 - x) ^ 2 + y ^ 2;
subject to c1: x <= 6;
subject to c2: y <= 4;
solve;
display x, y;
What is causing this?
You can probably even do this with one variable:
The reason is that MINOS uses the reduced gradient method, which is explained here, which is an iterative method that uses the gradient of the objective function. Since there are only box constraints, the problem is solved as described in Section 3.4. Technicalities aside, if you start at $x=0$, the gradient is $-1$, which means that $x$ should be made smaller to improve the objective. The algorithm does not have the ability to escape local optima.