MATLAB: Ramp Rate constraint in Economic Dispatch using Linprog function

economic dispatchlinear optimizationlinear programminglinprog functionOptimization Toolboxramp limitramp rate constraint

I have a problem in implementing ramp rate constraint using linprog function. I have 5 generators with marginal costs, ramp rate limits, min and max generation capacities as linear functions. In short my economic dispatch problem is as follows:
f = [1000 500 0 0 300]; %%Objective function
lb = [0 0 0 0 0]; %%Lower boundary
ub = [5000 9000 3500 1500 8000]; %%Upper boundary
Aeq = [1 1 1 1 1]; %%Equality Constraint
beq = L; %%Total load
Now, the ramp rate constraint: let PG1 be power generated by generator 1(say)
|PG1(k) - PG1(k-1)| <= Ramp rate limit(200);
where k is the optimization period. so how can i implement this using linprog function…?
PG = linprog(f,A,b,Aeq,beq,lb,ub);

Best Answer

f = [1000 500 0 0 300]; %%Objective function
A = [];
b = [];
Aeq = [1 1 1 1 1]; %%Equality Constraint
beq = L; %%Total load
lb = [0 0 0 0 0]; %%Lower boundary
ub = [5000 9000 3500 1500 8000]; %%Upper boundary
PG = linprog(f,A,b,Aeq,beq,lb,ub);
A = [eye(5);-eye(5)];
for i=1:288
b = [200+PG(1) ; 83.33+PG(2) ; 100+PG(3) ; 150+PG(4) ; 66.67+PG(5) ; 200-PG(1) ; 83.33-PG(2) ; 100-PG(3) ; 150-PG(4) ; 66.67-PG(5)];
PG = linprog(f,A,b,Aeq,beq,lb,ub);
end
Best wishes
Torsten.