Formation of Bus Admittance(Y bus) matrix.

Experiment No.: – 09

Formation of Bus Admittance (Y bus) matrix.

  1. MATLAB installed in computer system.
fig. 9.1
Bus Code
i-k
Impedance
Zik
Line Charging
y ik/2
1-20.02+j0.06j0.03
1-30.08+j0.24j0.025
2-30.06+j0.18j0.020
Per unit impedances and line charging for 3 bus system

Reference for this problem is : Electrical power system by D. Das.

In order to obtain the node-voltage equations, consider the simple power system shown in Figure 9.1 where impedances are expressed in per unit on a common MVA base. Since the nodal solution is based upon Kirchhoff’s current law, impedances are converted to admittance, i.e.,

\[\color\red{y_{ij}\;=\;\dfrac{1}{z_{ij}}\color\red{\;=\;\dfrac{1}{r_{ij}+jx_{ij}}}}\]

The circuit has been redrawn in Figure 9.2 in terms of admittances and transformation to current sources. Node 0 (which is normally ground) is taken as reference. Applying KCL to the independent nodes 1 through 4 results in

\[\color\red{I_1 = y_{10}V_1 + y_{12}(V_1 – V_2) + y_{13}(V_1 – V_3)}\] \[\color\red{I_2 = y_{20}V_2 + y_{21}(V_2 – V_1) + y_{23}(V_2 – V_3)}\] \[\color\red{I_3= y_{30}V_3+Y_{31}(V_3 – V_1) + y_{32}(V_3 – V_2)}\]
\[\color\magenta{ I_1 = (y_{10} + y_{12} + y_{13})V_1 – y_{12}V_2 – y_{13}V_3}\] \[\color\magenta{I_2 = -y_{21}V_1 + (y_{20} + y_{12} + y_{23})V_2 – y_{23}V_3}\] \[\color\magenta{I_3 = -y_{31}V_1 – y_{32}V_2 + (y_{30} + y_{13} + y_{32})V_3 }\] \[\color\green{here,}\] \[\color\red{y_{10}\;=\; \dfrac{y’_{13}}{2}\;+\;\dfrac{y’_{12}}{2}}\] \[\color\red{y_{20}\;=\; \dfrac{y’_{12}}{2}\;+\;\dfrac{y’_{23}}{2}}\] \[\color\red{y_{30}\;=\; \dfrac{y’_{13}}{2}\;+\;\dfrac{y’_{23}}{2}}\] \[\color\green{and,}\] \[\color\red{y_{12}\;=\; \dfrac{1}{Z_{12}}}\] \[\color\red{y_{13}\;=\; \dfrac{1}{Z_{13}}}\] \[\color\red{y_{23}\;=\; \dfrac{1}{Z_{23}}}\]
\[\color\red{Y_{11} = y_{10} + y_{12} + y_{13}}\] \[\color\red{Y_{22} = y_{20} + y_{12} + y_{23}}\] \[\color\red{Y_{33} = y_{30} + y_{13} + y_{23}}\] \[\color\red{Y_{12} = Y_{21} = -y_{12}}\] \[\color\red{Y_{13} = Y_{31} = -y_{13}}\] \[\color\red{Y_{23} = Y_{32} = -y_{23}}\]
\[\color\magenta{I_1 = Y_{11}V_1 + Y_{12}V_2 + Y_{13}V_3}\] \[\color\magenta{I_2 = Y_{21}V_1 + Y_{22}V_2 + Y_{23}V_3}\] \[\color\magenta{I_3 = Y_{31}V_1 + Y_{32}V_2 + Y_{33}V_3}\]

Extending the above relation to an n bus system, the node-voltage equation in matrix form is

