I want to solve a quadratic integer programming problem in Mathematica. My first attempt looks like this:
Minimize[{0.21 (2 x/40)^2 + 0.15 (10 y/40)^2 - 2*(2 x/40)*(10 y/40)*0.05,
2 x + 10 y == 40 && x > 0 && y > 0 && Element[x | y, Integers]}, {x,y}]
The output is:
NMinimize::cvmit: Failed to converge to the requested accuracy or precision within 100 iterations. >>
And:
{0.07875, {x -> 5, y -> 3}}
But it seems not very optimal (e.g. for x=10 and y=2 we get 0.065). I know that integer programming can be tough, but I think this kind of problems should be somehow solvable in Mathematica. Probably I just use wrong commands to achieve this. How can I go about it?