Kirchhoff’s current law states that for any electrical circuit, the algebraic sum of all the currents at any node in the circuit equals zero. | Attia John Okyere. DC Analysis. Electronics and Circuit Analysis using MATLAB. Ed. John Okyere Attia Boca Raton CRC Press LLC 1999 1999 by CRC PRESS LLC CHAPTER FOUR DC ANALYSIS NODAL ANALYSIS Kirchhoff s current law states that for any electrical circuit the algebraic sum of all the currents at any node in the circuit equals zero. In nodal analysis if there are n nodes in a circuit and we select a reference node the other nodes can be numbered from V through Vn-1. With one node selected as the reference node there will be n-1 independent equations. If we assume that the admittance between nodes i and j is given as Yi - we can write the nodal equations Y11 V1 Y12 V2 . Y1m Vm Z I1 y21 V1 y22 V2 . Y2m Vm Z I2 Ym1 V1 Ym2 V2 . Ymm Vm Z Im where m n - 1 Vj V2 and Vm are voltages from nodes 1 2 and so on . n with respect to the reference node. Z x is the algebraic sum of current sources at node x. Equation can be expressed in matrix form as Mr I The solution of the above equation is v r -1 I where 1999 CRC Press LLC Y 1 is an inverse of Y . In MATLAB we can compute V by using the command V inv Y I where inv Y is the inverse of matrix Y The matrix left and right divisions can also be used to obtain the nodal voltages. The following MATLAB commands can be used to find the matrix V v yY or V Y I The solutions obtained from Equations to will be the same provided the system is not ill-conditioned. The following two examples illustrate the use of MATLAB for solving nodal voltages of electrical circuits. Example For the circuit shown below find the nodal voltages V1 V2 and V3. Figure Circuit with Nodal Voltages 1999 CRC Press .