Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Circuit analysis

In this appendix, we will explain how to analyze general electrical circuits consisting of passive elements (resistors, capacitors, inductors) and independent sources (voltage and current sources). The methods we describe here are systematic approaches that can be applied to any circuit, regardless of its complexity. We will write out equations in matrix form, which is convenient for computer implementation and analysis. We also assume everything is in the Laplace domain, so all variables are functions of ss.

The two prevalent approaches are nodal analysis and loop/mesh analysis. These are dual approaches, meaning that they are based on the same principles but focus on different variables. There is also a nice symmetry between them, which will become apparent through the form of the equations. Nodal analysis focuses on node voltages, while loop analysis focuses on loop currents.

Nodal analysis

We will assume the circuit contains nn nodes and bb branches. There are three different types of variables that show up in nodal analysis:

  1. Node voltages. The electric potential at each node in the circuit. Since voltage is a relative quantity, we choose one node to be the reference node (ground) and measure all other node voltages relative to this point. So there are n1n-1 unknown node voltages. We call the node voltages VnV_n.

  2. Branch voltages. The voltage drop across each branch (circuit element). We call the branch voltages across passive elements VV, across voltage sources VvV_v (which are known), and across current sources ViV_i. There is a total of bb branch voltages.

  3. Branch currents. The current flowing through each branch (circuit element). We call the branch currents through passive elements II, through voltage sources IvI_v, and through current sources IiI_i (which are known). There is a total of bb branch currents.

We use three types of equations to relate these variables to each other.

  1. Constitutive equations. These relate branch voltages to branch currents for each passive circuit element. Written in terms of a diagonal admittance matrix YY (the inverse of the impedance matrix ZZ), we have

    I=YVI = Y V
  2. Node-to-branch relationships. These relate node voltages to branch voltages. Each branch voltage can be expressed as the difference between the node voltages at its two terminals. Written in matrix form using the incidence matrices AA, AvA_v, and AiA_i (which describe how branches connect to nodes), we have

    V=ATVn,Vv=AvTVn,Vi=AiTVnV = A^\tp V_n,\quad V_v = A_v^\tp V_n, \quad V_i = A_i^\tp V_n
  3. Kirchhoff’s Current Law (KCL). This states that the algebraic sum of currents exiting each node is zero. This is a statement of conservation of electric charge, and is a relationship between branch currents. Written in matrix form using the same incidence matrices AA, AvA_v, and AiA_i, we have

    AI+AvIv+AiIi=0A I + A_v I_v + A_i I_i = 0

Our unknowns are VnV_n, ViV_i, VV, II, IvI_v. We know IiI_i and VvV_v since these are imposed by the independent sources.

We begin with KCL (3), and substitute in the constitutive equations (1) and node-to-branch relationships (2) to eliminate II and VV:

AYATVn+AvIv+AiIi=0A Y A^\tp V_n + A_v I_v + A_i I_i = 0

We also have the node-to-branch relationship for voltage sources:

AvTVn=VvA_v^\tp V_n = V_v

Putting these two equations together, we have a system of equations in matrix form:

[AYATAvAvT0][VnIv]=[AiIiVv]\boxed{\bmat{A Y A^\tp & A_v \\ A_v^\tp & 0} \bmat{V_n \\ I_v} = \bmat{-A_i I_i \\ V_v}}

We solve this system of equations for VnV_n and IvI_v. Note that the right-hand side contains IiI_i and VvV_v, which are the known current source currents and voltage source voltages. Once we have VnV_n and IvI_v, we can back-substitute to find the remaining variables:

V=ATVn,Vi=AiTVn,I=YV\boxed{ V = A^\tp V_n, \quad V_i = A_i^\tp V_n, \quad I = Y V }

The system of equations (8) is the main result of nodal analysis. It’s a set of linear equations that can be solved using standard techniques (e.g., matrix inversion, LU decomposition, etc.) to find the unknown node voltages and voltage source currents. The matrix is square, and has dimension (n1+bv)×(n1+bv)(n-1 + b_v) \times (n-1 + b_v), where bvb_v is the number of voltage sources in the circuit.

For a well-posed circuit this matrix is invertible and there is a unique solution. Otherwise, the circuit is ill-defined (e.g., contains contradictory sources).

Loop analysis

In nodal analysis, we focused on node voltages as the primary unknowns. In loop analysis, we focus on loop currents as the primary unknowns. Loop currents are currents that circulate around loops of the circuit. There are many possible loops we can draw, but in general, we only need to consider a subset of them to fully describe the circuit. For a connected circuit with nn nodes and bb branches, the number of independent loops is

