Constrained minimization where one variable has to be bigger than another
1 view (last 30 days)
Show older comments
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 Comments
Accepted Answer
Matt J
on 17 Oct 2018
Yes, you use the A,b inputs
A=[-1,1];
b=0;
2 Comments
John D'Errico
on 17 Oct 2018
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.
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!