Sub topic 7
Worked example: one voltage source and one current source
This chapter applies superposition to one complete circuit with a voltage source and a current source. It assumes you can use Ohm's law, Kirchhoff's current law (KCL), series and parallel resistor combinations, and the voltage divider. It also assumes you know what an ideal voltage source and an ideal current source are. The previous chapters covered linearity and how to deactivate sources, so here the rules are used rather than re-derived.
The circuit
The circuit has three nodes: ground, node N1 and node A.
- A 12 V source V1 connects N1 to ground, with its positive terminal at N1.
- Resistor R1 = 4 Ω connects N1 to node A.
- Resistor R2 = 6 Ω connects node A to ground.
- A current source I1 = 2 A injects current into node A. Its current comes from ground and enters node A.
The goal is the voltage VA at node A, measured relative to ground. Afterwards we also find the current through R1 and show why power must not be summed.
| Element | Value | Role |
|---|---|---|
| V1 | 12 V | Independent voltage source |
| I1 | 2 A | Independent current source, into node A |
| R1 | 4 Ω | Between V1 and node A |
| R2 | 6 Ω | Between node A and ground |
The plan
Superposition turns one two-source problem into two one-source problems. Each one needs only a divider or a parallel combination.
Fix one sign convention before starting. Every partial voltage is measured at node A with respect to ground, positive when A is above ground. Use the same reference for both cases. Most sign errors come from changing this reference between cases.
Case 1: only V1 active
Replace the current source with an open circuit, because an ideal current source with zero current is a break in the wire. The remaining circuit is V1 in series with R1 and R2. Nothing flows out of node A except through R2, so R1 and R2 form a voltage divider:
VA1 = V1 · R2 / (R1 + R2) = 12 · 6 / (4 + 6) = 7.2 V
The current in this case is 12 V / 10 Ω = 1.2 A. It flows from V1 through R1 and R2 to ground. Keep this number, since it is used again when we find the current in R1.
Case 2: only I1 active
Replace the voltage source with a short circuit, because an ideal voltage source with zero volts is a wire. Node N1 is now tied to ground, so R1 runs from node A to ground. R2 also runs from node A to ground, which puts the two resistors in parallel:
R1 ∥ R2 = (4 · 6) / (4 + 6) = 2.4 Ω
All 2 A from I1 enters node A and leaves through this parallel pair, so:
VA2 = I1 · (R1 ∥ R2) = 2 · 2.4 = 4.8 V
The sign is positive. Current enters node A and flows to ground through resistors, and current flowing through a resistor toward ground makes the upstream end positive. If I1 pointed out of node A, VA2 would be −4.8 V.
Combining the results
VA = VA1 + VA2 = 7.2 V + 4.8 V = 12 V
Both partial voltages are positive, so they add. Case 1 pushes node A up through R1 and Case 2 pushes it up through the current source, and neither opposes the other.
A second quantity: the current in R1
Superposition applies to any voltage or current in the circuit, so repeat the process for the current through R1. Define the reference direction as from N1 toward node A.
- Case 1 (V1 only): the 1.2 A computed above flows from N1 to A, so I(R1, case 1) = +1.2 A.
- Case 2 (I1 only): N1 is grounded, and R1 carries current from node A to ground. That current is VA2 / R1 = 4.8 / 4 = 1.2 A. It flows from A toward N1, opposite to the reference direction, so I(R1, case 2) = −1.2 A.
I(R1) = +1.2 + (−1.2) = 0 A
This result shows why tracking signs matters. If you added the magnitudes, you would get 2.4 A, which is wrong. The two sources drive current through R1 in opposite directions, and they cancel exactly.
You can confirm this with the node voltages. R1 has 12 V at N1 and 12 V at node A, so there is no voltage across it and no current in it. The 2 A from I1 flows entirely through R2: 12 V / 6 Ω = 2 A.
Checking with nodal analysis
An independent check catches arithmetic and sign mistakes. Write KCL at node A, with currents leaving the node on the left and the injected current on the right:
(VA − V1)/R1 + VA/R2 = I1
(VA − 12)/4 + VA/6 = 2
Multiply both sides by 12 to clear the fractions: 3(VA − 12) + 2VA = 24, so 5VA = 60 and VA = 12 V. This matches the superposition result.
The Python script below repeats both methods and asserts that they agree.
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 power trap
Suppose you want the power dissipated in R2. It is tempting to compute the power in each single-source case and add. That gives the wrong answer, because power is proportional to the square of the voltage, and squaring is not a linear operation.
R2 = 6.0
va_from_v1 = 7.2 # volts across R2 with only V1 active
va_from_i1 = 4.8 # volts across R2 with only I1 active
# Wrong: adding the powers from each single-source case
p_wrong = va_from_v1**2 / R2 + va_from_i1**2 / R2 # 12.48 W
# Right: add the voltages first, then compute power from the total
va_total = va_from_v1 + va_from_i1 # 12.0 V
p_right = va_total**2 / R2 # 24.0 W
print(round(p_wrong, 2), round(p_right, 2))The output is 12.48 24.0. The wrong value is about half the true one. The error is the cross term: (a + b)² = a² + b² + 2ab, and summing partial powers drops the 2ab term. In this circuit 2ab / R2 = 2 · 7.2 · 4.8 / 6 = 11.52 W, which accounts for the whole gap (12.48 + 11.52 = 24).
Common errors in this example
| Mistake | What goes wrong | Fix |
|---|---|---|
| Shorting I1 in Case 1 | The 2 A source is replaced by a wire, which changes the circuit. R2 is left in parallel with nothing useful and the divider is wrong. | A deactivated current source becomes an open circuit. |
| Opening V1 in Case 2 | R1 is left dangling, so it carries no current and VA2 comes out as 12 V (2 A · 6 Ω). | A deactivated voltage source becomes a short circuit. |
| Using R1 + R2 in Case 2 | The source current sees the two resistors in series instead of parallel. This gives VA2 = 20 V. | With V1 shorted, both resistors connect from node A to ground, so they are in parallel. |
| Adding current magnitudes | The R1 current comes out as 2.4 A instead of 0 A. | Choose one reference direction and carry the sign through. |
| Adding partial powers | The result is 12.48 W instead of 24 W. | Add voltages or currents, then compute power. |
| Turning off both sources at once | Every voltage and current in the circuit is zero, so there is nothing to add. | Deactivate all independent sources except one in each case. |
Checking in a simulator
A circuit simulator gives a third, independent check. The netlist below describes the full circuit. In SPICE, I1 0 a DC 2 pushes current through the source from node 0 to node a, so it injects current into node A as intended.
* 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
.endAn operating-point run should report V(a) = 12 V. To reproduce the partial results, run the netlist twice:
- For Case 1, comment out the
I1line. Expect V(a) = 7.2 V. - For Case 2, change
V1 n1 0 DC 12toV1 n1 0 DC 0. Expect V(a) = 4.8 V.
In Case 2, set V1 to 0 V instead of deleting the line. A 0 V source is a short circuit, and it keeps node n1 connected to ground. Deleting it leaves n1 floating, and many simulators report an error for a floating node.
What the example shows
- Each single-source case needed only a divider or a parallel combination. No simultaneous equations were required.
- The two sources helped each other at node A (7.2 V + 4.8 V) but opposed each other in R1 (+1.2 A and −1.2 A).
- Zero current in R1 is a result worth noticing. It occurs because VA happens to equal V1.
- The total is correct only when voltages and currents are added. Power, which depends on squares, is computed from the totals.
Exercise
Keep V1 = 12 V, R1 = 4 Ω and R2 = 6 Ω, but reverse the current source so that I1 = 2 A flows out of node A into ground. Use superposition to find VA, and then find the current in R1 in the direction from N1 to A.
Show answer
Case 1 is unchanged: VA1 = 7.2 V and the R1 current is +1.2 A. In Case 2 the 2 A now leaves node A, so VA2 = −2 · 2.4 = −4.8 V. Then VA = 7.2 − 4.8 = 2.4 V. In Case 2, R1 carries current from N1's side toward A: with V1 shorted, VA2 = −4.8 V means current flows from ground (N1) through R1 to A at 4.8 / 4 = 1.2 A, so I(R1, case 2) = +1.2 A. The total R1 current is 1.2 + 1.2 = 2.4 A from N1 to A. Check: (12 − 2.4) / 4 = 2.4 A.
Exercise
With the original circuit (I1 = 2 A into node A, V1 = 12 V), the power in R2 is 24 W. Explain in one or two sentences why adding the power from Case 1 (8.64 W) and Case 2 (3.84 W) gives 12.48 W and not 24 W, and state how large the missing term is.
Show answer
Power is proportional to voltage squared, so it is not linear and superposition does not apply to it. The sum of squares leaves out the cross term 2 · VA1 · VA2 / R2 = 2 · 7.2 · 4.8 / 6 = 11.52 W, and 12.48 + 11.52 = 24 W.
Exercise
In the original circuit, I1 is changed to 3 A into node A and V1 stays at 12 V. Find VA by superposition and confirm it with a nodal equation.
Show answer
Case 1 gives VA1 = 7.2 V. Case 2 gives VA2 = 3 · 2.4 = 7.2 V. So VA = 14.4 V. Nodal check: (VA − 12)/4 + VA/6 = 3, so 3(VA − 12) + 2VA = 36, so 5VA = 72 and VA = 14.4 V.