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

2 ビュー (過去 30 日間)
jacopo tacconi
jacopo tacconi 2017 年 6 月 12 日
回答済み: Walter Roberson 2017 年 6 月 12 日
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 Center および File ExchangeGet 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