Академический Документы
Профессиональный Документы
Культура Документы
Load Flow Analysis of a power system using Gauss Seidel method in MATLAB
This exercise concerns the development of a MATLAB program to solve power flow
problems using Gauss Seidel Method.
Calculate voltages at bus 2 and 3. Determine the line flows and line losses and the slack bus
real and reactive power. Line impedances are marked in per unit on a 100 MVA base. Use an
accuracy factor of 0.00001.
Construct a power flow diagram and show the direction of line flows.
MATLAB Code:
function Y=ybus(nbranch,ref)
clc %clear command window
if ref==0||ref==1
if ref==1 %if reference bus present
nbref=input('no of branches connected to the reference = ');
disp('enter line data')
for p=1:nbref
disp('from refernce bus :')
tb=input('to bus no. :');
tb=tb+1;
r=input('resistance of line =');
x=input('reactance of line =');
z = r + i*x; % Z matrix...
y = 1./z; % To get inverse of each element...
Ldata(p,:)=[1 tb r x y];
end
else
nbref=0;
end
for p=1+nbref:nbranch
fb=input('from bus no. :');
tb=input('to bus no. :');
r=input('resistance of line =');
x=input('reactance of line =');
if ref==1
fb=fb+1;
tb=tb+1;
end
z = r + i*x; % Z matrix...
y = 1./z; % To get inverse of each element...
Ldata(p,:)=[fb tb r x y];
end
fb = Ldata(:,1); % From bus number...
tb = Ldata(:,2); % To bus number...
r = Ldata(:,3); % Resistance, R...
x = Ldata(:,4); % Reactance, X...
y = Ldata(:,5);
nbus = max(max(fb),max(tb)); % no. of buses...
Y = zeros(nbus,nbus); % Initialise YBus...
First of all, we found out the Y-bus of the given power system. Then we found
voltages i.e V2 and V3 at load buses. The currents from node 1 to2, 2 to 3 and 1 to 3 was
found. After that, we found powers flow from each node. Then we found losses took place
due to power flow. The code also shows the number of iterations performed to satisfy the
given accuracy factor.
MATLAB Results:
Power Flow Diagram:
Summary:
Load flow analysis is performed to calculate the voltage magnitude and their respective phase
angles at different locations. It can also be used to find line flows and line losses. VAR
generation and consumption can also be calculated. In this exercise the desired voltages are
calculated after performing 7 iterations.