WHY Solver not applicable (cplex)

426 views
Skip to first unread message

凌梓

unread,
Jan 22, 2018, 1:13:09 AM1/22/18
to YALMIP
Dear Löfberg,
     I want to use cplex to solve the problem of energy interconnection optimization.
    When I finished all the programs, it was found that Solver not applicable (cplex). I guess it might be that my constraints are problematic, and when I delete some constraints(See below), CPLEX can be applicable.
But these constraints are the most core part of my entire program. What should I do?

for k = 1:24
Constraints =[Constraints,Beta(k)*(Pe_net(k)+Pw(k)-P_p2g(k)+2.934*Gamma(k)*(Pg_net(k)+0.0987*P_p2g(k)-Pg_dc(k)))-Pe_dc(k)==Pe_load(k)]; %电功率平衡约束
Constraints =[Constraints,0.9*(1-Beta(k))*(Pe_net(k)+Pw(k)-P_p2g(k)+2.934*Gamma(k)*(Pg_net(k)+0.0987*P_p2g(k)-Pg_dc(k)))+6.651*Gamma(k)*(Pg_net(k)+0.0987*P_p2g(k)-Pg_dc(k))+7.9218*(1-Gamma(k))*(Pg_net(k)+0.0987*P_p2g(k)-Pg_dc(k))-Ph_dc(k)==(Pc_load(k)/1.38)+Ph_load(k)]; %冷热功率平衡约束
 end

for k = 1:24
  Constraints = [Constraints, 0<=Gamma(k)*(Pg_net(k)+Pg_dc(k)-0.0987*P_p2g(k))<=204.499];%微燃机额定容量约束
  Constraints = [Constraints, 0<=(1-Gamma(k))*(Pg_net(k)+Pg_dc(k)-0.0987*P_p2g(k))<=71.515];%燃气锅炉额定容量约束
  Constraints = [Constraints, 0<=(1-Beta(k))*(Pe_net(k)+Pw(k)-P_p2g(k)+2.934*Gamma(k)*(Pg_net(k)+0.0987*P_p2g(k)+Pg_dc(k)))<=500];%电锅炉额定容量约束
end



Thank you!
energyhub_one.m

Johan Löfberg

unread,
Jan 22, 2018, 3:04:06 AM1/22/18
to YALMIP
You have loads of nonconvex products between decision variables. That is not allowed in *linear* (or convex quadratic) models

Maybe you have things like turning on and off stuff, which you never should do using products

凌梓

unread,
Jan 22, 2018, 5:00:07 AM1/22/18
to YALMIP
thanks a lot .I will try to modify it.

liuyan...@gmail.com

unread,
Feb 1, 2018, 1:16:40 PM2/1/18
to YALMIP
同学你好,我是做电力系统规划的,新用yalmip,最近也碰到这个问题,是不是约束里不能变量相乘求解呢?你的这个问题解决了么?求指导。。谢谢啦

凌梓

unread,
Feb 2, 2018, 11:16:01 AM2/2/18
to YALMIP
您好。不好意思刚刚看见,约束中变量是不能相乘的,你可以看看Johan Löfberg给的这个例子
我的解决思路是尝试重新选择变量,按照例子中的思路,换种放式来确定约束的,避免了变量相乘。

王韬

unread,
Feb 23, 2018, 11:50:15 AM2/23/18
to YALMIP
朋友你好,请问可不可以具体讲讲你是怎么避免变量相乘的呢?我也遇到了同样的问题。谢谢

Johan Löfberg

unread,
Feb 23, 2018, 12:16:04 PM2/23/18
to YALMIP
This is an English speaking forum,

however, the questions is discussed a lot here

王韬

unread,
Feb 23, 2018, 12:51:03 PM2/23/18
to YALMIP
Sorry for that
I do run into a trouble and I'm fresh in this field, so I got a little bit anxious.
I've read that example twice before, but not got much help.
gonna read that again, and if I still couldn't solve it, hope you can give me some help.
SO MUCH THX!

Johan Löfberg

unread,
Feb 23, 2018, 1:22:43 PM2/23/18
to YALMIP
to model x*y where x is continuous and y is binary, you introduce new variable z and implies(y, x==z)+implies(1-y, z == 0)
Reply all
Reply to author
Forward
0 new messages