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?

2 次查看(过去 30 天)
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?

采纳的回答

Matt J
Matt J 2019-3-22
编辑:Matt J 2019-3-22
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.

更多回答(1 个)

Walter Roberson
Walter Roberson 2019-3-21
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.
  5 个评论
Walter Roberson
Walter Roberson 2020-4-11
编辑:Walter Roberson 2020-4-28
Cute, but that will not work in practice.
fmincon searches around trying to find a feasible point. Once it finds one, it tries to maintain feasibility (or "not much outside feasible"). Suppose for example it was at 9 and found it was feasible, then it might possibly in the early stages try (for example) 10.1 and discover that it is outside. It would then contract back towards the last feasible point; it is not going to suddenly decide to give up on a successful area and go wandering in hopes that another area might also be successful.
The exception to this is that MATLAB uses the linear constraints to divide the search area into bounded regions, and after exploring one region permitted by linear constraints, it moves on to the next region permitted by linear constraints. But you cannot use linear constraints to express disjoint regions in a single variable.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by