When using fmincon can I have a variable be constrainted by either a range OR zero?
1 vue (au cours des 30 derniers jours)
Titus Edelhofer le 25 Juil 2017
programmatically: yes, you can always formulate something like this as a non linear constraint. But the optimizer (and the theory behind) doesn't like the variable to jump. Let's say you have a value of 5. The optimizer (somewhat simplified:) ) looks in the neighborhood of the current point for a better solution, but will never do the jump to the zero.
Is your problem non linear so that you have to use fmincon? If it was linear, then intlinprog would be suitable to handle such cases through adding additional variables (and using integer variables).