Professional Documents
Culture Documents
Submitted by:
Name: Shahabuddin
Class roll: AE-073-05
Exam roll: 439
Session: 2018-2019
E-mail: shahabuddin-2018026137@eee.du.ac.bd
Date of completion:1/09/2022
Date of submission: 04/09/2022
1. Write a programming code for the Gauss-Seidel method to solve load flow problem.
z = r+1i*x;
y = 1./z;
for k = 1:length(fb)
for m = 1:nbus
for n = 1:length(fb)
if (fb(n) == m)
Ybus(m, m) = Ybus(m, m)+ y(n) + b(n);
elseif (tb(n) == m)
Ybus(m, m) = Ybus(m, m)+ y(n) + b(n);
end
end
end
% MATLAB Code
% General Program For Newton Raphson Load flow
switch ps
case 5
Power_System_IEEE_5bus; disp('IEEE 5 bus Power System')
case 6
Power_System_IEEE_6bus; disp('IEEE 6 bus Power System')
case 9
Power_System_IEEE_9bus; disp('IEEE 9 bus Power System')
case 14
Power_System_IEEE_14bus; disp('IEEE 14 bus Power System')
case 4
Power_System_GS_4bus; disp('GS 4 bus Power System')
end
%% Data of the power system is stored in the Bus_Data and Line_Data matrix
% in the Power_System_IEEE_nbus.m file, which need to import here.
BMva=100; %Base MVA for the system
N_Buses=length(Bus_Data(:,1)); % number of buses in the power system for LFA
V=Bus_Data(:,2);
del=Bus_Data(:,3);
Pg=Bus_Data(:,4);
Qg=Bus_Data(:,5);
Pl=Bus_Data(:,6);
Ql=Bus_Data(:,7);
Qmin=Bus_Data(:,8);
Qmax=Bus_Data(:,9);
type=Bus_Data(:,10);
%Mismatch calculation
dPa=Active_Power_specified-P;
dQa=Reactive_Power_specified-Q;
% Update correction
del(2:N_Buses)=del(2:N_Buses)+dTh; % Voltage angle update
for k=1:N_Buses
if Bus_Data(k,10)==1
% Real and reactive generation at the Slack bus
P_generation(k)=real(S(k))+Bus_Data(k,6);
Q_generation(k)=imag(S(k))+Bus_Data(k,7);
end
if Bus_Data(k,10)==2
% Real and reactive generation at the PV buses
P_generation(k)=real(S(k))+Bus_Data(k,6);
Q_generation(k)=imag(S(k))+Bus_Data(k,7);
end
if Bus_Data(k,10)==3
P_generation(k)=0;
Q_generation(k)=0;
end
end
% .*conj(Vm_Buses(fb)-0)
% .*conj(Vm_Buses(tb)-0)
% Define active and reactive power flows
Pij=real(Ss);
Qij=imag(Ss);
Pji=real(Sr);
Qji=imag(Sr);
disp('-------------------------------------------------------------------------');
disp(' Generation Load')
disp(' Bus Volts Angle Real Reactive Real Reactive ')
disp('-------------------------------------------------------------------------');
ywz=[ Bus_Data(:,1) abs(Vm_Buses) (180/pi)*angle(Vm_Buses) P_generation'
Q_generation' Bus_Data(:,6) Bus_Data(:,7)];
disp(ywz)
disp('-------------------------------------------------------------------------');
disp(' Line Flows ')
disp(' #Line From Bus To Bus Real Reactive ')
disp('-------------------------------------------------------------------------');
l=1:1:length(Line_Data(:,1));
xy=[l' fb tb Pij Qij];
yx=[l' tb fb Pji Qji];
disp(xy)
disp(yx)
% toc
%Plotting results
figure(1)
bar(abs(Vm_Buses))
xlabel('Network buses')
ylabel('Magnitude of bus voltages (pu)')
figure(2)
bar(P_generation)
xlabel('Network buses')
ylabel('Real power generation from sources (pu)')
figure(3)
bar(Q_generation)
xlabel('Network buses')
ylabel('Reactive power generation from sources (pu)')
2. Consider different standard power system. You may consider, IEEE standard network,
for example, IEEE 5, 6, 9 ,14, 26, 39, 58, etc. bus systems, and 4 bus system in the book;
Power system analysis by Stevenson and Grainger.
Ans:
Let us consider a 9-bus network-
%% Topology of the power system
% Information about the bus matrix
% nd V Ang. Pg Qg PL QL Gs jBs Type
% (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)
% Colum 11: if the bus has shunt element =1, if it hasnt shunt element =0
Bus_Data = [1 1.0 0.0 0.00 0.0 0.00 0.0 0.0 0.0 1 0;
2 1.0 0.0 2.82 0.0 0.00 0.0 0.0 0.0 2 0;
3 1.0 0.0 1.85 0.0 0.00 0.0 0.0 0.0 2 0;
4 1.0 0.0 0.00 0.0 0.00 0.0 0.0 0.0 3 0;
5 1.0 0.0 0.00 0.0 0.90 0.30 0.0 0.0 3 0;
6 1.0 0.0 0.00 0.0 0.85 0.80 0.0 0.0 3 0;
7 1.0 0.0 0.00 0.0 1.43 .35 0.0 0.0 3 0;
8 1.0 0.0 1.10 0.0 0.00 0.0 0.0 0.0 2 0;
9 1.0 0.0 0.00 0.0 0.60 .50 0.0 0.0 3 0];
3.Using the standard network system, you may consider IEEE 4,5,6,9,14 etc find: (i) Node voltages in
the network, (ii) check load-generation balance, (iii) power flow through each line in the network, (iv)
power losses in the network, (v) number of iterations and solution time to solve the load flow problem,
(vi) check reactive power status at the PV and slack buses, (vii) use both tables and graphs to present
the load flow analysis.
Solution:
Consider a 9-bus network to answer those question.
Line Flows
#Line From Bus To Bus Real Reactive
------------------------------------------------------------
1.0000 1.0000 4.0000 0.1410 0.3424
2.0000 4.0000 5.0000 0.0326 0.0163
3.0000 5.0000 6.0000 0.0329 0.1140
4.0000 3.0000 6.0000 0.1033 -0.3700
5.0000 6.0000 7.0000 0.0385 -0.0109
6.0000 7.0000 8.0000 -0.0078 0.2950
7.0000 8.0000 2.0000 0.0501 0.5640
8.0000 8.0000 9.0000 0.2335 -0.5105
9.0000 9.0000 4.0000 -0.0357 -0.3374
(v). Number of iterations and solution time to solve the load flow
problem
Number Of Iteration : 6
Solution time : 0.039 sec.
(vi). Check reactive power status at the PV and slack bus
Bus Reactive
power(p.u.)
2 0.2505
3 0.5165
8 0.3912
04-Sep-2022
Number Of Ieration : 6
Solution time : 0.039 sec.
Total real power losses : 0.883675.
Total reactive power losses: -1.14173.
--------------------------------------------------------------------
Generation Load
Bus Volts Angle Real Reactive Real Reactive
--------------------------------------------------------------------
1.0000 1.0000 0 -1.7120 0.7052 0 0
2.0000 1.0000 43.5860 2.8200 0.2505 0 0
3.0000 1.0000 29.6287 1.8500 0.5165 0 0
4.0000 0.9644 5.8685 0 0 0 0
5.0000 0.9529 8.4509 0 0 0.9000 0.3000
6.0000 0.9758 23.2499 0 0 0.8500 0.8000
7.0000 0.9766 25.6807 0 0 1.4300 0.3500
8.0000 1.0000 33.4345 1.1000 0.3912 0 0
9.0000 0.9319 13.3245 0 0 0.6000 0.5000
--------------------------------------------------------------------
Line Flows
#Line From Bus To Bus Real Reactive
---------------------------------------------------------------------
1.0000 1.0000 4.0000 0.1410 0.3424
2.0000 4.0000 5.0000 0.0326 0.0163
3.0000 5.0000 6.0000 0.0329 0.1140
4.0000 3.0000 6.0000 0.1033 -0.3700
5.0000 6.0000 7.0000 0.0385 -0.0109
6.0000 7.0000 8.0000 -0.0078 0.2950
7.0000 8.0000 2.0000 0.0501 0.5640
8.0000 8.0000 9.0000 0.2335 -0.5105
9.0000 9.0000 4.0000 -0.0357 -0.3374
1.0000 4.0000 1.0000 -0.1016 -0.3424
2.0000 5.0000 4.0000 -0.0111 -0.1544
3.0000 6.0000 5.0000 0.1255 -0.4199
4.0000 6.0000 3.0000 -0.0601 0.3700
5.0000 7.0000 6.0000 0.0454 -0.1661
6.0000 8.0000 7.0000 0.1288 -0.4197
7.0000 2.0000 8.0000 0.0501 -0.5640
8.0000 9.0000 8.0000 0.0206 0.2623
9.0000 4.0000 9.0000 0.0976 0.1896
Voltage at each bus improves when load equals generation and power flows from the higher voltage angle bus
to lower voltage angle bus because the power is ac.
-------------------------------------------------------------------------
(v). Number of iterations and solution time to solve the load flow
problem
Number Of Ieration : 6
Solution time : 0.039 sec.
Bus Reactive
power(p.u.)
2 0.1038
3 0.3996
8 0.0917
(vii). Use both tables and graph to present the load flow analysis
----------------------------------------
----------------------------------------
04-Sep-2022
Number Of Ieration : 6
-------------------------------------------------------------------------
Generation Load
-------------------------------------------------------------------------
-------------------------------------------------------------------------
Line Flows
-------------------------------------------------------------------------