Nodal analysis

Kirchhoff's current law is the basis of nodal analysis.

In electric circuits analysis, nodal analysis, node-voltage analysis, or the branch current method is a method of determining the voltage (potential difference) between "nodes" (points where elements or branches connect) in an electrical circuit in terms of the branch currents.

In analyzing a circuit using Kirchhoff's circuit laws, one can either do nodal analysis using Kirchhoff's current law (KCL) or mesh analysis using Kirchhoff's voltage law (KVL). Nodal analysis writes an equation at each electrical node, requiring that the branch currents incident at a node must sum to zero. The branch currents are written in terms of the circuit node voltages. As a consequence, each branch constitutive relation must give current as a function of voltage; an admittance representation. For instance, for a resistor, Ibranch = Vbranch * G, where G (=1/R) is the admittance (conductance) of the resistor.

Nodal analysis is possible when all the circuit elements' branch constitutive relations have an admittance representation. Nodal analysis produces a compact set of equations for the network, which can be solved by hand if small, or can be quickly solved using linear algebra by computer. Because of the compact system of equations, many circuit simulation programs (e.g. SPICE) use nodal analysis as a basis. When elements do not have admittance representations, a more general extension of nodal analysis, modified nodal analysis, can be used.

Method

1. Note all connected wire segments in the circuit. These are the nodes of nodal analysis.
2. Select one node as the ground reference. The choice does not affect the result and is just a matter of convention. Choosing the node with the most connections can simplify the analysis. For a circuit of N nodes the number of nodal equations is N−1.
3. Assign a variable for each node whose voltage is unknown. If the voltage is already known, it is not necessary to assign a variable.
4. For each unknown voltage, form an equation based on Kirchhoff's current law. Basically, add together all currents leaving from the node and mark the sum equal to zero. Finding the current between two nodes is nothing more than "the node with the higher potential, minus the node with the lower potential, divided by the resistance between the two nodes."
5. If there are voltage sources between two unknown voltages, join the two nodes as a supernode. The currents of the two nodes are combined in a single equation, and a new equation for the voltages is formed.
6. Solve the system of simultaneous equations for each unknown voltage.

Examples

Basic case1

Basic example circuit with one unknown voltage, V1.

The only unknown voltage in this circuit is V1. There are three connections to this node and consequently three currents to consider. The direction of the currents in calculations is chosen to be away from the node.

1. Current through resistor R1: (V1 - VS) / R1
2. Current through resistor R2: V1 / R2
3. Current through current source IS: -IS

With Kirchhoff's current law, we get:

${\displaystyle {\frac {V_{1}-V_{S}}{R_{1}}}+{\frac {V_{1}}{R_{2}}}-I_{S}=0}$

This equation can be solved with respect to V1:

${\displaystyle V_{1}={\frac {\left({\frac {V_{S}}{R1}}+I_{S}\right)}{\left({\frac {1}{R_{1}}}+{\frac {1}{R_{2}}}\right)}}}$

Finally, the unknown voltage can be solved by substituting numerical values for the symbols. Any unknown currents are easy to calculate after all the voltages in the circuit are known.

${\displaystyle V_{1}={\frac {\left({\frac {5{\text{ V}}}{100\,\Omega }}+20{\text{ mA}}\right)}{\left({\frac {1}{100\,\Omega }}+{\frac {1}{200\,\Omega }}\right)}}={\frac {14}{3}}{\text{ V}}}$

Supernodes

In this circuit, VA is between two unknown voltages, and is therefore a supernode.

In this circuit, we initially have two unknown voltages, V1 and V2. The voltage at V3 is already known to be VB because the other terminal of the voltage source is at ground potential.

The current going through voltage source VA cannot be directly calculated. Therefore, we cannot write the current equations for either V1 or V2. However, we know that the same current leaving node V2 must enter node V1. Even though the nodes cannot be individually solved, we know that the combined current of these two nodes is zero. This combining of the two nodes is called the supernode technique, and it requires one additional equation: V1 = V2 + VA.

