Fmincon, is it possible to give a priority to the constraints defined?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
jacopo tacconi
am 12 Jun. 2017
Beantwortet: Walter Roberson
am 12 Jun. 2017
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
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 12 Jun. 2017
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with Optimization Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!