⚡ Kirchhoff's Laws — Circuit Analysis Simulator
Electronics Analyze DC circuits using Modified Nodal Analysis (MNA). Select a preset circuit, adjust component values, then click Analyze to compute node voltages, branch currents, and power dissipation.
Kirchhoff's Laws
Kirchhoff's Voltage Law (KVL)
ΣV = 0 (around any loop)
The algebraic sum of all voltages around any closed loop in a circuit is zero. This is a consequence of conservation of energy — a charge returning to its starting node experiences zero net change in potential.
Example: In a series loop with V = 12 V, R1 = 1 kΩ, R2 = 2 kΩ: 12 − I·1000 − I·2000 = 0, so I = 4 mA.
Kirchhoff's Current Law (KCL)
ΣI = 0 (at every node)
The algebraic sum of all currents entering or leaving any node is zero. This expresses conservation of charge — charge cannot accumulate at a node in a steady-state DC circuit.
Example: At a node with currents I1 in, I2 and I3 out: I1 = I2 + I3. Nodal analysis applies KCL at each non-reference node.
Modified Nodal Analysis (MNA)
MNA builds a matrix system that combines KCL (at every non-reference node) with the branch equations of voltage sources. The unknowns are node voltages V and voltage-source branch currents J. The system has the form:
[C | D] [J] = [E]
G: conductance matrix (1/R entries from KCL)
B: voltage-source incidence columns
I: known current injections at nodes
E: voltage source values
Gaussian elimination with partial pivoting solves the system in O(n³) time. This simulator builds G, B, C, D, I, E for each preset topology, solves for node voltages, then computes branch currents as I_branch = (V_from − V_to) / R for resistors and reads the J value for voltage sources.
Animated current flow: dots move along each branch in the direction of conventional current (positive terminal to negative through the external circuit). Dot speed is proportional to current magnitude, making it easy to compare currents across branches visually.
Frequently Asked Questions
What is Kirchhoff's Voltage Law (KVL)?
Kirchhoff's Voltage Law (KVL) states that the algebraic sum of all voltages around any closed loop in a circuit is zero: ΣV = 0. This is a consequence of energy conservation — a charge traveling around a closed path returns to the same potential it started from. Voltage rises (sources) and voltage drops (resistors) must balance. For example, in a simple series loop with a 12 V battery, R1 = 1 kΩ, and R2 = 2 kΩ: 12 − V_R1 − V_R2 = 0, yielding current 4 mA and drops of 4 V and 8 V respectively.
What is Kirchhoff's Current Law (KCL)?
Kirchhoff's Current Law (KCL) states that the algebraic sum of all currents entering or leaving a node (junction) is zero: ΣI = 0. This expresses conservation of charge — charge cannot accumulate at a node in a DC circuit. If three branches meet at a node with current I1 entering and I2 and I3 leaving, then I1 = I2 + I3. KCL is the foundation of nodal analysis, where node voltages are the unknowns and one KCL equation is written per non-reference node.
What is Modified Nodal Analysis (MNA)?
Modified Nodal Analysis (MNA) is a systematic method for solving circuits that extends standard nodal analysis to handle voltage sources directly. The circuit equations are written as a matrix system [G|B; C|D][V; J] = [I; E], where G is the conductance matrix, B and C handle voltage source coupling, V is the vector of node voltages, J is the vector of voltage source currents, I is the vector of injected currents, and E is the vector of source voltages. Gaussian elimination solves for all unknowns simultaneously. MNA is the mathematical basis of SPICE and virtually all professional circuit simulators.
How do you solve a two-loop circuit?
A two-loop circuit can be solved using either mesh analysis or nodal analysis. With mesh analysis, assign mesh currents I1 and I2 to each loop, then apply KVL: for loop 1: V1 = I1·R1 + (I1−I2)·R2; for loop 2: 0 = I2·R3 + (I2−I1)·R2. Rearrange into matrix form and solve by Gaussian elimination. Nodal analysis finds the voltage at the internal node using KCL, then computes each branch current. This simulator uses MNA, which handles both methods automatically through its matrix formulation.
What is a Wheatstone bridge and when is it balanced?
A Wheatstone bridge has four resistors in a diamond pattern, with a voltage source across one diagonal and a meter across the other. It is balanced when R1/R2 = R3/R4, equivalently R1·R4 = R2·R3 — at this condition no current flows through the galvanometer branch and the bridge voltage is exactly zero. The balance condition allows one unknown resistor to be determined from three known ones. Wheatstone bridges are used in strain gauges, thermistors, and precision instruments achieving accuracies better than 0.1%.
What is nodal analysis vs mesh analysis?
Nodal analysis (based on KCL) solves for node voltages as primary unknowns, writing one equation per non-reference node. It is efficient when there are many nodes but few voltage sources. Mesh analysis (based on KVL) solves for mesh currents, writing one equation per independent loop. It is efficient when there are many loops but few current sources. For planar circuits the number of mesh equations equals B − N + 1 (branches minus nodes plus one). MNA combines both into a unified matrix formulation used by SPICE-based simulators.
How does KVL apply to non-planar circuits?
KVL applies equally to non-planar circuits — the voltage sum around any closed loop is always zero, regardless of whether the circuit can be drawn without crossing wires. Non-planar circuits cannot use mesh analysis directly, since planar meshes cannot be identified. Instead, nodal analysis or MNA must be used, as KCL at each node is purely topological and does not depend on planarity. The minimum number of independent KVL equations for any circuit is B − N + 1, regardless of planarity.
What are supernodes in nodal analysis?
A supernode is formed when an ideal voltage source connects two non-reference nodes. Since the voltage source enforces a fixed voltage difference between its terminals, the current through it is unknown — a KCL equation using conductance alone cannot be written. The solution is to treat both nodes as a single combined supernode: write KCL for the combined entity (all external currents = 0) and add the voltage constraint V_a − V_b = V_source. This gives a complete set of independent equations. MNA handles supernodes automatically via the B and C sub-matrices.
How do dependent sources affect MNA?
Dependent (controlled) sources add terms that reference other circuit variables. A Voltage-Controlled Current Source (VCCS) with transconductance g_m injects current g_m·V_ctrl, adding off-diagonal entries to the G matrix. A Current-Controlled Voltage Source (CCVS) adds a new unknown (its current) and a new equation (its voltage constraint). In MNA, all four types — VCCS, VCVS, CCCS, CCVS — are incorporated by extending the B, C, D sub-matrices, preserving the sparse structure needed for efficient simulation.
What is the superposition theorem in circuit analysis?
The superposition theorem states that in a linear circuit with multiple independent sources, the response at any element equals the sum of responses produced by each source acting alone, with all other sources replaced by their internal impedances (voltage sources → short circuits, current sources → open circuits). Superposition simplifies analysis when sources have different frequencies (e.g., AC + DC mixed circuits). It does not apply to power calculations since power is nonlinear (P = I²R), nor to circuits with nonlinear elements such as diodes or transistors.