Sub topic 5
Signs: entering versus leaving currents
This chapter assumes you can read a schematic, apply Ohm's law, and solve a small linear system. It also assumes you have seen the statement of KCL: the currents into a node equal the currents out of it. The goal here is bookkeeping. You will learn how to turn a node and its labeled currents into a correct equation, and how to avoid the sign mistakes that most often break nodal analysis.
Two kinds of sign
Every current in a KCL equation has two separate signs, and mixing them up causes most errors.
- The sign of the variable's value. A current
ihas a reference direction, which is the arrow you drew on the schematic. If the actual current flows along the arrow,iis positive. If it flows against the arrow,iis negative. - The sign of the term in the equation. This depends on whether the reference arrow points into or out of the node, and on which convention you chose for the equation.
The first sign is a property of the circuit and your arrow. The second is a property of your bookkeeping. You settle the second sign when you write the equation, before you know any values. You settle the first sign only when you solve.
The two conventions
KCL says the algebraic sum of the currents at a node is zero. "Algebraic" means each term carries a sign. There are two standard ways to assign it.
| Convention | Term for an arrow pointing into the node | Term for an arrow pointing out of the node |
|---|---|---|
| Entering positive | `+i` | `-i` |
| Leaving positive | `-i` | `+i` |
Both conventions give the same answers. They produce equations that differ only by a factor of -1, for example i1 + i2 - i3 = 0 versus -i1 - i2 + i3 = 0. Choose one convention for a node and use it for every term at that node.
Many textbooks and circuit solvers use leaving positive because it fits nodal analysis. A resistor current written as (v_node - v_other) / R already points away from the node, so every such term gets a plus sign.
Reading the arrows
Only the arrow's position relative to the node matters for the term sign. The arrow's position on the wire does not matter, and neither does the drawing style.
- An arrow whose head touches the node points into it.
- An arrow whose tail is at the node points out of it.
- A labeled arrow beside a wire follows the same rule: if it points toward the node, it is entering.
Two arrows on the same wire with opposite directions describe the same physical current with opposite signs: i_x = -i_y. Do not treat them as two different currents.
Worked example at a single node
A node has four branches with these reference arrows:
i1points into the node and equals +4 A.i2points into the node and equals -1 A.i3points out of the node and equals +2 A.i4points out of the node and is unknown.
Leaving-positive equation. Arrows pointing out get a plus sign, and arrows pointing in get a minus sign:
-i1 - i2 + i3 + i4 = 0
-(4) - (-1) + (2) + i4 = 0
-4 + 1 + 2 + i4 = 0
i4 = 1 AEntering-positive equation. The signs reverse:
i1 + i2 - i3 - i4 = 0
4 + (-1) - 2 - i4 = 0
i4 = 1 ABoth give i4 = +1 A, so the current flows out of the node along the arrow.
Physical check. The negative value of i2 means its actual current leaves the node. The actual currents entering the node total 4 A, from i1. The actual currents leaving total 1 A (i2) + 2 A (i3) + 1 A (i4) = 4 A. Entering equals leaving, as KCL requires.
Notice what happened to i2. Its reference arrow points in, so its term sign is entering-type. Its value is negative, so the physical flow is outward. Two negatives, one from the convention and one from the value, combine in the arithmetic: -(-1) = +1. Writing the parentheses explicitly, as above, prevents dropped signs.
A decision procedure
This diagram summarizes the steps for writing one KCL equation. Work through them in order.
Computing the unknown with code
The procedure is mechanical, so you can code it. The function below takes known currents as (value, reference) pairs, where reference is "in" or "out". It returns the value of one unknown current whose reference arrow points out of the node. It supports both conventions so you can confirm they agree.
def unknown_current(known, leaving_positive=True):
"""Return the unknown current whose reference arrow points OUT of the node.
known: list of (value_in_amperes, reference) with reference "in" or "out".
"""
total = 0.0
for value, reference in known:
if leaving_positive:
total += value if reference == "out" else -value
else:
total += -value if reference == "out" else value
# Leaving positive: total + x = 0 -> x = -total
# Entering positive: total - x = 0 -> x = total
return -total if leaving_positive else total
known = [(4.0, "in"), (-1.0, "in"), (2.0, "out")]
print(unknown_current(known, leaving_positive=True)) # 1.0
print(unknown_current(known, leaving_positive=False)) # 1.0Both calls print 1.0. The unknown's own term appears with the sign the convention gives an outward arrow, which is why the last step differs between the two branches.
Signs in nodal equations
When you write KCL in terms of node voltages, leaving positive gives a pattern you can apply without thinking about arrows. For a resistor R between node a and node b, the current leaving node a through it is (v_a - v_b) / R. If b is ground, this becomes v_a / R.
A source that pushes current into the node enters, so it takes a minus sign when you use leaving positive. Consider a 10 mA source feeding node 1, a 1 kΩ resistor from node 1 to ground, and a 2 kΩ resistor from node 1 to node 2. The KCL equation at node 1 is:
-10 mA + v1/1000 + (v1 - v2)/2000 = 0Most people move the source to the right side and write v1/1000 + (v1 - v2)/2000 = 10 mA. This is the same equation. It is the form used in the matrix G v = I, where the source current is a positive entry in I because it enters the node. With v1 = 8 V and v2 = 4 V, the left side is 8 mA + 2 mA = 10 mA. The equation balances.
Common errors
- Mixing conventions inside one equation. Writing
i1 + i2 + i3 = 0wheni1andi3point in andi2points out only works if you madei2negative on purpose. Check each term against its arrow. - Confusing the arrow with the physical flow. The arrow is a choice. A negative result means the real current is opposite to your arrow. It does not mean you made a mistake, and you do not need to redraw the arrow.
- Changing an arrow after writing the equation. If you flip a reference arrow, you must flip that term's sign. The new variable is
-i. Redrawing the arrow without updating the equation is a frequent source of wrong answers. - Dropping the sign of a substituted value. Write
-(-1)and not--1or-1. Put every substituted value in parentheses. - Forgetting a source. Independent current sources are branches too. Include each one with the sign its arrow requires.
- Using node voltage differences backward. The current leaving node
atowardbis(v_a - v_b)/R. Reversing the subtraction gives the current enteringa. If you are using leaving positive, the reversed form needs a minus sign.
Checking signs
After solving, always check with actual directions. List which branches carry current into the node and which carry it out, using the signs of the solved values and the arrows. Add the entering magnitudes and the leaving magnitudes. They must match. This check catches sign errors that algebra alone cannot, because a wrong equation can still have a clean-looking solution.
You can also make a plausibility check. If a node has only one branch that could carry current out, such as a single resistor to ground, that current must be non-negative in the direction from a higher to a lower potential. A result that contradicts this points to a sign error in the equation.
Exercise
At a node, i_a points into the node and equals 6 A. i_b points out and equals 2 A. i_c points into the node and equals -3 A. i_d points out and is unknown. Find i_d with the leaving-positive convention, then check the result by listing the actual entering and leaving currents.
Show answer
Leaving positive: -ia + ib - ic + id = 0, so -6 + 2 - (-3) + id = 0, which gives -6 + 2 + 3 + id = 0 and id = +1 A. Check: the actual current entering is 6 A through `ia. The actual currents leaving are 2 A through ib, 3 A through ic (its negative value means it leaves), and 1 A through i_d`. That is 2 + 3 + 1 = 6 A, so entering equals leaving.
Exercise
A student writes i1 + i2 + i3 = 0 at a node where i1 and i3 point into the node and i2 points out. Under what condition is this equation correct? How would you fix it under the entering-positive convention?
Show answer
The equation is correct only if the variable i2 was redefined as pointing into the node, because then all three arrows point in and entering-positive gives a plus sign on each. With the arrows as drawn, i2 points out, so its term must have the opposite sign. Under entering positive the equation is i1 - i2 + i3 = 0. The only other way to keep the equation is to redraw i2 pointing in, which makes the new variable -i2.
Exercise
A 5 mA source enters node 1. A 1 kΩ resistor connects node 1 to ground, and a 4 kΩ resistor connects node 1 to node 2. Write the leaving-positive KCL equation at node 1 in terms of v1 and v2.
Show answer
The source enters, so its term is -5 mA. The resistor currents leave: v1/1000 and (v1 - v2)/4000. The equation is -0.005 + v1/1000 + (v1 - v2)/4000 = 0, or equivalently v1/1000 + (v1 - v2)/4000 = 0.005.