s-Domain Circuit Analysis
Two identical RC low-pass stages, each with a time constant, are cascaded to filter a sensor signal more steeply. How long does the output take to settle after a step? "Two stages of " suggests a few milliseconds, but the second stage loads the first, and the answer is not a simple multiple. With two capacitors the circuit is second order; writing and solving its differential equation by hand is unpleasant. In the s domain it is nodal analysis with two unknowns, followed by partial fractions. This lesson is the full workflow: s-domain models → nodal or mesh equations → transfer function → partial fractions → time response.
The workflow
- Draw the circuit for in the s domain: , , , sources as transforms, initial-condition sources where energy is stored.
- Write nodal (or mesh) equations exactly as for a resistive circuit, with admittances , , .
- Solve the linear system; the unknowns are rational functions of .
- With zero initial conditions, the ratio output/input is the transfer function . The response to an input is .
- Expand in partial fractions and invert term by term.
For distinct poles , partial fractions take the form
The residue is found by "covering up" the factor and evaluating the rest at . Complex poles come in conjugate pairs with conjugate residues and combine into a damped sinusoid; repeated poles add terms . The algebra is in Inverse Laplace.
The circuit
Worked example: the RC ladder
Given: , (so ), both capacitors empty, a step at the input.
Find: , its poles, , and at and .
Solve: KCL at a and b, currents leaving:
Substitute into the first equation and write :
Poles: , that is and , both real (two RC stages can never ring). For the step, and the cover-up rule gives
so and .
Check: , as it must be with empty capacitors; the residues sum to zero. The slow pole has a time constant , not : loading makes the cascade much slower than one stage. Two buffered stages would have a double pole at and the step response , which gives at instead of . Buffers between filter stages exist for this reason.
In Python: nodal equations in s, solved symbolically
import numpy as np
import sympy as sp
from scipy import signal
s = sp.symbols("s")
R, C = 1000, sp.Rational(1, 10**6)
Va, Vb, Vin = sp.symbols("V_a V_b V_in")
eqs = [sp.Eq((Va - Vin)/R + s*C*Va + (Va - Vb)/R, 0),
sp.Eq((Vb - Va)/R + s*C*Vb, 0)]
sol = sp.solve(eqs, [Va, Vb])
H = sp.factor(sp.simplify(sol[Vb] / Vin))
print("H(s) =", H)
num, den = sp.fraction(H)
poles = sorted(sp.solve(den, s), key=lambda p: -float(p))
print("poles (1/s):", [round(float(p), 2) for p in poles])
F = H / s # 1 V step
residues = {}
for p in [sp.Integer(0)] + poles:
residues[float(p)] = float(sp.limit((s - p) * F, s, p))
print(f"residue at s = {float(p):9.2f}: {residues[float(p)]:+.5f}")
vb = lambda t: sum(K * np.exp(p * t) for p, K in residues.items())
for t in [0.0, 1e-3, 2.618e-3, 5e-3, 10e-3]:
print(f"vb({t*1e3:5.3f} ms) = {float(vb(t)):.4f} V")
n = [float(c) for c in sp.Poly(num, s).all_coeffs()]
d = [float(c) for c in sp.Poly(den, s).all_coeffs()]
ts = np.linspace(0, 10e-3, 1001)
_, y = signal.step(signal.lti(n, d), T=ts)
print("partial fractions and scipy.signal.step agree:", bool(np.max(np.abs(y - vb(ts))) < 1e-9))H(s) = 1000000/(s**2 + 3000*s + 1000000)
poles (1/s): [-381.97, -2618.03]
residue at s = 0.00: +1.00000
residue at s = -381.97: -1.17082
residue at s = -2618.03: +0.17082
vb(0.000 ms) = 0.0000 V
vb(1.000 ms) = 0.2134 V
vb(2.618 ms) = 0.5695 V
vb(5.000 ms) = 0.8266 V
vb(10.000 ms) = 0.9743 V
partial fractions and scipy.signal.step agree: True
sp.solve handled the two simultaneous equations; for larger circuits build the admittance matrix and use sp.Matrix.LUsolve, exactly like the MNA matrices with and in the entries.
Interactive: the ladder's step response
At the lab's reads about . Raise towards : the second stage loads the first less and less, node a behaves like a single RC stage again, and becomes much slower (its own is now ).
Guided lab: measure the loading effect
Hand calculation. Predict at , and for the ladder (above), then for the same two stages separated by a unity-gain buffer: , giving , and .
Simulation. The netlist lab for the ladder; for the buffered case add a voltage-controlled voltage source with gain 1 between the stages (E1 x 0 a 0 1 and connect R2 to x).
What you would measure. Drive the ladder with a to square wave at (half period , enough to settle). Scope node b and read the voltage at the three times with cursors. Expect the ladder values within about 5 to 10 % (capacitor tolerance dominates). The buffered version needs an op-amp follower, the subject of Analog Electronics; its curve is visibly faster.
Hazards and safe setup. Signal levels only. Use film capacitors, or electrolytics with + towards the source if the square wave never goes negative.
Pitfalls
- Mixing -domain and time-domain quantities in one equation: with is a common slip.
- Forgetting the input's transform. The step response is , not ; itself inverts to the impulse response.
- Cancelling poles and zeros that do not quite cancel. Rounded coefficients can leave a near pole-zero pair that matters; keep exact arithmetic or check numerically.
- Assuming cascaded stages multiply. only holds when the second stage does not load the first.
Practice
- For the ladder, what is at ? (Use .)
- Find the impulse response of the ladder from the poles.
- A series RL with , is driven by . Find and its pole.
Answer
- : magnitude , phase .
- , residues and : .
- , one pole at ().
Test yourself
With zero initial conditions, the transfer function is…
- the output divided by the input, both transformed
- the impulse response in the time domain
- the input divided by the output
- the circuit's impedance at DC
The residue of at is…
Two identical RC stages connected directly have a slowest time constant of . Why is it longer than ?
- the second stage loads the first
- capacitors in series add
- the source resistance doubles
- it is a measurement error
A step response is found from by inverting…