Re: How do I implement conditional statement for the wind power coefficient mu in the wind power modeling expression into matlab code using YALMIP solver

121 views
Skip to first unread message
Message has been deleted

Johan Löfberg

unread,
Nov 16, 2014, 12:13:08 PM11/16/14
to yal...@googlegroups.com
This is a nonconvex constraint I hope you know, i.e, very hard. One way is to model it using binary variables

mu = sdpvar(1)
WC
= sdpvar(1)
region
= binvar(3,1);

Model = [sum(region)==1,0 <= mu <= 1, WCmin <= WC <= WCmax];
Model = [model, implies
(region(1), [mu == 1, WCmin >= WC];
Model = [model, implies(region(2), [mu == blabla, WCmin <= WC<=WCmax];
Model = [model, implies(region(3), [mu == 0, WC>=WCmax];

Make sure you understand what is done here, and note that it leads to a mixed-integer SDP, for which there are no efficient public solvers (YALMIPs internal b&b solver bnb will be used, but it is really slow compared to a real MILP or MIQP solver). Adding integrality to an SDP is much worse than adding integrality to an LP or QP
http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Commands.Implies
http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.Big-MAndConvexHulls

For all your other questions, those question have nothing to do about YALMIP or related modelling, just stuff you have to figure out on your own

Kolapo Alli

unread,
Nov 17, 2014, 5:28:47 AM11/17/14
to yal...@googlegroups.com
Thanks for your support sir. I will read more on those aspects sir.And is there a way you can explain better on how YALMIP works and it's functions in optimization process sir?

Johan Löfberg

unread,
Nov 17, 2014, 7:05:23 AM11/17/14
to
YALMIP is a modelling language. It transform your high-level representation to a low-level solver specific format.

Kolapo Alli

unread,
Nov 19, 2014, 10:39:33 AM11/19/14
to yal...@googlegroups.com
I appreciate your suggestion sir but concerning the mu logical constraint definition, there is problem with the third expression after i amended the parenthesis in the definition for mu which you suggested when trying to implement in my m code sir. The code seems to have complain of invalid parenthesis in the third expression i.e Model = [model, implies(region(2)), [mu == WCmax-WC/WCmax-WCmin, WCmin <= WC<=WCmax]; and I have tried all my very best on this to make it works. Is there a way out I can figure out this problem to make the code run?
Thank you sir , I have the amended logical constraint for mu as follows;

mu = sdpvar(1)
WC = sdpvar(1)
region = binvar(3,1);

Model = [sum(region)==1,0 <= mu <= 1, WCmin <= WC <= WCmax];
Model = [model, implies(region(1)), [mu == 1, WCmin >= WC];
Model = [model, implies(region(2)), [mu == WCmax-WC/WCmax-WCmin, WCmin <= WC<=WCmax];
Model = [model, implies(region(3)), [mu == 0, WC>=WCmax];

Johan Löfberg

unread,
Nov 19, 2014, 3:08:05 PM11/19/14
to yal...@googlegroups.com
There are missing parenthesis and brackets in all implications

Model = [model, implies(region(1)), [mu == 1, WCmin >= WC])];

etc


Johan Löfberg

unread,
Nov 20, 2014, 2:08:18 AM11/20/14
to yal...@googlegroups.com
Sorry, that should of course be

Model = [model, implies(region(1), [mu == 1, WCmin >= WC])];


Reply all
Reply to author
Forward
Message has been deleted
0 new messages