\[\color\red{ \begin{bmatrix} I_1\\ I_2\\ \vdots\\ I_i\\ \vdots\\ I_n\\ \end{bmatrix} = \begin{bmatrix} Y_{11} & Y_{12} & \dots & Y_{1i} & \dots & Y_{1n}\\ Y_{21} & Y_{22} & \dots & Y_{2i} & \dots & Y_{2n}\\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ Y_{i1} & Y_{i2} & \dots & Y_{ii} & \dots & Y_{in}\\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ Y_{n1} & Y_{n2} & \dots & Y_{ni} & \dots & Y_{nn}\\ \end{bmatrix} \begin{bmatrix} V_1\\ V_2\\ \vdots\\ V_i\\ \vdots\\ V_n\\ \end{bmatrix} }\]
\[\color\green{or}\;\color\red{ I_{bus} \;= \;Y_{bus} V_{bus}} …..\color\magenta{(9.1)}\]
\[\color\red{ Y_{ii} = \sum_{j=0}^{n} y_{ij}\;\;}\;\;\;\color\green{j\not=i }\]

The off-diagonal element is equal to the negative of the admittance between the nodes. It is known as the mutual admittance or transfer admittance, i.e.,

\[\color\red{Y_{ij}\; = \;Y_{ji}\; = \;-y_{ij}}\]

When the bus currents are known, (9.1) can be solved for the n bus voltages.

\[\color\red{V_{bus}\; = \;Y_{bus}^{-1} I_{bus}}\]

The inverse of the bus admittance matrix is known as the bus impedance matrix Zbus. The admittance matrix obtained with one of the buses as reference is nonsingular. Otherwise the nodal matrix is singular.

Inspection of the bus admittance matrix reveals that the matrix is symmetric along the leading diagonal, and we need to store the upper triangular nodal admittance matrix only. In a typical power system network, each bus is connected to only a few nearby buses. Consequently, many off-diagonal elements are zero. Such a matrix is called sparse, and efficient numerical techniques can be applied to compute its inverse. By means of an appropriately ordered triangular decomposition, the inverse of a sparse matrix can be expressed as a product of sparse matrix factors, thereby giving an advantage in computational speed, storage and reduction of round-off errors. Based on above equations, the bus admittance matrix for the network in Figure 9.1 obtained by inspection is

\[\color\red{Y_{bus}\; = \begin{bmatrix} (6.255 -j18.704) & (-5 +j15) & (-1.25 +j 3.75)\\ (-5 +j15) & (6.672 -j19.960) & (-1.667 + j5)\\ (-1.25 + j3.7) & (-1.667 + j5) & (2.918 -j 8.709)\\ \end{bmatrix}} \]

Algorithms for Ybus in MATLAB.

  1. A function called Y = ybus(Id) is written for the formation of the bus admittance matrix.
  2. Id is the line data input and contains four columns.
  3. The first two columns are the line bus numbers and the remaining columns contain the line resistance and reactance in per unit.
  4. In the program, the line impedances are first converted to admittances.
  5. Y is then initialized to zero.
  6. In the first loop, the line data is searched, and the off-diagonal elements are entered. Finally, in a nested loop, line data is searched to find the elements connected to a bus, and the diagonal elements are thus formed.

Make two editor file

  1. Input data for Y bus. (named file is Id)
  2. Y bus Program. (named file is yb)

Input Data for Y bus: –

