Anda di halaman 1dari 10

Ain Shams University

College of Engineering
Third Year Electrical Power & Machines Department
Economics of Generation & Operation

MATLAB’s Report

Dr. Mohamed EL-Shimy M. Bekhet

‫ محمد شديد عباس محمد‬: ‫الامس‬


Section (5)
Bench Number (33233)
Table of Contents :
The problem
The solution code
Results of code’s runtime
Plotting and figures
The problem :
2
C1= 0.00889P1 + 10.333P1 + 200 $/hr
C2 = 0.00741P22 + 10.833P2 + 240 $/hr
PD= 150 MW
PL = 0.001P12 + 0.002P22 – 2×0.002P1P2 MW

Kmax = 15
The solution code:

%defining the constants


a(1)=200; b(1)=10.33; g(1)=0.00889;
a(2)=240; b(2)=10.833; g(2)=0.00741;
alfa=0.05;
ebsilon=0.001;
kmax=15;
pd=150;
B11=0.001;
B22=0.002;
B12=-0.0002;
%lambda’s equation
lamda(1)=(pd+sum(b./(2.*g)))/sum(1./(2.*
g));
%beginning of the iteration process
for i=1:2
p(1,i)=(lamda(1)-b(i))/(2*g(i));
end
deltap=inf;
for k=1:kmax
if abs(deltap)>ebsilon
p(k+1,1)=((lamda(k)*(1-
2*B12*p(k,2)))-
b(1))/(2*g(1)+2*lamda(k)*B11);
p(k+1,2)=((lamda(k)*(1-
2*B12*p(k,1)))-
b(2))/(2*g(2)+2*lamda(k)*B22);

pl(k+1)=B11*((p(k+1,1))^2)+B22*((p(k+1,2
))^2)+2*B12*p(k+1,1)*p(k+1,2);
deltap(k+1)=pd+pl(k+1)-p(k+1,1)-
p(k+1,2);
lamda(k+1)=lamda(k)+alfa*deltap(k+1);
end
end
deltap(1)=0;
%ending of the iteration process
i=[0:(length(pl)-1)]';
%printing the output
fprintf('output order in matrix m is
order ,p1 ,p2 ,losses , delta p , price
of energy');
%outputing the results
m=[i,p,pl',deltap',lamda']
Results of code’s runtime :
This is a sample runtime of the code on MATLAB
output order in matrix m is order ,p1 ,p2 ,losses , delta p , price of energy
m=

0 83.6196 66.3804 0 0 11.8168


1.0000 43.4766 22.2108 2.4906 86.8032 16.1569
2.0000 119.1856 70.5483 20.7960 -18.9379 15.2100
3.0000 110.1501 67.4352 18.2569 -9.3284 14.7436
4.0000 101.7894 61.7961 15.4825 1.8971 14.8385
5.0000 102.7298 62.1461 15.7240 0.8481 14.8809
6.0000 103.5043 62.6732 15.9742 -0.2033 14.8707
7.0000 103.3954 62.6271 15.9448 -0.0777 14.8668
8.0000 103.3227 62.5770 15.9211 0.0214 14.8679
9.0000 103.3349 62.5826 15.9245 0.0070 14.8682
10.0000 103.3416 62.5873 15.9267 -0.0022 14.8681
11.0000 103.3403 62.5867 15.9263 -0.0006 14.8681
Plotting and figures :
Given the data from the sample runtime of the code, we can obtain
the following graphs :
The power of each station :
The losses in the line :

P for the system :


The price of Energy :

----- End of Report -----

Anda mungkin juga menyukai