m=bn+1m = b - n + 1

We can use any set of mm independent loops for this analysis. Here, independent is meant in the linear algebra sense: no loop in the set can be expressed as a linear combination of the other loops. There are many possible choices of independent loops, but the two most common choices are “meshes” and “fundamental loops”.

There are three different types of variables that show up in loop analysis:

  1. Loop currents. The current circulating around each loop. We call the loop currents ImI_m. There are a total of mm loop currents.

  2. Branch voltages. The voltage drop across each branch (circuit element). We call the branch voltages across passive elements VV, across voltage sources VvV_v (which are known), and across current sources ViV_i. There is a total of bb branch voltages.

  3. Branch currents. The current flowing through each branch (circuit element). We call the branch currents through passive elements II, through voltage sources IvI_v, and through current sources IiI_i (which are known). There is a total of bb branch currents.

We use three types of equations to relate these variables to each other.

  1. Constitutive equations. These relate branch voltages to branch currents for each passive circuit element. Written in terms of a diagonal impedance matrix ZZ, we have

    V=ZIV = Z I
  2. Mesh-to-branch relationships. These relate mesh currents to branch currents. Each branch current can be expressed as the sum of the mesh currents that pass through that branch. Written in matrix form using the loop incidence matrices BB, BvB_v, and BiB_i (which describe how branches connect to loops), we have

    I=BTIm,Iv=BvTIm,Ii=BiTImI = B^\tp I_m,\quad I_v = B_v^\tp I_m, \quad I_i = B_i^\tp I_m
  3. Kirchhoff’s Voltage Law (KVL). This states that the algebraic sum of voltages around any closed loop in a circuit is zero. This is a statement of conservation of energy, and is a relationship between branch voltages. Written in matrix form using the same loop incidence matrices BB, BvB_v, and BiB_i, we have

    BV+BvVv+BiVi=0B V + B_v V_v + B_i V_i = 0

Our unknowns are ImI_m, ViV_i, VV, II, IvI_v. We know IiI_i and VvV_v since these are imposed by the independent sources.

We begin with KVL (15), and substitute in the constitutive equations (13) and mesh-to-branch relationships (14) to eliminate II and VV:

BZBTIm+BvVv+BiVi=0B Z B^\tp I_m + B_v V_v + B_i V_i = 0

We also have the mesh-to-branch relationship for current sources:

BiTIm=IiB_i^\tp I_m = I_i

Putting these two equations together, we have a system of equations in matrix form:

[BZBTBiBiT0][ImVi]=[BvVvIi]\boxed{\bmat{B Z B^\tp & B_i \\ B_i^\tp & 0} \bmat{I_m \\ V_i} = \bmat{-B_v V_v \\ I_i}}

We solve this system of equations for ImI_m and ViV_i. Note that the right-hand side contains IiI_i and VvV_v, which are the known current source currents and voltage source voltages. Once we have ImI_m and ViV_i, we can back-substitute to find the remaining variables:

I=BTIm,Iv=BvTIm,V=ZI\boxed{ I = B^\tp I_m, \quad I_v = B_v^\tp I_m, \quad V = Z I }

The system of equations (20) is the main result of loop analysis. It’s a set of linear equations that can be solved using standard techniques (e.g., matrix inversion, LU decomposition, etc.) to find the unknown loop currents and current source voltages. The matrix is square, and has dimension (m+bi)×(m+bi)(m + b_i) \times (m + b_i), where bib_i is the number of current sources in the circuit.

For a well-posed circuit this matrix is invertible and there is a unique solution. Otherwise, the circuit is ill-defined (e.g., contains contradictory sources).

Discussion

Duality

It’s clear from the above that nodal analysis and loop analysis are dual approaches. They are based on the same principles (KCL, KVL, constitutive equations, and incidence relationships), but they focus on different primary variables (node voltages vs. loop currents). The structure of the equations is very similar, with the main difference being the use of admittance matrices in nodal analysis and impedance matrices in loop analysis.

There is also a nice relationship between the incidence matrices used in each approach, which reflects the duality of the two methods.

Which method is better?

From a computational standpoint, both methods are equally valid and lead to the same results. The choice between nodal and loop analysis often depends on the specific circuit being analyzed and personal preference. In terms of computational complexity, both methods typically result in solving a system of linear equations of similar size, so there is no significant difference in efficiency. However,

So, depending on the circuit topology and the number of sources of each type, one method may lead to a smaller system of equations than the other.

Example

We will now solve a circuit using both nodal and loop analysis to illustrate the methods. As you will see, both methods are systematic and lead to the same final results, although might be error-prone for hand calculations on complex circuits.

