You are on page 1of 4

% BSc(Hons) Electrical Electronic Engineering

% Module 6EJ998
% Assignment No2
% MODELLING LOAD FLOW STUDIES USING MATLAB
% USING THE GAUSS SEIDAL METHOD
% YEAR 2010/11
% STUDENT Ndumiso Nsingo
% NETWORK (see Fig 1)
% Input (1)
% Insert the Network Admittance Matrix
% (see page 2 of supplied assignment paperwork ignoring shunt capacitive admitt
ance)
format short
Y(1,1) = 10.95890411 - 26.02739726i
Y(1,2) = -3.424657534 + 7.534246575i;
Y(1,3) = -3.424657534 + 7.534246575i;
Y(1,4) = 0.00;
Y(1,5) = -4.109589041 + 10.95890411i;

Y(2,1) = -3.424657534 + 7.534246575i;


Y(2,2) = 11.67208021 - 26.09094761i;
Y(2,3) = 0.00;
Y(2,4) = -4.12371134 + 9.278350515i;
Y(2,5) = -4.12371134 + 9.278350515i;

Y(3,1) = -3.424657534 + 7.534246575i;


Y(3,2) = 0.00;
Y(3,3) = 6.351486803 - 13.87570999i;
Y(3,4) = -2.926829268 + 6.341463415i;
Y(3,5) = 0.00;

Y(4,1) = 0.00;
Y(4,2) = -4.12371134 + 9.278350515i;
Y(4,3) = -2.926829268 + 6.341463415i;
Y(4,4) = 11.17425195 - 24.89816445i;
Y(4,5) = -4.12371134 + 9.278350515i;

Y(5,1) = -4.109589041 + 10.95890411i;


Y(5,2) = -4.12371134 + 9.278350515i;
Y(5,3) = 0.00;
Y(5,4) = -4.1237113 + 9.278350515i;
Y(5,5) = 12.35701172 - 29.51560514i;

% Input (2)
% Input the given node loadings .....see diagram on page 1 of the supplied assi
gnment paperwork
% A positive (+ sign) is for generated power,
% The negative (- sign) indicates load taken from the network.
% Per unit loading is used with a base loading taken at 100MVA

P2 = - 0.4; % p.u. active power loading


P3 = - 0.25; % p.u. active power loading
P4 = - 0.4; % p.u. active power loading
P5 = - 0.5; % p.u. active power loading

Q2 = - 0.2i; % p.u. reactive power loading


Q3 = - 0.15i; % p.u. reactive power loading
Q4 = - 0.2i; % p.u. reactive power loading
Q5 = - 0.2i; % p.u. reactive power loading

% The voltage at the generation busbar, node (1) is 1.0 p.u.


% This voltage is fixed and therefore determines the reference ....
% ... or SLACK BUSBAR must be Node(1)

% GAUSS SEIDAL SOLUTION


% The number of iteration will need to be set
% Set the value of 'l' the chosen number of iterations
% l=40 will be used since this is the number used in the JACOBI solution.

l = 40; % sets the number of iterations


m = l + 1; % allocates the space used to store each iteration
vector = [1:m]; % assigns a row with the appropriate spaces

row = ones(size(vector));

Vnode1 = row; % each node voltage has the required storage spaces
Vnode2 = row;
Vnode3 = row;
Vnode4 = row;
Vnode5 = row;
for n = 1:m
Vnode1(n) = 1.0 + 0.00i; % inserts the assumed initial node voltages
Vnode2(n) = 1.0 + 0.00i;
Vnode3(n) = 1.0 + 0.00i;
Vnode4(n) = 1.0 + 0.00i;
Vnode5(n) = 1.0 + 0.00i;
end
S2star = P2 - Q2; % conjugates of the specified node loadings
S3star = P3 - Q3;
S4star = P4 - Q4;
S5star = P5 - Q5;

% Now Proceed with the GAUSS SEIDAL SOLUTION


% Following the same method as in the worked example
% Page 16 of the assignment notes

