TExcelTAD
Home › Circuit Theory & Network Analysis › Supernodes and Dependent Sources in Nodal Analysis

Supernodes and Dependent Sources in Nodal Analysis

The routine of Node-Voltage Analysis writes "current leaving through resistors" at every node. Two kinds of element break that routine. A voltage source between two non-reference nodes carries a current that Ohm's law cannot give you, and a dependent source (the small-signal model of every transistor and op-amp) injects a current or voltage set by some other quantity in the circuit. This lesson adds the two tricks that handle them: the supernode, and writing each control variable in terms of node voltages.

The supernode

A floating voltage source fixes the difference of its two node voltages but says nothing about its own current. Instead of introducing that current as a new unknown, draw a closed surface around the source and both of its nodes. KCL holds for any closed surface, so the sum of currents leaving the surface through the other elements is zero, and the source current, which stays inside the surface, never appears. The source itself supplies the missing equation.

I1 6 mA R1 2 kOhm + - VS 4 V R2 2 kOhm R3 1 kOhm + - V3 10 V 1 2 3 supernode KCL on the dashed surface; VS adds v2 - v1 = 4 V

For a supernode joining nodes kk and mm through a source VsV_s (+ at mm):

∑surfaceileaving=∑isources in,vm−vk=Vs\sum_{\text{surface}} i_\text{leaving} = \sum i_\text{sources in}, \qquad v_m - v_k = V_s

One KCL equation plus one constraint replaces two KCL equations, so the count of equations still equals the count of unknowns.

Worked example: a supernode

Given: the circuit above: I1=6 mAI_1 = 6\ \text{mA} into node 1, R1=2 kΩR_1 = 2\ \text{k}\Omega (1 to ground), VS=4 VV_S = 4\ \text{V} (+ at node 2, - at node 1), R2=2 kΩR_2 = 2\ \text{k}\Omega (2 to ground), R3=1 kΩR_3 = 1\ \text{k}\Omega (2 to 3), V3=10 VV_3 = 10\ \text{V} fixing node 3.

Find: v1v_1, v2v_2 and the current through VSV_S.

Solve: node 3 is known, v3=10 Vv_3 = 10\ \text{V}. KCL on the supernode (kΩ\text{k}\Omega, mA, V), then the constraint:

v12+v22+v2−101=6supernodev2−v1=4source VSv12+v1+42+v1+4−10=6  ⇒  2v1=10\begin{aligned} \frac{v_1}{2} + \frac{v_2}{2} + \frac{v_2 - 10}{1} &= 6 && \text{supernode} \\ v_2 - v_1 &= 4 && \text{source } V_S \\ \frac{v_1}{2} + \frac{v_1 + 4}{2} + v_1 + 4 - 10 &= 6 \;\Rightarrow\; 2 v_1 = 10 \end{aligned}

So v1=5 Vv_1 = 5\ \text{V} and v2=9 Vv_2 = 9\ \text{V}. The current through VSV_S comes from KCL at node 1 alone: I1I_1 brings in 6 mA6\ \text{mA}, R1R_1 takes 5/2=2.5 mA5/2 = 2.5\ \text{mA}, so 3.5 mA3.5\ \text{mA} flows through VSV_S from node 1 to node 2 (in at its - terminal, out at its +).

Check: at node 2, 3.5 mA3.5\ \text{mA} arrives from VSV_S and (10−9)/1=1 mA(10 - 9)/1 = 1\ \text{mA} from R3R_3; R2R_2 takes 9/2=4.5 mA9/2 = 4.5\ \text{mA}. 3.5+1=4.53.5 + 1 = 4.5. VSV_S delivers 4 V⋅3.5 mA=14 mW4\ \text{V} \cdot 3.5\ \text{mA} = 14\ \text{mW}.

Dependent sources

A dependent (controlled) source has a value set by a voltage or current elsewhere:

Source Symbol value SPICE letter Typical origin
voltage-controlled voltage source (VCVS) μvx\mu v_x E op-amp gain stage
voltage-controlled current source (VCCS) gmvxg_m v_x G MOSFET small-signal model
current-controlled current source (CCCS) βix\beta i_x F BJT small-signal model
current-controlled voltage source (CCVS) rmixr_m i_x H transimpedance amplifier

They are drawn as diamonds. In nodal analysis treat a dependent source like an independent one while writing KCL, then add one line that writes its control variable in terms of node voltages, and substitute. The resulting matrix is no longer symmetric, and a dependent source can deliver net power: it models an amplifier with a hidden power supply.

+ - V1 10 V R1 1 kOhm ix R2 2 kOhm R3 1 kOhm R4 5 kOhm 2 ix beta = 2 a b c

Worked example: a current-controlled current source

Given: V1=10 VV_1 = 10\ \text{V} at node a; R1=1 kΩR_1 = 1\ \text{k}\Omega (a to b), whose current ixi_x controls a CCCS of 2ix2 i_x into node c; R2=2 kΩR_2 = 2\ \text{k}\Omega (b to ground), R3=1 kΩR_3 = 1\ \text{k}\Omega (b to c), R4=5 kΩR_4 = 5\ \text{k}\Omega (c to ground).

