Reactive Elements

Capacitors and inductors are fundamentally different from resistors. A resistor's current depends on the voltage right now. A capacitor's current depends on how fast the voltage is changing. An inductor's voltage depends on how fast the current is changing. This time-dependence -- the involvement of derivatives -- is what makes reactive elements reactive, and what makes them the source of nearly all the interesting behavior in analog circuits: oscillation, filtering, energy storage, timing, and resonance.

The three analysis types see reactive elements in three completely different ways:

DC analysis: Capacitors are open circuits. Inductors are short circuits. In steady state, nothing is changing -- , -- so the capacitor passes no current and the inductor drops no voltage. Reactive elements simply vanish from the DC problem.

AC analysis: Capacitors and inductors become complex impedances. A capacitor has impedance -- it passes high-frequency signals and blocks low-frequency ones. An inductor has impedance -- it blocks high-frequency signals and passes low-frequency ones. These frequency-dependent impedances are what make filters, resonators, and frequency-selective networks possible.

Transient analysis: This is where the real complexity lives. The simulator must solve the differential equations and at every timestep. Since SPICE works with algebraic equations (matrix solves), not differential equations, it must convert these derivatives into algebraic approximations using numerical integration. The result is a companion model: at each timestep, the capacitor or inductor is replaced by an equivalent conductance plus a current source, whose values depend on the integration method and the solution history.


Capacitors

A capacitor stores energy in an electric field between two conductive plates. The fundamental relationship is:

where is the charge stored (coulombs), is the capacitance (farads), and is the voltage across the capacitor. Differentiating both sides with respect to time gives the current-voltage relationship:

This single equation says everything about how a capacitor behaves: current flows only when the voltage is changing. A constant voltage produces zero current. A rapidly changing voltage produces a large current.


DC: open circuit

In DC steady state, all voltages are constant -- everywhere. The capacitor equation becomes . No current flows. The capacitor behaves as an open circuit: it's simply absent from the DC problem.


AC: complex impedance

In AC analysis, all signals are sinusoidal at frequency . A sinusoidal voltage across the capacitor produces current:

The impedance is:

This is a purely imaginary impedance. Its magnitude decreases with frequency -- at high frequencies, the capacitor has low impedance and passes signals easily. At low frequencies, the impedance is high and the capacitor blocks signals. At DC (), the impedance is infinite -- consistent with the open-circuit behavior.


Transient: the companion model

Transient analysis is where capacitors get interesting -- and computationally demanding. The simulator must solve at every timestep, but it can only solve algebraic equations (linear systems). The bridge between differential and algebraic is numerical integration.

Trapezoidal rule

The trapezoidal rule approximates the integral of current over one timestep as the average of the current at the start and end of the step:

Since , this gives:

Solving for :

This has the form of a conductance times the current voltage, plus a known history term:

where:

Gear (BDF) methods

The Gear methods use a different approximation -- they estimate the derivative using a weighted combination of the solution at several previous timesteps. For Gear order 2:

where depends on the step size ratio. The history term incorporates charge values from the previous two timesteps.

The companion circuit

Regardless of the integration method, the result is the same structure: at each timestep, the capacitor is replaced by an equivalent conductance in parallel with an equivalent current source . The companion model stamps into the MNA matrix exactly like a resistor (the part) plus a current source (the part). This is what makes transient simulation possible: every reactive element becomes a simple resistor-plus-source at each timestep, and the same matrix solver handles everything.


Initial conditions

A capacitor can start a transient simulation with a specified voltage using the IC parameter:

C1 pos neg 10n IC=2.5

This sets V. The initial condition determines the starting charge , which enters the integration history and affects the companion model at the first timestep.


Inductors

An inductor stores energy in a magnetic field created by current flowing through a coil. The fundamental relationship is the dual of the capacitor:

where is the magnetic flux (weber), is the inductance (henry), and is the current through the inductor. Differentiating gives the voltage-current relationship:

Voltage appears only when the current is changing. A constant current produces zero voltage drop. A rapidly changing current produces a large voltage. This is the mirror image of the capacitor.


DC: short circuit

In DC steady state, all currents are constant -- . The inductor equation becomes . No voltage is dropped. The inductor behaves as a short circuit: a wire with zero impedance.

