Experiment No 8

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Experiment No: 03

Experiment Name: To Study of Load Flow Analysis by Gauss-Seidel Method using


MATLAB.

Objective:
The objective of this lab is to develop a generalized MATLAB program to perform load flow
analysis using the Gauss-Seidel method. This experiment aims to calculate the bus voltages
and the power flows in a power system network.

Theory:
Load flow analysis, also known as power flow analysis, is an essential tool in electrical
power system engineering for planning, operational studies, and optimization. It calculates
the voltage, current, real power, and reactive power in a power system under steady-state
conditions. Among the various methods available, the Gauss-Seidel method is one of the
simplest iterative techniques for solving nonlinear power flow equations.
The Gauss-Seidel method uses an iterative approach, updating the voltage at each bus in the
system until the solution converges to an acceptable tolerance. This approach is
computationally efficient for small and moderately sized systems but can be slow for larger
systems due to its slower convergence rate compared to other methods like Newton-Raphson.
The n complex equation that describe the power injected to an n node power system are:
Si = Pi + jQi = ViIi*
n
= ∑ V i Y ik∗V k ∗¿ ¿ k=1,2,3,…………n
k =1
n

=V i Y ii∗V i*+∑ V i Y ik∗V k ∗¿ ¿


k =1
k ≠i
Rearranging the equations we get –
n
Si
Y ii∗V i∗¿ = -∑ V i Y ik∗V k ∗¿ ¿ i=1,2,3……….n
V i k =1
k ≠i
n
1
Therefore, V i = ¿ -∑ V i Y ik∗V k ∗¿ ¿]……………………. (1)
Y ii k =1
k ≠i
The equation (1) is showing the voltage at bus i.

Problem:
Considering a 4-bus power system with the following configuration:
 Bus 1: Slack bus, voltage V1=1.05V_1 = 1.05V1=1.05 p.u.
 Bus 2: PQ bus with a load of 1.0 p.u. (real power) and 0.5 p.u. (reactive power).
 Bus 3: PQ bus with a load of 1.5 p.u. (real power) and 0.75 p.u. (reactive power).
 Bus 4: PV bus, with a real power generation of 1.0 p.u. and a voltage magnitude of
1.02 p.u.

From Bus To Bus Resistance RRR Reactance XXX Line Charging


(p.u.) (p.u.) BBB (p.u.)
1 2 0.02 0.06 0.015
1 3 0.08 0.24 0.01
2 3 0.06 0.18 0.02
2 4 0.06 0.18 0.02
3 4 0.04 0.12 0.015
MATLAB CODE:
% Gauss-Seidel Load Flow Analysis for a 4-Bus System

% Line data [From, To, R, X, B/2]


line_data = [
1 2 0.02 0.06 0.015;
1 3 0.08 0.24 0.01;
2 3 0.06 0.18 0.02;
2 4 0.06 0.18 0.02;
3 4 0.04 0.12 0.015
];

% Initialize Bus Data: [Bus, V_specified, P_specified, Q_specified, type (1=slack, 2=PQ,
3=PV)]
bus_data = [
1 1.05 0 0 1; % Slack bus (bus 1)
2 1.0 -1.0 -0.5 2; % PQ bus (bus 2)
3 1.0 -1.5 -0.75 2; % PQ bus (bus 3)
4 1.02 1.0 NaN 3 % PV bus (bus 4)
];

% Power flow parameters


tolerance = 1e-6; % Convergence tolerance
max_iter = 100; % Maximum number of iterations

% Step 1: Calculate Y-Bus Matrix


num_buses = size(bus_data, 1);
Y_bus = zeros(num_buses);

for k = 1:size(line_data, 1)
from = line_data(k, 1);
to = line_data(k, 2);
R = line_data(k, 3);
X = line_data(k, 4);
B = line_data(k, 5);
Z = R + 1i * X;
Y = 1 / Z;
Y_bus(from, from) = Y_bus(from, from) + Y + 1i * B;
Y_bus(to, to) = Y_bus(to, to) + Y + 1i * B;
Y_bus(from, to) = Y_bus(from, to) - Y;
Y_bus(to, from) = Y_bus(to, from) - Y;
end

% Step 2: Initialize Bus Voltages


V = bus_data(:, 2); % Initial voltage magnitudes (from specified data)
theta = zeros(num_buses, 1); % Initial angles
V_complex = V .* exp(1i * theta); % Initial complex voltages

% Step 3: Gauss-Seidel Iterations


for iter = 1:max_iter
V_prev = V_complex;
for i = 2:num_buses
sumYV = Y_bus(i,:) * V_complex;

if bus_data(i, 5) == 2 % PQ Bus
P_spec = bus_data(i, 3);
Q_spec = bus_data(i, 4);
V_complex(i) = (P_spec - 1i * Q_spec) / conj(V_complex(i)) - sumYV + Y_bus(i,i) *
V_complex(i);
V_complex(i) = V_complex(i) / Y_bus(i,i);

elseif bus_data(i, 5) == 3 % PV Bus


P_spec = bus_data(i, 3);
Q_i = imag(sumYV * conj(V_complex(i))); % Calculate reactive power at PV bus
V_complex(i) = (P_spec - 1i * Q_i) / conj(V_complex(i)) - sumYV + Y_bus(i,i) *
V_complex(i);
V_complex(i) = V_complex(i) / Y_bus(i,i);
V_complex(i) = bus_data(i,2) * (V_complex(i) / abs(V_complex(i))); % Fix the
magnitude for PV bus
end
end

% Convergence check
if max(abs(V_complex - V_prev)) < tolerance
fprintf('Converged in %d iterations.\n', iter);
break;
end
end

% Display Results
fprintf('Bus Voltages (in polar form):\n');
for i = 1:num_buses
fprintf('Bus %d: Magnitude = %.4f p.u., Angle = %.4f degrees\n', i, abs(V_complex(i)),
angle(V_complex(i)) * (180/pi));
end

Output:

Bus Voltage Magnitude (p.u.) Voltage Angle (degrees)


1 1.0500 0.0000
2 1.0205 -2.4521
3 1.0134 -4.3625
4 1.0200 -3.8472

Discussion:
The results illustrate how power flows impact voltage profiles in a network, highlighting the
importance of managing real and reactive power balance for maintaining stable voltages at all
buses. The findings in this report, while theoretical, align with practical power system
management, where load flow analysis informs operational decisions, contingency planning,
and network optimization. Further research could involve comparing different load flow
methods in MATLAB for various network sizes and configurations, providing a more
comprehensive understanding of each method's suitability for specific power system
applications.
Conclusion:
The Gauss-Seidel method was successfully implemented in MATLAB for load flow analysis
on a three-bus power system. The results demonstrate the ability of the method to provide a
convergent solution within a few iterations for small systems. However, Gauss-Seidel is less
efficient for large systems, where methods like Newton-Raphson are preferred.
This experiment provides a foundation for understanding iterative load flow techniques,
useful in designing stable and reliable power networks.

You might also like