Can I use Optimization tool like fmincon or ga etc if I have constraint optimization problem that optimization variable cannot be within a range inside upper and lower limit?

mumin chy (view profile)

on 21 Mar 2019
Latest activity Edited by Matt J

on 22 Mar 2019

Matt J (view profile)

Can I use Optimization tool like fmincon or ga etc if I have constraint optimization problem that optimization variable cannot be within a range inside upper and lower limit? I have an optimization problem with optimization variable x bounded to Lower_limit < x < Upper_Limit. But I have some constraint on x that x cannot be between inter_limit2 and inter_limit3. where Lower_limit < inter_limit2 < inter_limit3 < Upper_Limit.
Example : suppose I am solving an optimization problem where x should be within 1 and 10 or 29 and 99. The feasible space for x is from 1 to 10 and 29 to 99.
Any help?

on 22 Mar 2019
Edited by Matt J

Matt J (view profile)

on 22 Mar 2019

Example : suppose I am solving an optimization problem where x should be within 1 and 10 or 29 and 99. The feasible space for x is from 1 to 10 and 29 to 99.
This can be expressed using the mixed integer linear constraints,
28*b+1 <= x <= 89*b+10
where b is an additional unknown binary variable that you must include in your design vector. Since only ga and intlinprog support mixed integer constraints, you would have to use whichever of those is applicable to your objective function.

Walter Roberson (view profile)

on 21 Mar 2019

You could use the nonlinear constraints for that, but it is unlikely to work at all well.
Instead, run the problem once for each combination of disjoint ranges, and pick the best overall solution.

John D'Errico

John D'Errico (view profile)

on 21 Mar 2019
The important point is fmincon cannot jump from one domain to a second disjoint domain. So whatever domain you start the solver in, it will almost certainly stay there, never seeing if a better solution might exist in the other domain.
Walter Roberson

Walter Roberson (view profile)

on 21 Mar 2019
ga() might be able to jump though.