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?
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!