Circuit with labeled nodes, meshes, and branches.

Figure 1:Circuit with labeled nodes, meshes, and branches.

In the circuit above, we labeled nodes A,B,C,DA,B,C,D and meshes a,b,ca,b,c. We also have passive elements with impedances ZkZ_k (or admittance Yk=1/ZkY_k = 1/Z_k) for k=1,,5k=1,\dots,5, one voltage source with voltage VvV_v (current IvI_v), and one current source with current IiI_i (voltage ViV_i). It is important in this method that branch voltages and currents be consistently defined; the current arrows always flow from ++ to - for voltages, so that a positive branch current flowing through a resistor would have a positive branch voltage.

Nodal analysis

Here are the node-to-branch incidence matrices for the circuit:

[VVvVi]=[V1V2V3V4V5VvVi]=[1010110001100010000110000101][VAVBVCVD]=[ATAvTAiT]Vn\bmat{V \\ V_v \\ V_i} = \bmat{V_1 \\ V_2 \\ V_3 \\ V_4 \\ V_5 \\\hline V_v \\\hline V_i} = \bmat{ 1 & 0 & -1 & 0 \\ 1 & -1 & 0 & 0 \\ 0 & -1 & 1 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \\ \hline 1 & 0 & 0 & 0 \\ \hline 0 & -1 & 0 & 1} \bmat{ V_A \\ V_B \\ V_C \\ V_D } = \bmat{A^\tp \\ A_v^\tp \\ A_i^\tp} V_n

The horizontal lines partition the matrices according to passive elements, voltage sources, and current sources. We also have constitutive equations for the passive elements:

I=[I1I2I3I4I5]=[Y100000Y200000Y300000Y400000Y5][V1V2V3V4V5]=YVI = \bmat{I_1 \\ I_2 \\ I_3 \\ I_4\\ I_5} = \bmat{Y_1 & 0 & 0 & 0 & 0 \\ 0 & Y_2 & 0 & 0 & 0 \\ 0 & 0 & Y_3 & 0 & 0 \\ 0 & 0 & 0 & Y_4 & 0 \\ 0 & 0 & 0 & 0 & Y_5} \bmat{V_1 \\ V_2 \\ V_3 \\ V_4 \\ V_5} = Y V

Where admittances are inverses of impedances: Yk=1/ZkY_k = 1/Z_k. Now we can form the main system of equations (8):

[AYATAvAvT0][VnIv]=[AiIiVv][Y1+Y2Y2Y101Y2Y2+Y3Y300Y1Y3Y1+Y3+Y400000Y5010000][VAVBVCVDIv]=[0Ii0IiVv]\begin{gathered} \bmat{A Y A^\tp & A_v \\ A_v^\tp & 0}\bmat{V_n \\ I_v} = \bmat{-A_i I_i \\ V_v}\\ \bmat{Y_1+Y_2 & -Y_2 & -Y_1 & 0 & 1 \\ -Y_2 & Y_2+Y_3 & -Y_3 & 0 & 0 \\ -Y_1 & -Y_3 & Y_1+Y_3+Y_4 & 0 & 0 \\ 0 & 0 & 0 & Y_5 & 0 \\ 1 & 0 & 0 & 0 & 0 } \bmat{V_A \\ V_B \\ V_C \\ V_D \\ I_v} = \bmat{ 0 \\ I_i \\ 0 \\ -I_i \\ V_v} \end{gathered}

Solving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\bmat{ I_{a} \\ I_{b} \\ I_{c} } = \bmat{B^\tp \\ B_v^\tp \\ B_i^\tp} I_m

We can verify consistency of the incidence matrices by checking that AallBallT=0A_\textsf{all} B_\textsf{all}^\tp = 0 as explained in the section on duality.

AallBallT=[1010110001100010000110000101]T[110010011101001100001]=[000000000000]A_\textsf{all} B_\textsf{all}^\tp = \bmat{ 1 & 0 & -1 & 0 \\ 1 & -1 & 0 & 0 \\ 0 & -1 & 1 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \\ 1 & 0 & 0 & 0 \\ 0 & -1 & 0 & 1}^\tp \bmat{ 1 & -1 & 0 \\ 0 & 1 & 0 \\ 0 & -1 & 1 \\ 1 & 0 & -1\\ 0 & 0 & -1\\ -1 & 0 & 0 \\ 0 & 0 & -1} =\bmat{0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0}

We also have constitutive equations for the passive elements:

