How to use the dc circuit nodal solver
- Type one part per line as NAME NODE NODE VALUE, for example R1 in out 1k.
- Start names with R for a resistor, V for a voltage source or I for a current source, and call the reference node 0.
- Use suffixes k, meg, m, u, n and p for values, such as 4.7k or 2m.
- Read the node voltages, the current and power for each part, and the balance checks.
Formula
Resistor stamp: conductance G = 1 / R added to both nodes, minus G between them
Voltage source: an extra unknown current, and the equation V(a) - V(b) = value
Current source: pushes its current out of the first node and into the second
Solve A x = z by Gaussian elimination with partial pivoting
This is modified nodal analysis. Current is counted from the first node of a part, through the part, to the second node, and power is voltage times current, positive when absorbed.
Divider chain, bridge and current source
With V1 = 12 V into R1 = 1k, then R2 = 2k to ground in parallel with R3 = 3k and R4 = 6k in series, the middle node is at 7.448276 V and the output node at 4.965517 V. The source supplies 4.552 mA and 54.62 mW, and the same power is absorbed by the resistors.
A bridge with a 10 V source, 1k and 1k on one side, 2k and 3k on the other and a 500 ohm resistor between the midpoints puts the midpoints at 5.227273 V and 5.454545 V, with the source delivering 7.045 mA. A 2 mA current source into 1k, with 2k and 4k continuing, gives 1.714286 V and 1.142857 V.
How to write a circuit
Every line names a part and the two nodes it connects. Node names are free text such as in, mid or 3, and node 0 (or gnd) is the reference for all voltages. Voltage sources are written with the positive node first. For a current source the current leaves the first node, passes through the source and enters the second, as in SPICE. A fixed voltage source across two nodes needs a path to ground from each side.
For simpler parts of the same problem use the Ohm's law calculator, the resistor network calculator for series and parallel groups, the voltage divider calculator and the op-amp gain calculator.
Checks the page performs
After solving, the page adds the currents leaving every node, which should be zero, and compares the power supplied by the sources with the power absorbed by everything else. Both differences are tiny numbers near the limit of floating-point accuracy and are shown so you can see the solution is consistent. If the circuit has no unique answer, for example a node with nothing connected to ground, the page says so.
Assumptions and limits
- Parts are ideal resistors, independent DC voltage sources and independent DC current sources. Wires have no resistance.
- Suffixes follow SPICE: m means milli and meg means mega, regardless of capital letters.
- Up to 40 parts and 30 nodes. Names must be unique and resistors must be above zero.
- There are no capacitors, inductors, diodes, transistors or dependent sources.
Frequently asked questions
What is nodal analysis?
It is a way to solve a circuit by writing, for each node, that the currents leaving it add up to zero, in terms of the unknown node voltages. Solving all the equations together gives every voltage.
Why do I need a node called 0?
Voltages only have meaning relative to a reference. Node 0 is that reference, at zero volts. Without it the circuit could be shifted up or down by any amount and the problem would have no single answer.
What does a negative source current mean?
The current through a voltage source is counted from its first node, through it, to the second. A negative value means the source is delivering power, pushing current out of its positive terminal into the circuit.
What does it mean when no unique solution is found?
The equations are not independent. Common causes are a part or group of parts with no connection to ground, two voltage sources forced across the same pair of nodes, or a current source feeding a node with no other path.