Find: vbv_b, vcv_c, ixi_x and the power of the dependent source.

Solve: control variable first: ix=(10−vb)/1i_x = (10 - v_b)/1. KCL at b and c:

(vb−10)+vb2+(vb−vc)=0(vc−vb)+vc5=2(10−vb)⇒[2.5−111.2][vbvc]=[1020]\begin{aligned} (v_b - 10) + \frac{v_b}{2} + (v_b - v_c) &= 0 \\ (v_c - v_b) + \frac{v_c}{5} &= 2 (10 - v_b) \end{aligned} \quad\Rightarrow\quad \begin{bmatrix} 2.5 & -1 \\ 1 & 1.2 \end{bmatrix} \begin{bmatrix} v_b \\ v_c \end{bmatrix} = \begin{bmatrix} 10 \\ 20 \end{bmatrix}

det⁡=2.5⋅1.2+1=4\det = 2.5 \cdot 1.2 + 1 = 4, so vb=(10⋅1.2+20)/4=8 Vv_b = (10 \cdot 1.2 + 20)/4 = 8\ \text{V}, vc=(2.5⋅20−10)/4=10 Vv_c = (2.5 \cdot 20 - 10)/4 = 10\ \text{V}, ix=2 mAi_x = 2\ \text{mA} and the source pushes 4 mA4\ \text{mA} into node c.

Check: at c, R3R_3 takes (10−8)/1=2 mA(10 - 8)/1 = 2\ \text{mA} back to b and R4R_4 takes 10/5=2 mA10/5 = 2\ \text{mA}: total 4 mA4\ \text{mA}. Node c sits above the only independent source (10 V10\ \text{V}), which is impossible in a passive circuit: the dependent source delivers 10 V⋅4 mA=40 mW10\ \text{V} \cdot 4\ \text{mA} = 40\ \text{mW}. Note the off-diagonal entries −1-1 and +1+1: the substitution made GG asymmetric.

In Python

The code writes both systems row by row, exactly as derived, and checks each with a residual.

python · try it yourself
import numpy as np

# Supernode: unknowns v1, v2 (kOhm, mA, V)
A = np.array([[1/2, 1/2 + 1/1],     # KCL on the supernode
              [-1.0, 1.0]])          # v2 - v1 = 4
b = np.array([6 + 10/1, 4.0])
v1, v2 = np.linalg.solve(A, b)
print(f"supernode: v1 = {v1:.3f} V, v2 = {v2:.3f} V, I(VS) = {6 - v1/2:.3f} mA")

# CCCS: unknowns vb, vc; ix = (10 - vb)/1, source 2*ix into node c
beta = 2.0
G = np.array([[1 + 1/2 + 1, -1.0],
              [-1 + beta,    1 + 1/5]])
i = np.array([10.0, 10 * beta])
vb, vc = np.linalg.solve(G, i)
ix = (10 - vb) / 1
print(f"CCCS: vb = {vb:.3f} V, vc = {vc:.3f} V, ix = {ix:.3f} mA")
print("G symmetric?", bool(np.allclose(G, G.T)))
print(f"dependent source power: {vc * beta * ix:.1f} mW delivered")
print("residual:", float(np.abs(G @ np.array([vb, vc]) - i).max()))
supernode: v1 = 5.000 V, v2 = 9.000 V, I(VS) = 3.500 mA
CCCS: vb = 8.000 V, vc = 10.000 V, ix = 2.000 mA
G symmetric? False
dependent source power: 40.0 mW delivered
residual: 0.0

Cross-check with SPICE

ngspice's CCCS is the F element. It needs the control current to flow through a voltage source, so the deck inserts a 0 V "ammeter" Vx in series with R1R_1. F1 0 c Vx 2 pushes twice the current of Vx from node 0 through the source into node c.

bash · try it yourself
cat > cccs.cir <<'EOF'
* CCCS example: F1 = 2 * i(Vx), Vx senses the current in R1
V1 a 0 DC 10
Vx a ax DC 0
R1 ax b 1k
R2 b 0 2k
R3 b c 1k
R4 c 0 5k
F1 0 c Vx 2
.control
op
print v(b) v(c) i(Vx)
.endc
.end
EOF
ngspice -b cccs.cir 2>&1 | grep -E '^(v\(|i\()'
v(b) = 8.000000e+00
v(c) = 1.000000e+01
i(vx) = 2.000000e-03

Interactive: the supernode circuit

Slide VSV_S and watch v1v_1 and v2v_2 keep exactly that difference while both move. The lab draws the current of each element from its first node to its second.

node voltages (to ground 0)n15.000 Vn29.000 Vn310.00 VnetlistI1 0 n1 DC 6mR1 n1 0 2kVS n2 n1 DC 4R2 n2 0 2kR3 n2 n3 1kV3 n3 0 DC 10element currents (node 1 to node 2 through it)I10>n16.00 mAR1n1>02.50 mAVSn2>n1-3.50 mAR2n2>04.50 mAR3n2>n3-1.00 mAV3n3>0-1.00 mA

