Name of The Experiment:: Determination of Economic Operating Point For Three Units Using MATLAB
Name of The Experiment:: Determination of Economic Operating Point For Three Units Using MATLAB
Theory:
Economic Dispatch is the process of determination of the output power generated by the unit
or units to supply the specified load in a manner that will minimize the total cost of fuel. The
purpose of economic dispatch is to determine the optimal power generation of the units
participating in supplying the load.
Source Code:
clc
f1=fuel_cost1*h1;
close all
f2=fuel_cost2*h2;
P=0;
f3=fuel_cost3*h3;
syms p1
syms p2
d1=diff(f1,p1)==lamda;
syms p3
d2=diff(f2,p2)==lamda;
syms lamda
d3=diff(f3,p3)==lamda;
a=input('Enter total power, P: ');
h1=510.0+7.2*p1+.00142*p1.^2;
sol=solve(d1,d2,d3,P);
h2=310.0+7.85*p2+.00194*p2.^2;
p1=double(sol.p1)
h3=78.0+7.97*p3+.00482*p3.^2;
p2=double(sol.p2)
P=p1+p2+p3==a;
p3=double(sol.p3)
fuel_cost1=1.1;
lamda=double(sol.lamda)
fuel_cost2=1;
fuel_cost3=1;
Input / Output Window:
Conclusion:
From this experiment I have learnt to use some of the new and important library functions
such as – syms, which creates symbolic variables. In this code we took total demand as input
and showed the most economic operating point for the given three units.
Name of the experiment:
Determination of Economic Dispatch Outputs and Production Cost for the Unit
Combinations & System Load Level Using MATLAB.
Theory:
Unit commitment is an operational planning. The purpose of this planning is to determine a
schedule called Unit Commitment Schedule which tells us beforehand when and which units
to start and shut down during the operation over a prespecified time, such that the total
operating cost for that period becomes minimum.
Unlike economic load dispatch the objective of planning is not to distribute the load in real
time between the units already running in such a manner that the every instant cost becomes
minimum.
Source Code:
clc
clear all
for i=1:1:unit
end
disp('-----Min----------Max---------A---------B---------C-----');
combination=[1 1 1 1
1110
1101
1 1 0 0];
tran_cost= [0,1500,1500,3000,
3000,0,4500,1500,
3000,4500,0,1500,
6000,3000,3000,0];
end
PGT=[1100,1400,1600,1800];
end
disp('Lamda PG1 pG2 pG3 pG4 f1 f2 f3 f4 total');
if ad~=0
for z=1:1:4
for w=1:1:4
fprintf('\n');
if pg(1,w)~=0
disp(strcat('Stage--',int2str(PGT(z)),' '));
if pg(1,w)<mx(w)
fprintf('\n');
temp1=mx(w)-pg(1,w);
for j=1:1:4
if temp1<=ad
capacity=0;
pg(1,w)=mx(w);
for cpacity_check=1:4
ad=ad-temp1;
capacity=capacity+mx(1,cpacity_check)*combination(j,cpacity_check else
);
pg(1,w)=pg(1,w)+ad;
end
lamda=(pg(1,w)*a(w))+b(w);
if capacity>=PGT(1,z)
end
ad=0;
end
ain=0;
end
bt=0;
end
for i=1:4
end
if combination(j,i)
for f=1:4
ain=ain+(1/a(i));
cost(1,f)=(.5*a(f)*pg(1,f).^2+b(f)*pg(1,f)+c(f))*combination(j,f);
bt=bt+(b(i)/a(i));
end
end
cost=round(cost);
end
total_cost=sum(cost(1,:))*4;
at=1/ain;
lamda=at*(PGT(1,z)+bt);
value(1,:)=[lamda,pg(1,:),cost(1,:),total_cost];
for g=1:4
pg(1,g)=((lamda-b(g))/a(g)*combination(j,g));
unit_commit(z,j)=total_cost;
end
fprintf('%.3f %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f
pg=round(pg); \n',value(1,:));
if pg(1,v)>mx(v) display('-------------------infeasible------------------');
temp=pg(1,v); end
pg(1,v)=mx(v); end
temp=temp-mx(v); end
ad=ad+temp;
Input:
Output:
-----Min-------------Max---------A----------B---------C--------
100.0000 625.0000 0.0080 8.0000 500.0000
Stage--1800
11.756 470 558 386 387 5144 5466 4394 4126 76520
13.390 625 625 549 0 7063 6275 6444 0 79128
---------------------------------------------------infeasible-------------------------------------------------
---------------------------------------------------infeasible--------------------------------------------------
Conclusion:
I’ve learned to use some new library functions while writing the code. Such as- num2str(),
which convert number to string. The program to Determination of Economic Dispatch
Outputs and Production Cost for the Unit Combinations & System Load Level Using
MATLAB is written, executed and the output is verified successfully.
Name of the experiment:
Determination of Optimal Unit Commitment Policy for the Four Thermal Unit
Using Dynamic Programming Solution in MATLAB.
Theory:
Dynamic Programming is mainly an optimization over plain recursion. Wherever we see
a recursive solution that has repeated calls for same inputs, we can optimize it
using Dynamic Programming. The idea is to simply store the results of sub-problems, so
that we do not have to re-compute them when needed later. When initial & final demand
level is same we use backward DP.
Unit commitment is the process of deciding when and which generating units at each
power station to Page to start-up and shut-down. Economic dispatch is the process of
deciding what the individual power outputs should be of the scheduled generating units
at each time-point.
Source Code:
clc
for z=1:1:6
clear all
fprintf('\n');
mn=[100 100 75 75];
disp(strcat('Stage--',int2str(PGT(z)),' '));
mx=[625 625 600 500];
for j=1:1:4
a=[.0080 .0096 .0100 .0110];
capacity=0;
b=[8 6.4 7.9 7.5];
for cpacity_check=1:4
c=[500 400 600 400];
capacity=capacity+mx(1,cpacity_check)*combination(j,cpacity_check);
combination=[1 1 1 1
end
1110
if capacity>=PGT(1,z)
1101 ad=0;
1 1 0 0]; ain=0;
3000,4500,0,1500, if combination(j,i)
ain=ain+(1/a(i));
6000,3000,3000,0];
bt=bt+(b(i)/a(i))
PGT=[1100,1400,1600,1800,1400,1100];
end
disp('Lamda PG1 pG2 pG3 pG4 f1 f2 f3 f4 total');
end
for v=1:1:4 unit_commit(1,:)=unit_commit(1,:)*m;
if pg(1,v)>mx(v) unit_commit(6,:)=unit_commit(1,:);
temp=pg(1,v); aa=zeros(4,6);
pg(1,v)=mx(v); aa(:,6)=unit_commit(6,:);
end count=0;
end temp=0;
if pg(1,w)~=0 aa(k,i+1);
if pg(1,w)<mx(w) count=count+1;
temp1=mx(w)-pg(1,w); temp(1,count)=unit_commit(i,j)+tran_cost(j,k)+aa(k,i+1);
if temp1<=ad temp_com(1,count)=k;
pg(1,w)=mx(w); end
ad=ad-temp1; end
else if length(temp)>0
pg(1,w)=pg(1,w)+ad; aa(j,i)=min(temp(1,:));
lamda=(pg(1,w)*a(w))+b(w); else
end aa(j,i)=0;
end end
end end
end end
end fprintf('\n')
cost=round(cost); end
unit_commit(z,j)=total_cost; end
fprintf('%.3f %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f %.0f \n',value(1,:)); m=370000;
end if aa(i,j)~=0
end if aa(i,j)<m
end m=aa(i,j);
m=[0 0 0 0 com(j)=i;
0000 else
0000 m=m;
0 0 0 1]; end
end
Output:
Lamda PG1 PG2 PG3 PG4 f1 f2 f3 f4 total
Stage—1100
10.090 261 384 219 235 2860 3565 2570 2466 45844
10.805 351 459 291 0 3801 4349 3322 0 45888
10.774 347 456 0 298 3758 4316 0 3123 44788
12.073 509 591 0 0 5608 5859 0 0 45868
Stage--1400
10.804 350 459 290 300 3790 4349 3312 3145 58384
11.716 465 554 382 0 5085 5419 4347 0 59404
11.711 464 553 0 383 5073 5407 0 4079 58236
-------------------------------------------------------infeasible---------------------------------------------------
Stage--1600
11.280 410 508 338 344 4452 4890 3841 3631 67256
12.324 541 617 442 0 5999 6176 5069 0 68976
12.336 542 618 0 440 6011 6188 0 4765 67856
--------------------------------------------------------infeasible---------------------------------------------------
Stage--1800
11.756 470 558 386 387 5144 5466 4394 4126 76520
13.390 625 625 549 0 7063 6275 6444 0 79128
---------------------------------------------------------infeasible--------------------------------------------------
---------------------------------------------------------infeasible--------------------------------------------------
Stage--1400
10.804 350 459 290 300 3790 4349 3312 3145 58384
11.716 465 554 382 0 5085 5419 4347 0 59404
11.711 464 553 0 383 5073 5407 0 4079 58236
---------------------------------------------------------infeasible--------------------------------------------------
Stage—1100
10.090 261 384 219 235 2860 3565 2570 2466 45844
10.805 351 459 291 0 3801 4349 3322 0 45888
10.774 347 456 0 298 3758 4316 0 3123 44788
12.073 509 591 0 0 5608 5859 0 0 45868
n=
360984 309264 250880 183624 105604 45868
Followed Path
x9 -> x1 -> x1 -> x1 -> x3 ->x9
Conclusion:
I’ve learned to use some new library functions while writing the code. Such as- num2str(),
which convert number to string. This program was written using backward dynamic
programming as the initial and final load demand are same.