Fmincon, is it possible to give a priority to the constraints defined?

2 次查看(过去 30 天)
Dear all, I have to solve a simple optimization problem with few equality and inequality constraints. To do that, I am using fmincon. Due to the fact that not all the constraints that I am using have the same priority in my problem, I was wandering if there is any way to tell Matlab which constraint is more important and have to be satisfied first. If the less important constraints are not satisfied, this will not cause an issue to my work. Thank you very much in advance, Jacopo

采纳的回答

Walter Roberson
Walter Roberson 2017-6-12
Depending on you function, you might be able to express your less important constraints in terms of numeric penalties. For example, if x(3) being outside the range [x(2)-5, x(2)+5] is not critical, then
f = .... + (x(3) < x(2)-5 | x(3) > x(2)+5) .* 5 .* abs(x(3)-x(2))^2
would give a penalty of 5 times the square of the difference to x(2) for being outside the area, but would otherwise not reject the possibility. (The best weight for the penalty would depend upon the priority and upon the typical function values.)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by