The complete set of equations for this circuit is:

${\displaystyle {\begin{cases}{\frac {V_{1}-V_{\text{B}}}{R_{1}}}+{\frac {V_{2}-V_{\text{B}}}{R_{2}}}+{\frac {V_{2}}{R_{3}}}=0\\V_{1}=V_{2}+V_{\text{A}}\\\end{cases}}}$

By substituting V1 to the first equation and solving in respect to V2, we get:

${\displaystyle V_{2}={\frac {(R_{1}+R_{2})R_{3}V_{\text{B}}-R_{2}R_{3}V_{\text{A}}}{(R_{1}+R_{2})R_{3}+R_{1}R_{2}}}}$

Matrix form for the node-voltage equation

In general, for a circuit with ${\displaystyle N}$ nodes, the node-voltage equations obtained by nodal analysis can be written in a matrix form as derived in the following. For any node ${\displaystyle k}$, KCL states ${\displaystyle \sum _{j\neq k}G_{jk}(v_{k}-v_{j})=0}$ where ${\displaystyle G_{kj}=G_{jk}}$ is the negative of the sum of the conductances between nodes ${\displaystyle k}$ and ${\displaystyle j}$, and ${\displaystyle v_{k}}$ is the voltage of node ${\displaystyle k}$. This implies ${\displaystyle 0=\sum _{j\neq k}G_{jk}(v_{k}-v_{j})=\sum _{j\neq k}G_{jk}v_{k}-\sum _{j\neq k}G_{jk}v_{j}=G_{kk}v_{k}-\sum _{j\neq k}G_{jk}v_{j}}$ where ${\displaystyle G_{kk}}$ is the sum of conductances connected to node ${\displaystyle k}$. We note that the first term contributes linearly to the node ${\displaystyle k}$ via ${\displaystyle G_{kk}}$, while the second term contributes linearly to each node ${\displaystyle j}$ connected to the node ${\displaystyle k}$ via ${\displaystyle G_{jk}}$ with a minus sign. If an independent current source/input ${\displaystyle i_{k}}$ is also attached to node ${\displaystyle k}$, the above expression is generalized to ${\displaystyle i_{k}=G_{kk}v_{k}-\sum _{j\neq k}G_{jk}v_{j}}$. It is readily to show that one can combine the above node-voltage equations for all ${\displaystyle N}$ nodes, and write them down in the following matrix form

${\displaystyle {\begin{pmatrix}G_{11}&G_{12}&\cdots &G_{1N}\\G_{21}&G_{22}&\cdots &G_{2N}\\\vdots &\vdots &\ddots &\vdots \\G_{N1}&G_{N2}&\cdots &G_{NN}\end{pmatrix}}{\begin{pmatrix}v_{1}\\v_{2}\\\vdots \\v_{N}\end{pmatrix}}={\begin{pmatrix}i_{1}\\i_{2}\\\vdots \\i_{N}\end{pmatrix}}}$

or simply

${\displaystyle \mathbf {Gv} =\mathbf {i} }$

The matrix ${\displaystyle \mathbf {G} }$ on the left hand side of the equation is singular since it satisfies ${\displaystyle \mathbf {G1} =0}$ where ${\displaystyle \mathbf {1} }$ is a ${\displaystyle 1\times N}$ column matrix. This corresponds to the fact of current conservation, namely, ${\displaystyle \sum _{k}i_{k}=0}$, and the freedom to choose a reference node (ground). In practice, the voltage is the reference node is taken to be 0. Consider it is the last node, ${\displaystyle v_{N}=0}$. In this case, it is straightforward to verify that the resulting equations for the other ${\displaystyle N-1}$ nodes remain the same, and therefore one can simply discard the last column as well as the last line of the matrix equation. This procedure results in a ${\displaystyle (N-1)\times (N-1)}$ dimensional non-singular matrix equation with the definitions of all the elements stay unchanged.