At the default it reads v1=5 Vv_1 = 5\ \text{V}, v2=9 Vv_2 = 9\ \text{V} and a current of −3.5 mA-3.5\ \text{mA} in VSV_S (SPICE direction, from its + node through the source to its - node: 3.5 mA3.5\ \text{mA} the other way).

Guided lab: a floating source on the bench

Hand calculation. Build the supernode circuit, but replace I1I_1 by a 12 V12\ \text{V} supply in series with 2 kΩ2\ \text{k}\Omega: its Norton equivalent is 6 mA6\ \text{mA} in parallel with 2 kΩ2\ \text{k}\Omega, which now sits in parallel with R1R_1, so redo the KCL with 1 kΩ1\ \text{k}\Omega to ground at node 1: v1+(v1+4)/2+(v1+4−10)=6v_1 + (v_1 + 4)/2 + (v_1 + 4 - 10) = 6, giving v1=4.0 Vv_1 = 4.0\ \text{V} and v2=8.0 Vv_2 = 8.0\ \text{V}.

Simulation. Edit the netlist of the lab mentally or in a deck: V0 s 0 DC 12, Rs s n1 2k instead of I1; ngspice prints the same 4.04.0 and 8.0 V8.0\ \text{V}.

What you would measure. VSV_S must be a supply whose output is isolated from earth (most bench supplies with floating outputs are; check the earth terminal is not linked to -). Set it to 4.00 V4.00\ \text{V} with a 20 mA20\ \text{mA} limit, V3V_3 to 10.00 V10.00\ \text{V} and the third supply to 12.00 V12.00\ \text{V}. Expect v1=4.00±0.05 Vv_1 = 4.00 \pm 0.05\ \text{V} and v2=8.00±0.08 Vv_2 = 8.00 \pm 0.08\ \text{V} (1 % resistors, 0.1 % meter), and v2−v1v_2 - v_1 equal to the VSV_S reading within the meter's last digit.

Hazards and safe setup. All supplies at or below 12 V with current limits of 20 mA. A supply whose - is earthed cannot float: tying it in as VSV_S would short node 1 to ground through the earth. Every supply here delivers current (the 12 V supply 4 mA, VSV_S and V3V_3 2 mA each), so none has to sink current, which many bench supplies cannot do.

Pitfalls

  • Writing KCL at both nodes of a floating source without its current: each equation is then wrong. Use the supernode, or keep the source current as an extra unknown (that is what MNA does).
  • Forgetting the constraint equation. The supernode KCL alone has two unknowns.
  • Leaving the control variable unexpressed. Every ixi_x or vxv_x must be rewritten in node voltages before solving.
  • Assuming a symmetric matrix. Dependent sources make GG asymmetric; methods that rely on symmetry (Cholesky) do not apply.
  • Expecting passive behaviour. Node voltages above every independent source are possible with dependent sources.

Practice

  1. In the supernode example, change VSV_S to 6 V6\ \text{V}. Find v1v_1 and v2v_2.
  2. In the CCCS example, set β=0\beta = 0. What are vbv_b and vcv_c, and why does vcv_c equal a divider result?
  3. A VCCS of gmvbg_m v_b with gm=1 mSg_m = 1\ \text{mS} replaces the CCCS. Which entry of GG changes, and to what?
Answer
  1. v1/2+(v1+6)/2+(v1+6−10)=6⇒2v1=7v_1/2 + (v_1 + 6)/2 + (v_1 + 6 - 10) = 6 \Rightarrow 2 v_1 = 7: v1=3.5 Vv_1 = 3.5\ \text{V}, v2=9.5 Vv_2 = 9.5\ \text{V}.
  2. G=[2.5−1−11.2]G = \begin{bmatrix} 2.5 & -1 \\ -1 & 1.2 \end{bmatrix}, i=(10,0)\mathbf{i} = (10, 0), det⁡=2\det = 2: vb=6 Vv_b = 6\ \text{V}, vc=5 Vv_c = 5\ \text{V}. With no injection, R3R_3 and R4R_4 divide vbv_b: 6⋅5/6=5 V6 \cdot 5/6 = 5\ \text{V}.
  3. The source puts +gmvb+g_m v_b into node c, which moves to the left side as −gmvb-g_m v_b: GcbG_{cb} becomes −1−1=−2-1 - 1 = -2 mS; the other entries of GG stay, and the CCCS's 20 mA20\ \text{mA} term leaves the right-hand side of row c (it becomes 0).

Test yourself

Why can't you write ordinary KCL at a node connected to a floating voltage source?

  1. the node voltage is unknown
  2. the current through the voltage source is not given by Ohm's law
  3. KCL does not hold there
  4. the source has zero resistance so the current is infinite

A supernode replaces two KCL equations with…

  1. one KCL equation on the surface plus the source's voltage constraint
  2. two mesh equations
  3. one equation only
  4. a current-divider formula

Which SPICE element is a current-controlled current source, and what does it need?

  1. E, a control node pair
  2. G, a control node pair
  3. F, a voltage source carrying the control current
  4. H, a resistor

After substituting a dependent source's control variable, the nodal matrix is in general…

  1. symmetric
  2. diagonal
  3. not symmetric
  4. singular