Supplying Grad/Jacobian causes solver to think a solver is infeasible?

5 次查看(过去 30 天)
I'm easing my way into optimization and so I've created a scheduling problem (MINLP) that slowly getting more complex. It solves fine (with the Bonmin solver - I'm using the Opti toolbox because I wasn't too happy with the Matlab's GA's solutions) when I don't supply the jacobian or gradients, but if I do it fails and claims the problem is infeasible?
I must be doing something wrong...
I'm generating the derivatives with the symbolic math toolbox like so:
% Gradient
symGrad = jacobian(totCost);
grad = matlabFunction(symGrad,'vars',{X});
% Jacobian
symJac = jacobian(nlCon);
jac = matlabFunction(symJac, 'vars',{X});
Is there a better way to do it?
The whole file is here on dropbox
It's a very simple problem where I'm trying to schedule 3 generators over 10 time steps while minimising cost. The constraints are that they can be throttled between 70-100%, or be switched off completely.
Also just a shout-out to Jonathan Currie. You're a champ! Opti is a great tool

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by