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?

采纳的回答

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 个)

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by