\[\color\red{function\; linedata \;=\; ld}\] \[\color\green{\% \;fb\; tb\; r\; x\; b}\] \[\color\red{linedata\;= \;[fb\; tb\; r \;x \;b]}\] \[\color\green{\%\;here\;fb\;=\;From\;bus}\] \[\color\green{\%t\;b\;=\;To\;bus}\] \[\color\green{\%\;r\;=\;resistance\;of\;transmission\;line}\] \[\color\green{\%\;x\;=\;reactance\;of\;transmission\;line}\] \[\color\green{\%\;b\;=\;dhunt\;charging\;of\;transmission\;line}\] \[\color\red{linedata\;= \;[1 \;\;2 \;\;0.02 \;\;0.06\;\; 0.03;}\] \[\color\red{\;1 \;\;3 \;\;0.08\;\; 0.24 \;\;0.025;}\] \[\color\red{\;2\;\; 3\;\; 0.06\;\; 0.18\;\; 0.020;}\] \[\color\green{\%\;Program \;to\; form \;Admittance\;Bus \;Formation}\] \[\color\red{function \;ybus\; = \;yb();}\] \[\color\Green{\;% \;Returns\; ybus}\] \[\color\red{linedata\; = \;ld();}\] \[\color\Green{\% \;Calling \;”Id.m”\; for\; Line \;Data.}\] \[\color\red{fb\; = \;linedata(:,1);}\] \[\color\Green{\% \;From \;bus\; number.}\] \[\color\red{tb\; = \;linedata(:,2);}\] \[\color\Green{\% \;To\; bus\; number.}\] \[\color\red{r \;= \;linedata(:,3);}\] \[\color\Green{\% \;Resistance, \;R.}\] \[\color\red{x \;= \;linedata(:,4);}\] \[\color\Green{\% \;Reactance,\; X.}\] \[\color\red{b\; =\; linedata(:,5);}\] \[\color\Green{\% \;Ground\; Admittance,\; B/2.}\] \[\color\red{z \;= \;r \;+ \;1i * x;}\] \[\color\Green{\% \;Z \;matrix.}\] \[\color\red{y\; = \;1 ./ z;}\] \[\color\Green{\% \;To\; get\; inverse \;of \;each\; element.}\] \[\color\red{b\; =\; 1i * b;}\] \[\color\Green{\% \;Make\; B\; imaginary.}\] \[\color\red{n\; =\; max(max(fb),\; max(tb));}\] \[\color\Green{ \% \;no.\; of\; buses.}\] \[\color\red{nb \;= \;length(fb);}\] \[\color\Green{\% \;no.\; of \;branches.}\] \[\color\red{ybus \;= \;zeros(n,n);}\] \[\color\Green{ \% \;Initialize \;YBus\;to\;zeros}\] \[\color\red{for\; k\; = \;1:nb}\] \[\color\Green{\ %\; Formation \;of\; the\; Off\; Diagonal\; Elements.}\] \[\color\red{ybus(fb(k),\; tb(k))\; = \;-y(k);}\] \[\color\red{ybus(tb(k),\; fb(k))\; = \;ybus(fb(k), \;tb(k));}\] \[\color\red{end}\] \[\color\Green{%\;end \;of\;the\;loop}\] \[\color\red{for \;u \;= \;1:n}\] \[\color\Green{\% \;Formation \;of\; Diagonal\; Elements.}\] \[\color\red{ for\; v\;=\;1:nb}\] \[\color\red{if\; fb(v)\; == \;u\;||\; tb(v)\;== \;u \;ybus(u,u) \;= \;ybus(u,u)\; +\; y(v)\; +\; b(v);}\] \[\color\red{end}\] \[\color\Green{\%\;end \;of\;the\;loop}\] \[\color\red{end}\] \[\color\Green{\%\;end \;of\;the\;loop}\] \[\color\red{end}\] \[\color\Green{\%\;end \;of\;the\;loop}\] \[\color\red{ybus}\] \[\color\green{ \% \;Bus \;Admittance\; Matrix}\]
\[\color\red{linedata = \begin{bmatrix} 1.0000 & 2.0000 & 0.0200 & 0.0600 & 0.0300 \\ 1.0000 & 3.0000 & 0.0800 & 0.2400 & 0.0250\\ 2.0000 & 3.0000 & 0.0600 & 0.1800 & 0.0200\\ \end{bmatrix}} \] \[\color\magenta{ybus\; = \begin{bmatrix} 6.2500 -18.6950i & -5.0000 +15.0000i & -1.2500 + 3.7500i\\ -5.0000 +15.0000i & 6.6667 -19.9500i & -1.6667 + 5.0000i\\ -1.2500 + 3.7500i & -1.6667 + 5.0000i & 2.9167 – 8.7050i\\ \end{bmatrix}} \]

To be written by student,