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

5 ビュー (過去 30 日間)
Ashley Thornton
Ashley Thornton 2015 年 8 月 22 日
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 Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by