V=[V1V2V3V4V5]=[Z100000Z200000Z300000Z400000Z5][I1I2I3I4I5]=ZIV = \bmat{V_1 \\ V_2 \\ V_3 \\ V_4\\ V_5} = \bmat{Z_1 & 0 & 0 & 0 & 0 \\ 0 & Z_2 & 0 & 0 & 0 \\ 0 & 0 & Z_3 & 0 & 0 \\ 0 & 0 & 0 & Z_4 & 0 \\ 0 & 0 & 0 & 0 & Z_5} \bmat{I_1 \\ I_2 \\ I_3 \\ I_4 \\ I_5} = Z I

Where impedances are inverses of admittances used in nodal analysis: Zk=1/YkZ_k = 1/Y_k. Now we can form the main system of equations (20):

[BZBTBiBiT0][ImVi]=[BvVvIi][Z1+Z4Z1Z40Z1Z1+Z2+Z3Z30Z4Z3Z3+Z4+Z510010][IaIbIcVi]=[Vv00Ii]\begin{gathered} \bmat{B Z B^\tp & B_i \\ B_i^\tp & 0}\bmat{I_m \\ V_i} = \bmat{-B_v V_v \\ I_i}\\ \bmat{ Z_1+Z_4 & -Z_1 & -Z_4 & 0 \\ -Z_1 & Z_1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Z_1 Z_3+Z_1 Z_4+Z_3 Z_4} } \end{gathered}

Finally, we can find the branch voltages by applying V=ZIV = Z I.

[V1V2V3V4V5]=[Z1(Z2+Z3)VvZ1Z2Z4IiZ1Z2+Z4Z2+Z1Z3+Z1Z4+Z3Z4Z1Z2VvZ2(Z1Z3+Z4Z3+Z1Z4)IiZ1Z2+Z4Z2+Z1Z3+Z1Z4+Z3Z4Z1Z3VvZ2Z3(Z1+Z4)IiZ1Z2+Z4Z2+Z1Z3+Z1Z4+Z3Z4Z4(Z1+Z2+Z3)Vv+Z1Z2Z4IiZ1Z2+Z4Z2+Z1Z3+Z1Z4+Z3Z4Z5Ii]\bmat{V_1 \\[2mm] V_2 \\[2mm] V_3 \\[2mm] V_4 \\[2mm] V_5} = \bmat{ \frac{Z_1\left(Z_2+Z_3\right) V_v- Z_1 Z_2 Z_4\,I_i}{Z_1 Z_2+Z_4 Z_2+Z_1 Z_3+Z_1 Z_4+Z_3 Z_4} \\[1mm] \frac{Z_1 Z_2 V_v-Z_2\left(Z_1 Z_3+Z_4 Z_3+Z_1 Z_4\right)I_i}{Z_1 Z_2+Z_4 Z_2+Z_1 Z_3+Z_1 Z_4+Z_3 Z_4} \\[1mm] \frac{-Z_1 Z_3\, V_v-Z_2 Z_3\left(Z_1+Z_4\right)I_i}{Z_1 Z_2+Z_4 Z_2+Z_1 Z_3+Z_1 Z_4+Z_3 Z_4} \\[1mm] \frac{Z_4\left(Z_1+Z_2+Z_3\right) V_v+Z_1 Z_2 Z_4 I_i}{Z_1 Z_2+Z_4 Z_2+Z_1 Z_3+Z_1 Z_4+Z_3 Z_4} \\[1mm] Z_5 I_i }

And that’s it! Equations (36), (37), (38) give the complete solution using loop analysis.

Let’s pick a variable at random and verify that both methods give the same answer. For example, let’s check branch voltage V4V_4. We can start with the result from nodal analysis in Eq. (30), and substitute Zk=1/YkZ_k = 1/Y_k:

V4=(Y1Y2+Y3Y2+Y1Y3)Vv+Y3IiY1Y2+Y3Y2+Y4Y2+Y1Y3+Y3Y4=(1Z11Z2+1Z31Z2+1Z11Z3)Vv+1Z3Ii1Z11Z2+1Z31Z2+1Z41Z2+1Z11Z3+1Z31Z4=Z4(Z1+Z2+Z3)Vv+Z1Z2Z4IiZ1Z2+Z4Z2+Z1Z3+Z1Z4+Z3Z4\begin{aligned} V_4 &= \frac{\left(Y_1 Y_2+Y_3 Y_2+Y_1 Y_3\right) V_v+ Y_3\, I_i}{Y_1 Y_2+Y_3 Y_2+Y_4 Y_2+Y_1 Y_3+Y_3 Y_4} \\ &= \frac{\left(\frac{1}{Z_1}\frac{1}{Z_2}+\frac{1}{Z_3}\frac{1}{Z_2}+\frac{1}{Z_1}\frac{1}{Z_3}\right) V_v+ \frac{1}{Z_3}\, I_i}{\frac{1}{Z_1}\frac{1}{Z_2}+\frac{1}{Z_3}\frac{1}{Z_2}+\frac{1}{Z_4}\frac{1}{Z_2}+\frac{1}{Z_1}\frac{1}{Z_3}+\frac{1}{Z_3}\frac{1}{Z_4}} \\ &=\frac{Z_4\left(Z_1+Z_2+Z_3\right) V_v+Z_1 Z_2 Z_4 I_i}{Z_1 Z_2+Z_4 Z_2+Z_1 Z_3+Z_1 Z_4+Z_3 Z_4} \end{aligned}

