0% found this document useful (0 votes)
26 views5 pages

Lab 6 Psa

The document is a laboratory manual for a session on load flow analysis of a power system using the Gauss-Seidel method in MATLAB. It outlines the steps to develop a MATLAB program to calculate bus voltages, line flows, losses, and slack bus power, along with user inputs for line admittances and power values. The manual includes instructions for reporting results, a flowchart of the program, and descriptions of special features and outputs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views5 pages

Lab 6 Psa

The document is a laboratory manual for a session on load flow analysis of a power system using the Gauss-Seidel method in MATLAB. It outlines the steps to develop a MATLAB program to calculate bus voltages, line flows, losses, and slack bus power, along with user inputs for line admittances and power values. The manual includes instructions for reporting results, a flowchart of the program, and descriptions of special features and outputs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

EE451 POWER SYSTEM ANALYSIS & DESIGN LABORATORY MANUAL

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.

Your report should consist of:

1. Brief introductory comments on your solution.


2. A flowchart or other program description.
3. A description of any special features.
4. A description of the output.

Construct a power flow diagram and show the direction of the line flows.

% Take user input for line admittances


Y12_real = input('Enter real part of admittance between Bus 1 and Bus 2: ');
Y12_imag = input('Enter imaginary part of admittance between Bus 1 and Bus 2:
');
Y12 = Y12_real + 1i * Y12_imag;

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];

% Display the Y-bus matrix


disp('Y-bus matrix:');
disp(Ybus);

% Input power values in MW


a1 = input('Enter p2 in MW: ');
b1 = input('Enter q2 in MVAR: ');
a2 = input('Enter p3 in MW: ');
b2 = input('Enter q3 in MVAR: ');
pu = input('Enter the base value in MVA: ');

% Convert power to per unit (pu)


p2 = (-a1 / pu);
q2 = (-b1 / pu);
p3 = (-a2 / pu);
q3 = (-b2 / pu);

disp(['p2 = ', num2str(p2)]);


disp(['q2 = ', num2str(q2)]);
disp(['p3 = ', num2str(p3)]);
disp(['q3 = ', num2str(q3)]);

% Initialize arrays to store results


V2 = v2;
V3 = v3;

% 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

% Update for next iteration


V2 = V2_new;
V3 = V3_new;
end

% Display final results


disp(['V2: ', num2str(V2)]);
disp(['V3: ', num2str(V3)]);
disp(['V2_Phasor = ', num2str(abs(V2)), ' ', num2str(angle(V2)*180/pi), '
degrees']);
disp(['V3_Phasor = ', num2str(abs(V3)), ' ', num2str(angle(V3)*180/pi), '
degrees']);

% Calculate line flows and losses (if needed)


S12 = v1 * conj(Y12 * (v1 - V2));
S13 = v1 * conj(Y13 * (v1 - V3));
S21 = V2 * conj(Y12 * (V2 - v1));
S23 = V2 * conj(Y23 * (V2 - V3));
S31 = V3 * conj(Y13 * (V3 - v1));
S32 = V3 * conj(Y23 * (V3 - V2));
% Calculate line losses
Loss12 = S12 + S21;
Loss13 = S13 + S31;
Loss23 = S23 + S32;
% Calculate slack bus real and reactive power
P1 = real(S12 + S13) + real(Loss12 + Loss13);
Q1 = imag(S12 + S13) + imag(Loss12 + Loss13);
% Display the results
disp(['Line Flows: S12 = ' num2str(S12) ', S13 = ' num2str(S13) ', S21 = '
num2str(S21) ', S23 = ' num2str(S23) ', S31 = ' num2str(S31) ', S32 = '
num2str(S32)]);
disp(['Line Losses: Loss12 = ' num2str(Loss12) ', Loss13 = ' num2str(Loss13)
', Loss23 = ' num2str(Loss23)]);
disp(['Slack Bus Real and Reactive Power: P1 q= ' num2str(P1) ', Q1 = '
num2str(Q1)]);
%%
%%
Brief introductory comments on your solution

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 .

A flowchart or other program description.

Maximum
Line flows
Start voltage
and losses
changes

Slack bus
Convergence
Initialization power
check
calculatins

Y-bus matrix Gauss-Seidal Display


formation iterations results

Input Per unit


End
parameters conversion

A description of any special features.


One special feature used in this code is the Gauss-Seidel iterative method for solving power flow
equations. The Gauss-Seidel method is an iterative technique commonly employed in power system
analysis to solve for bus voltages in complex interconnected networks. It iteratively updates the
voltage magnitude and phase angle of each bus based on the calculated values of neighboring buses
until convergence is achieved.

A description of the output.


Y-bus matrix:
48.4379 -60.9428i -8.9579 +27.3714i -39.4800 +33.5715i
-8.9579 +27.3714i 16.6571 -43.7527i -7.6992 +16.3814i
-39.4800 +33.5715i -7.6992 +16.3814i 47.1793 -49.9528i
Enter p2 in MW:
400
Enter q2 in MVAR:
320
Enter p3 in MW:
300
Enter q3 in MVAR:
270
Enter the base value in MVA:
100
p2 = -4
q2 = -3.2
p3 = -3
q3 = -2.7
Converged after 8 iterations.
V2: 0.90202-0.060244i
V3: 0.94609-0.0074509i
V2_Phasor = 0.90403 -3.821 degrees
V3_Phasor = 0.94612 -0.45122 degrees
Line Flows: S12 = 3.1233+3.6863i, S13 = 4.57+3.3539i, S21 = -2.8946-2.9876i,
S23 = -1.1052-0.21208i, S31 = -4.1416-2.9895i, S32 = 1.1416+0.28956i
Line Losses: Loss12 = 0.22868+0.69874i, Loss13 = 0.42844+0.36432i, Loss23 =
0.036415+0.077479i
Slack Bus Real and Reactive Power: P1 q= 8.3504, Q1 = 8.1033
The provided code calculates the power flow in a three-bus power system using the Gauss-Seidel iterative
method. Initially, the admittance matrix (Y-bus matrix) of the system is constructed based on the given
line impedances. Then, the user inputs the power values for two of the buses and the base value. These
power values are converted to per unit values. The code iterates through the Gauss-Seidel method to solve
for the voltages at each bus. In each iteration, the voltage at each bus is updated based on the power
injections and the admittance matrix. Once convergence is achieved (i.e., when the change in voltage
between iterations falls below a specified tolerance), the final voltage magnitudes and angles are
displayed. Additionally, the line flows, line losses, and slack bus real and reactive power are calculated
and displayed. Overall, the code provides a comprehensive solution for analyzing power flow in a three-
bus system, utilizing the Gauss-Seidel method for iterative convergence

You might also like