Sub topic 7
Worked example: one voltage source and one current source
This chapter applies superposition to one complete circuit. It assumes you know Ohm's law, KCL and KVL, series and parallel resistors, and voltage dividers. It also assumes you know that an ideal voltage source holds its voltage and an ideal current source holds its current.
The circuit
Source V1 (12 V) connects through R1 (4 Ω) to node A. Resistor R2 (6 Ω) connects node A to ground. Current source I1 (2 A) pushes current into node A from ground. The goal is the voltage at node A, VA, measured relative to ground.
The circuit contains only resistors and independent sources, so it is linear. Superposition applies.
Case 1: only V1 active
Replace the current source with an open circuit, because a zero-amp source carries no current. R1 and R2 are now in series across V1, and VA is the voltage across R2:
VA' = V1 · R2 / (R1 + R2) = 12 · 6 / 10 = 7.2 V
Case 2: only I1 active
Replace the voltage source with a short circuit, because a zero-volt source has no voltage across it. The left end of R1 is now at ground, so R1 and R2 are in parallel between node A and ground:
R1 ∥ R2 = (4 · 6) / (4 + 6) = 2.4 Ω
All 2 A of I1 flows through this parallel pair:
VA'' = I1 · (R1 ∥ R2) = 2 · 2.4 = 4.8 V
The sign is positive. I1 pushes current into node A, which raises its voltage above ground, and Case 1 also raised it. Both partial voltages use the same reference, with the ground node as the negative terminal.
Combine the results
VA = VA' + VA'' = 7.2 + 4.8 = 12 V
Check this with nodal analysis. KCL at node A, with currents leaving the node on the left side, gives:
(VA − V1)/R1 + VA/R2 = I1
Solving for VA gives (V1/R1 + I1) / (1/R1 + 1/R2) = 5 / (5/12) = 12 V. The two methods agree.
The same calculation in Python
import math
# Circuit: V1 in series with R1 feeds node A; R2 from A to ground;
# current source I1 injects current into node A.
V1 = 12.0 # volts
I1 = 2.0 # amperes into node A
R1 = 4.0 # ohms
R2 = 6.0 # ohms
# Case 1: only V1 active (I1 replaced by an open circuit) -> voltage divider
va_from_v1 = V1 * R2 / (R1 + R2) # 7.2 V
# Case 2: only I1 active (V1 replaced by a short circuit) -> R1 parallel R2
r_parallel = R1 * R2 / (R1 + R2) # 2.4 ohm
va_from_i1 = I1 * r_parallel # 4.8 V
# Superposition: add the partial responses
va = va_from_v1 + va_from_i1 # 12.0 V
# Check against nodal analysis: (VA - V1)/R1 + VA/R2 = I1
va_nodal = (V1 / R1 + I1) / (1 / R1 + 1 / R2)
assert math.isclose(va, va_nodal)
print(round(va_from_v1, 3), round(va_from_i1, 3), round(va, 3))The script prints 7.2 4.8 12.0. The assert stops the script if the superposition result and the nodal result differ.
Tracking signs on a branch current
Signs matter most for currents, because the two cases can push current through a resistor in opposite directions. Take the current through R1 from V1 toward node A as positive.
- Case 1: the current is 12 / 10 = 1.2 A, in the positive direction.
- Case 2: I1 splits between R1 and R2. The share through R1 is I1 · R2 / (R1 + R2) = 2 · 6 / 10 = 1.2 A. It flows from node A toward the shorted source, which is the negative direction.
The total is 1.2 − 1.2 = 0 A. This agrees with Ohm's law, since both ends of R1 are at 12 V. The 2 A from I1 all flows through R2, and V1 supplies no current.
Checking with a simulator
This netlist describes the same circuit. An operating-point run should report V(a) = 12 V. If you comment out one source at a time, you get the 7.2 V and 4.8 V partial results.
* Superposition check: V1 and I1 both active
V1 n1 0 DC 12
R1 n1 a 4
R2 a 0 6
I1 0 a DC 2
.op
.endIn SPICE, I1 0 a DC 2 means current flows from node 0 through the source to node a. That matches the "into node A" direction used here. To disable V1, comment out its line and add R0 n1 0 1u, or replace it with a wire to ground. To disable I1, comment out its line.
Exercise
Reverse I1 so that it takes 2 A out of node A, toward ground. Use superposition to find the new VA, then check it with the nodal equation.
Show answer
Case 1 is unchanged, so VA' = 7.2 V. In Case 2 the current direction is reversed, so VA'' = −2 · 2.4 = −4.8 V. The sum is VA = 7.2 − 4.8 = 2.4 V. Nodal check: the equation becomes (VA − 12)/4 + VA/6 = −2, so VA = (12/4 − 2) / (5/12) = 1 / (5/12) = 2.4 V.