Constrained minimization where one variable has to be bigger than another

1 次查看(过去 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?

采纳的回答

Matt J
Matt J 2018-10-17
Yes, you use the A,b inputs
A=[-1,1];
b=0;
  2 个评论
John D'Errico
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!

Translated by