This means inductors do affect the DC operating point -- they provide a zero-resistance path for current. Unlike capacitors (which disappear from the DC problem), inductors are very much present. An inductor between two nodes forces those nodes to the same voltage.


AC: complex impedance

In AC analysis, a sinusoidal current through the inductor produces voltage:

The impedance is:

This is purely imaginary and positive -- the dual of the capacitor's . The magnitude increases with frequency. At low frequencies, the inductor has low impedance (consistent with being a short circuit at DC). At high frequencies, the impedance is large and the inductor blocks signals.


Transient: the companion model

Like the capacitor, the inductor's differential equation must be converted into an algebraic companion model at each timestep. The state variable for an inductor is flux: . The integration methods (trapezoidal, Gear) convert this into:

where is the companion resistance and is the companion voltage source. This is the dual of the capacitor's companion model: where the capacitor becomes a conductance in parallel with a current source, the inductor becomes a resistance in series with a voltage source.


Capacitor-inductor duality

Capacitors and inductors are mathematical duals. Every statement about one has a corresponding statement about the other with voltage and current swapped:

Capacitor Inductor
DC: open circuit DC: short circuit
AC: AC:
State variable: charge State variable: flux
Companion: Companion: in series with
No branch equation Has branch equation

Mutual Inductors

When two inductors are placed near each other, their magnetic fields interact. Current flowing through one inductor creates a magnetic flux that links through the other, inducing a voltage. This coupling is the basis of every transformer, and SPICE models it with the K element -- a mutual inductor that specifies how strongly two inductors are coupled.

L1 1 2 10m
L2 3 4 10m
K1 L1 L2 0.99

The K element doesn't exist as a physical device with its own terminals. It's a modifier that creates a coupling relationship between two existing inductors. The single parameter is the coupling coefficient, which ranges from 0 (no coupling) to 1 (perfect coupling).


Mutual inductance

The physical quantity that describes the coupling is the mutual inductance :

has units of henries, just like self-inductance. It determines how much voltage is induced in one inductor by a changing current in the other:

Each inductor's voltage depends on its own current derivative (self-inductance) plus the other inductor's current derivative (mutual inductance). When , the mutual terms vanish and the inductors are independent.


Transformers

The most common use of mutual inductors is to model transformers. An ideal transformer with turns ratio is approximated by:

The voltage transformation ratio follows from the inductance ratio:


Reactive Circuits

With capacitors, inductors, and mutual inductors in hand, we can now look at circuits where reactive elements produce the most characteristic behavior in analog electronics: oscillation, ringing, and energy transfer.


RLC ringing

Connect a resistor, inductor, and capacitor in series, apply a voltage step, and watch what happens. If the resistance is small enough, the circuit doesn't just charge up monotonically -- it oscillates. The energy sloshes back and forth between the capacitor's electric field and the inductor's magnetic field, with the resistor slowly dissipating energy on each cycle until the oscillation dies out.

The natural behavior is governed by two parameters:

Natural frequency -- the frequency at which the circuit would oscillate with zero resistance:

Damping ratio -- the ratio of actual resistance to the critical resistance:

The damping ratio determines the character of the transient response:

The actual oscillation frequency in the underdamped case is slightly lower than because of the damping:

A simulated example

Consider , , :

With , this circuit is highly underdamped. A step input produces vigorous ringing at about 15.9 kHz.


Simulation considerations

Reactive circuits require care in transient simulation:

  1. Timestep control: The simulator must resolve the fastest oscillation in the circuit. The LTE-based adaptive timestep handles this automatically, but setting TSTEP to something reasonable helps the initial timestep estimate.

  2. Initial conditions: Capacitor and inductor initial conditions determine the initial energy in the circuit. A capacitor charged to stores energy . An inductor carrying stores energy .

  3. Integration method: For oscillatory circuits, the trapezoidal method preserves energy better than Gear methods (it's "A-stable" and has no numerical damping). But for stiff circuits with widely separated time constants, Gear methods are more robust.

  4. Breakpoints: Reactive circuits driven by PULSE or PWL sources benefit from breakpoints that force the simulator to land on source transitions.