for n = 1:l
% NOW UPDATE THE NODE VOLTAGES TWENTY FIVE TIMES
% SIMILAR TO THE CALCULATION PROCEDURES
% AS DETAILED ON PAGE 5 OF THE ASSIGNMENT NOTES

V2star(n) = conj(Vnode2(n)); % conjugate of V2


V3star(n) = conj(Vnode3(n)); % conjugate of V3
V4star(n) = conj(Vnode4(n)); % conjugate of V4
V5star(n) = conj(Vnode5(n)); % conjugate of V5

% (Step 1) Solving for the updated values of the currents

I2(n) = S2star/V2star(n);

% (Step 2) Solving the summation of Y(kj)V(j) for all busbars

Sum2(n) = (Y(2,1) * Vnode1(n)) + (Y(2,3) * Vnode3(n)) + (Y(2,5) * Vnode5(n))


;

% (Step 3) Solving for the new value of node voltage

V2(n) = ( I2(n) - Sum2(n) ) / Y(2,2);


Vnode2(n) = V2(n); % Immediately updates the current value of Vnode
2
% (Step 4)
% Now determine the new value of Vnode3
% This calculation uses the new updated value of Vnode2
I3(n) = S3star/V3star(n);
Sum3(n) = (Y(3,1) * Vnode1(n)) + (Y(3,2) * Vnode2(n)) + (Y(3,4) * Vnode4
(n));
V3(n) = ( I3(n) - Sum3(n) ) / Y(3,3);
Vnode3(n) = V3(n); % Immediately updates the current value of Vnode3
% (Step 5)
% Now determine the new value of Vnode4
% This calculation uses the new updated value3 of Vnode2 and Vnode3
I4(n) = S4star/V4star(n);
Sum4(n) = (Y(4,3) * Vnode3(n)) + (Y(4,5) * Vnode5(n));
V4(n) = ( I4(n) - Sum4(n) ) / Y(4,4);
Vnode4(n) = V4(n); % Immediately updates the current value of
Vnode4
% (Step 5)
% Now determine the new value of Vnode5
% This calculation uses the new updated value3 of Vnode2 Vnode3 & Vnode4
I5(n) = S5star/V5star(n);
Sum5(n) = (Y(5,1) * Vnode1(n)) + (Y(5,2) * Vnode2(n)) + (Y(5,4) * Vnode4
(n));
V5(n) = ( I5(n) - Sum5(n) ) / Y(5,5);
Vnode5(n) = V5(n); % Immediately updates the current value of Vnode4
u = 1 + n;
Vnode2(u) = V2(n);
Vnode3(u) = V3(n);
Vnode4(u) = V4(n);
Vnode5(u) = V5(n);

end
disp (':')
disp (' Electrical Power Utilisation 6EJ022 ')
disp (':')
disp (' Gauss Seidal Solution of Load Flow Assignment(2) 2010/11 ')
disp (':')
disp (' Ndumiso Nsingo 01/04/2011 ')
disp (':')
disp (' Successive Iteration Values ')
disp (':')
disp (' Vnode2 Vnode3 Vnode4 Vnode5
')
disp(':')

d = 0;
for c = 1:m
fprintf(' %1.4f %1.4fi\t, %1.4f %1.4fi\t, %1.4f %1.4fi\t, %1.4f %1.4fi\n
',...
real(Vnode2(1+d)), imag(Vnode2(1+d)), real(Vnode3(1+d)),...
imag(Vnode3(1+d)), real(Vnode4(1+d)), imag(Vnode4(1+d)), real(Vnode5(1+d
)), imag(Vnode5(1+d)));
d=d+1;
end
plot (vector,Vnode2,'r-',vector,Vnode3,'b-',vector,Vnode4,'g-',vector,Vnode5,'y-
');
legend ('Busbar 2','Busbar 3','Busbar 4','Busbar 5');
axis ([0,40,0.93,1]);
grid on;
title ('Gauss-Seidel Itteration Method Without Shunt Admittance');
xlabel ('Itteration number');
ylabel ('voltage at node');

You might also like