Constrained minimization where one variable has to be bigger than another
2 次查看(过去 30 天)
显示 更早的评论
I have a problem using fmincon.
Basically, I want to perform a constrained minimization, and the function I want to minimize has 2 variables.
The problem is that one variable has to be bigger than the other, that is x1 > x2. Is it possible to set such a constraint using this solver?
0 个评论
采纳的回答
Matt J
2018-10-17
Yes, you use the A,b inputs
A=[-1,1];
b=0;
2 个评论
John D'Errico
2018-10-17
This is of course the correct answer...
Subject to the caveat that an inequality constraint in fmincon is assumed to be of the form A*X<=b, and in fact this constraint can be violated by as much as TolCon. Care must be taken if the goal is truly a strict inequality, thus x1>x2.
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!