Where in the last step we multiplied numerator and denominator by Z1Z2Z3Z4Z_1 Z_2 Z_3 Z_4. This matches exactly the expression for V4V_4 obtained from loop analysis in (38), confirming that both methods yield the same result.

Alternative approach

We can also solve the circuit of Fig. Figure 1 using the alternative approach we described in the main text, which is a variant of the nodal method. This approach is more amenable to hand calculations, since it avoids the use of matrix algebra and is opportunistic: you only solve for what you need!

We start by writing constitutive equations for each passive branch and each voltage/current source directly in terms of node voltages and branch currents:

VAVC=Z1I1(branch 1)VAVB=Z2I2(branch 2)VCVB=Z3I3(branch 3)VC=Z4I4(branch 4)VD=Z5I5(branch 5)VA=Vv(voltage source)I5=Ii(current source)\begin{aligned} V_A - V_C &= Z_1 I_1 && \textsf{(branch 1)}\\ V_A - V_B &= Z_2 I_2 && \textsf{(branch 2)}\\ V_C - V_B &= Z_3 I_3 && \textsf{(branch 3)}\\ V_C &= Z_4 I_4 && \textsf{(branch 4)}\\ -V_D &= Z_5 I_5 && \textsf{(branch 5)}\\ V_A &= V_v && \textsf{(voltage source)}\\ I_5 &= I_i && \textsf{(current source)} \end{aligned}

Next, we write KCL at each junction node (excluding the reference node):

Iv+I1+I2=0(junction A)I2+I3+Ii=0(junction B)I1I3I4=0(junction C)\begin{aligned} I_v + I_1 + I_2 &= 0 \quad &\textsf{(junction A)}\\ I_2 + I_3 + I_i &= 0 \quad &\textsf{(junction B)}\\ I_1 - I_3 - I_4 &= 0 \quad &\textsf{(junction C)} \end{aligned}

We can now take stock of our equations and variables. We have a total of 10 equations and 10 variables: VA,VB,VC,VD,I1,I2,I3,I4,I5,IvV_A, V_B, V_C, V_D, I_1, I_2, I_3, I_4, I_5, I_v. So we have a well-defined system that we can solve.

From here, we proceed differently depending on which variables we want to solve for.

In general, we can proceed systematically by eliminating each variable we don’t care about. This means (1) picking any equation that contains the variable, (2) rearranging it to solve for the variable, and (3) substituting the result into every other equation.

For example, if we didn’t care about I3I_3, we could eliminate it by picking an equation that contains I3I_3, say the KCL at junction CC in (41). Rearranging gives: I3=I1I4I_3 = I_1 - I_4. Plugging this into every other equation that contains I3I_3, our system of equations becomes:

VAVC=Z1I1VAVB=Z2I2VCVB=Z3(I1I4)VC=Z4I4VD=Z5I5VA=VvI5=IiIv+I1+I2=0I2+I1I4+Ii=0\begin{aligned} V_A - V_C &= Z_1 I_1 \\ V_A - V_B &= Z_2 I_2 \\ V_C - V_B &= Z_3 (I_1 - I_4) \\ V_C &= Z_4 I_4 \\ -V_D &= Z_5 I_5 \\ V_A &= V_v \\ I_5 &= I_i \\ I_v + I_1 + I_2 &= 0 \\ I_2 + I_1 - I_4 + I_i &= 0 \\ \end{aligned}

We now have 9 equations and 9 variables: VA,VB,VC,VD,I1,I2,I4,I5,IvV_A, V_B, V_C, V_D, I_1, I_2, I_4, I_5, I_v. We can continue eliminating variables we don’t care about until we reach a system that only contains the variables of interest.

This approach can be efficient for hand calculations because we can pick the simplest equations when eliminating variables (to minimize algebra), and we only keep track of the variables we care about. However, it can also be error-prone if not done carefully, especially for complex circuits with many variables and equations.