Y-bus matrix using MATLAB
Y-bus matrix using MATLAB
BEEE306P
Digital Assignment - 2
Simulation of Y-bus matrix
Navya Kukreja
22BEE0093
Aim
To calculate the elements yij of the admittance-bus matrix from the given bus
network.
Theory
The nodal admittance matrix is given by the equation (for a three-bus system):
I1 Y11 Y12 Y13 V1
I2 = Y21 Y22 Y23 · V2
I3 Y31 Y32 Y33 V3
The diagonal elements are dependent on the given bus system and calculated
accordingly
1
Theoretical calculations
Given the system,
1 2 0.15 0.6 0.02 1
1 3 0.10 0.4 0.02 1
1 4 0.15 0.6 0.025 1
2 3 0.05 0.2 0.01 1
3 4 0.05 0.2 0.01 1
We have,
y12 = Z112 = 1
0.15+j0.6 = 0.39 − j1.56
y13 = Z113 = 1
0.10+j0.4 = 0.58 − j2.32
y14 = Z114 = 1
0.15+j0.6 = 0.39 − j1.56
y23 = Z123 = 1
0.05+j0.2 = 1.76 − j4.7
Algorithm
1. User enters the line data matrix, which contains the start and end buses of
each transmission line, resistance (R), reactance (X), half-line charging suscep-
tance (Bc ), and transformation ratio (a).
2. The number of buses and transmission lines is determined. Using this in-
formation, an nbus × nbus zero matrix is initialized as Ybus , which will be populated
2
with admittance values representing the network’s electrical properties.
3. The off-diagonal elements of Ybus are updated by iterating through the trans-
mission lines. For each line, the mutual admittance between the connected buses
is calculated and added using the formula Ybus (nl , nr ) = −y/a. Symmetry is en-
sured by setting Ybus (nr , nl ) = Ybus (nl , nr ).
5. Once all elements are calculated, the fully populated bus admittance matrix
Ybus is displayed. This matrix is essential for power system analysis and represents
the admittance relationships between buses in the network.
3
MATLAB code
clc
clear all
% Ybus formation
j = sqrt ( -1) ;
i = sqrt ( -1) ;
nl = linedata (: ,1) ;
nr = linedata (: ,2) ;
R = linedata (: ,3) ;
X = linedata (: ,4) ;
Bc = j * linedata (: ,5) ;
a = linedata (: ,6) ;
nbr = length ( linedata (: ,1) ) ;
nbus = max ( max ( nl ) , max ( nr ) ) ;
Z = R + j*X;
y = ones ( nbr , 1) ./ Z ;
4
end
disp (" The Ybus matrix is : ") ;
disp ( Ybus ) ;
Results
Output from given input parameters are,
”The Ybus matrix is:
Columns 1 through 3
−0.3922 + 1.5686i
0.0000 + 0.0000i
0.0000 + 0.0000i
1.5686 − 6.2395i
Summary
We have successfully calculated the admittance matrix for the given bus system
and output is consistent with theoretical calculations.