Hi,
I'm using YALMIP to solve a unit commitment (UC) problem, and now I have a problem about calculating the energy price. I solve the UC with the MILP method as the example in the YALMIP website, and then value the onoff variables and optimize it again, but the result of dual(constraints) is NaN while the . The code is shown below:
Nunits = 3;
Horizon = 48;
Pmax = [100;50;25];
Pmin = [20;40;1];
Q = diag([.04 .01 .02]);
C = [10 20 20];
Pforecast = 100 + 50*sin((1:Horizon)*2*pi/24);
onoff = binvar(Nunits,Horizon,'full');
P = sdpvar(Nunits,Horizon,'full');
Constraints = [];
for k = 1:Horizon
Constraints = [Constraints, onoff(:,k).*Pmin <= P(:,k) <= onoff(:,k).*Pmax];
end
for k = 1:Horizon
Constraints = [Constraints, sum(P(:,k)) >= Pforecast(k)];
end
Objective = 0;
for k = 1:Horizon
Objective = Objective + P(:,k)'*Q*P(:,k) + C*P(:,k);
end
optimize(Constraints,Objective);
onoff=value(onoff);
optimize(Constraints,Objective)
dual(Constraints(2))
The Matlab output:
SCIP Status : problem is solved [optimal solution found]
Solving Time (sec) : 0.20
Solving Nodes : 1
Primal Bound : +7.02575353764882e+04 (5 solutions)
Dual Bound : +7.02575353764882e+04
Gap : 0.00
ans =
yalmiptime: 0.1541
solvertime: 0.2359
info: 'Infeasible problem (SCIP-linear)'
problem: 1
ans =
NaN
NaN
NaN
NaN
NaN
NaN
The matlab version is R2013b, the OptiToolbox version is edu V2.21, the yalmip version is 19-sep-2015.
I will very appreciate it if someone can help me.
Thank you!
Lawrence