Lab 6 Psa
Lab 6 Psa
LAB SESSION 06
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 the line flows.
Y13_real = input('Enter real part of admittance between Bus 1 and Bus 3: ');
Y13_imag = input('Enter imaginary part of admittance between Bus 1 and Bus 3:
');
Y13 = Y13_real + 1i * Y13_imag;
Y23_real = input('Enter real part of admittance between Bus 2 and Bus 3: ');
Y23_imag = input('Enter imaginary part of admittance between Bus 2 and Bus 3:
');
Y23 = Y23_real + 1i * Y23_imag;
% Given voltages
v1 = 1;
v2 = 1.05 + 1i * 0;
v3 = 1 + 1i * 0;
% Formulate the Y-bus matrix
Ybus = [Y12 + Y13, -Y12, -Y13; -Y12, Y12 + Y23, -Y23; -Y13, -Y23, Y13 + Y23];
% Convergence criterion
tolerance = 0.00001;
% ITERATIONS
for i = 1:1000 % Set a maximum limit for safety
V2_new = (1 / (Y23 + Y12)) * (((p2 - 1i*q2) / conj(V2)) - (-Y12*v1) - (-
Y23*v3));
V3_new = (1 / (Y13 + Y23)) * (((p3 - 1i*q3) / conj(V3)) - (-Y13*v1) - (-
Y23*v2));
% Check convergence
if abs(V2_new - V2) < tolerance && abs(V3_new - V3) < tolerance
disp(['Converged after ', num2str(i), ' iterations.']);
break;
end
This code solves the power flow problem using the Gauss-Seidel method, iteratively updating bus
voltages until convergence is achieved. It calculates the line flows, losses, and slack bus real and reactive
power after convergence. The code utilizes the per unit system and admittance representation of the
power system. Users input power values and system parameters, and the code iterates to find the bus
voltages .
Maximum
Line flows
Start voltage
and losses
changes
Slack bus
Convergence
Initialization power
check
calculatins