how to impelement u1<=u2<=u3 as linear inequality

1 view (last 30 days)
in my optimizations i have following constraint u1<=u2<=u3 i think i have to use linear equality constaints. ie.Ax<b I am using x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon). Any one has any idea? thanks in advance for the help

Accepted Answer

Matt J
Matt J on 3 Aug 2017
A=[1 -1 0; 0 1 -1]; b=[0;0];
  4 Comments
John D'Errico
John D'Errico on 3 Aug 2017
@Raihan - You stated that you wanted to implement the combined constraint:
u1<=u2<=u3
That is short hand for two inequalities:
u1 <= u2
AND
u2 <= u3
However, transitivity applies here. If u1<=u2, AND u2<=u3, then you need never bother to apply a third constraint, that is, it is always true that u1<=u3.
You wrote u3<u1 in your comment, and of course this MUST be always false, since I just said that the two constraints imply that u1<=u3.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!