Sub topic 7
Writing branch currents with Ohm's law
This chapter assumes you know Ohm's law for a resistor, can read a schematic, and have applied KCL at a single node with a consistent sign convention. Here you turn unknown branch currents into expressions in node voltages. That step connects KCL to nodal analysis.
Why express currents as voltages
KCL says the currents at a node sum to zero. In a real circuit you rarely know the branch currents. You usually know the resistor values and the source values. Ohm's law links each resistor current to the voltage across it, so you can replace every unknown current with a voltage difference divided by a resistance.
Node voltages are measured relative to a reference node, called ground, which is defined as 0 V. Every other node voltage is a potential relative to that reference.
The branch current rule
Take a resistor R between node A and node B. Let the current flow from A to B. Current flows from higher potential to lower potential through a passive resistor, so:
i(A to B) = (vA − vB) / R
Both the current and the voltage difference follow the same direction, from the first node named to the second. If vA is lower than vB, the result is negative. A negative result means the current really flows from B to A. The formula does not need correcting.
For a resistor from a node to ground, vB = 0, so the current is simply vA / R.
You can also write the rule with conductance G = 1/R, measured in siemens:
i(A to B) = G · (vA − vB)
Conductance makes the nodal equations that follow easier to assemble.
Writing KCL for currents leaving a node
A reliable habit is to write every branch current as leaving the node you are analyzing. Then KCL at that node reads: the sum of currents leaving equals zero, plus any source current entering the node.
For this node, KCL gives:
(v1 − 0)/R1 + (v1 − v2)/R2 = 10 mA
The source current is on the right because it enters the node. The two resistor currents leave it.
A worked example
Use R1 = 1 kΩ from node 1 to ground, R2 = 2 kΩ from node 1 to node 2, and R3 = 2 kΩ from node 2 to ground. A 10 mA source feeds node 1.
At node 1:
v1/1000 + (v1 − v2)/2000 = 0.010
At node 2, the current through R2 enters from node 1, so the leaving currents are (v2 − v1)/R2 and v2/R3:
(v2 − v1)/2000 + v2/2000 = 0
The second equation gives 2·v2 = v1, so v2 = v1/2. Substituting into the first: v1/1000 + (v1/2)/2000 = 0.010, which becomes 1.25·v1/1000 = 0.010, so v1 = 8 V and v2 = 4 V.
The branch currents follow directly:
- Through R1: 8 V / 1 kΩ = 8 mA, from node 1 to ground.
- Through R2: (8 − 4) V / 2 kΩ = 2 mA, from node 1 to node 2.
- Through R3: 4 V / 2 kΩ = 2 mA, from node 2 to ground.
Check at node 1: 8 mA + 2 mA = 10 mA, which matches the source.
Common errors
- Reversing the voltage difference. If the current is defined leaving node 1 toward node 2, write v1 − v2, not v2 − v1.
- Mixing units. Mixing kΩ with volts gives mA, but mixing kΩ with A does not. Convert everything to ohms and amperes, or stay consistently in kΩ and mA.
- Forgetting ground. A resistor to ground contributes v/R, not 0.
- Treating a negative current as an error. It only means the actual direction is opposite to the one you assumed.
Checking the result in code
R1, R2, R3 = 1000.0, 2000.0, 2000.0
v1, v2 = 8.0, 4.0
i_r1 = (v1 - 0) / R1 # node 1 to ground
i_r2 = (v1 - v2) / R2 # node 1 to node 2
i_r3 = (v2 - 0) / R3 # node 2 to ground
print(i_r1 + i_r2) # 0.01, matches the 10 mA source
print(i_r2 - i_r3) # 0.0, KCL balances at node 2Exercise
A 4 kΩ resistor connects node A (6 V) to node B (2 V). What is the current from A to B, and in which direction does it actually flow?
Show answer
i = (6 − 2) V / 4000 Ω = 1 mA. The result is positive, so the current actually flows from A to B.
Exercise
At node X, a 2 kΩ resistor goes to ground, and a 1 kΩ resistor goes to node Y at 3 V. A 5 mA source enters node X. Write the KCL equation in terms of vX and find vX.
Show answer
Leaving currents equal the source: vX/2000 + (vX − 3)/1000 = 0.005. Multiply by 2000: vX + 2vX − 6 = 10, so 3vX = 16 and vX = 5.33 V.