Electrical and mechanical analogies
About this lesson
A cart on a spring and damper and a series RLC circuit look nothing alike, yet they obey the same second-order equation. Match the parts term by term (force to voltage, mass to inductance, damper to resistor, spring to one over capacitance), then switch both on and watch the cart's position and the capacitor's charge trace one curve.
A cart we already know
The cart from the lesson "Writing the equation of motion": 2 kg, a spring of 50 N/m and a damper of 4 N·s/m, pushed by a steady 10 N. Newton's second law gave its equation: 2ẍ + 4ẋ + 50x = 10.
cart m = 2 kg spring k = 50 N/m damper b = 4 N·s/m push F = 10 N from t = 0 m·ẍ + b·ẋ + k·x = F(t) 2ẍ + 4ẋ + 50x = 10 x = position (m), ẋ = velocity (m/s), ẍ = acceleration (m/s²)
Read the lesson step by step
A cart we already know
The cart from the lesson "Writing the equation of motion": 2 kg, a spring of 50 N/m and a damper of 4 N·s/m, pushed by a steady 10 N. Newton's second law gave its equation: 2ẍ + 4ẋ + 50x = 10.
cart m = 2 kg spring k = 50 N/m damper b = 4 N·s/m push F = 10 N from t = 0 m·ẍ + b·ẋ + k·x = F(t) 2ẍ + 4ẋ + 50x = 10 x = position (m), ẋ = velocity (m/s), ẍ = acceleration (m/s²)A circuit in one loop
Now a circuit: a 10 V source, a 4 Ω resistor, a 2 H inductor and a 20 mF capacitor in one loop. In a single loop the same current i flows through every part. Let q be the charge stored on the capacitor.
source v = 10 V from t = 0 resistor R = 4 Ω inductor L = 2 H capacitor C = 20 mF = 0.02 F one loop, so one current i (amps) q = charge on the capacitor (coulombs) i = dq/dt: current is charge per secondThe loop's own equation
Kirchhoff's voltage law: the voltages across the parts add up to the source. Resistor Ri, inductor L·di/dt, capacitor q/C. Write i as q̇: Lq̈ + Rq̇ + q/C = v(t). It has the same shape as the cart's equation.
vR + vL + vC = v (KVL) R·i + L·di/dt + q/C = v with i = q̇ and di/dt = q̈: L·q̈ + R·q̇ + (1/C)·q = v(t) cart: m·ẍ + b·ẋ + k ·x = F(t) loop: L·q̈ + R·q̇ + (1/C)·q = v(t)Push matches voltage
Line the two equations up term by term. The push F sits where the source voltage v sits: both are the input that drives the whole system. So the 10 N push becomes a 10 V source. This pairing is the force-voltage analogy.
mechanical electrical force F (N) ↔ voltage v (V) 10 N ↔ 10 V The input sits on the right of both equations.Mass matches inductance
Mass resists a change of speed: F = m·dẋ/dt. An inductor resists a change of current: v = L·di/dt. So velocity ẋ matches current i, and mass m matches inductance L: 2 kg becomes 2 H.
F = m·dẋ/dt ↔ v = L·di/dt velocity ẋ ↔ current i mass m ↔ inductance L 2 kg ↔ 2 H stored energy: ½·m·ẋ² ↔ ½·L·i²Damper matches resistor
A damper's force grows with speed, F = b·ẋ. A resistor's voltage grows with current, v = R·i. Both turn energy into heat and never give it back. So b matches R: 4 N·s/m becomes 4 Ω.
F = b·ẋ ↔ v = R·i damping b ↔ resistance R 4 N·s/m ↔ 4 Ω power lost as heat: b·ẋ² ↔ R·i²Spring matches capacitor
A spring's force grows with stretch, F = k·x. A capacitor's voltage grows with stored charge, v = q/C. So position x matches charge q, and k matches 1/C: k = 50 N/m becomes C = 1/50 = 0.02 F.
F = k·x ↔ v = q/C position x ↔ charge q stiffness k ↔ 1/C k = 50 N/m ↔ C = 1/50 = 0.02 F stored energy: ½·k·x² ↔ q²/(2C)One equation, one transfer function
Write y for x or q. With these values both equations read 2y'' + 4y' + 50y = 10, so both have the transfer function 1/(2s² + 4s + 50), with the same poles at s = −1 ± j4.9. Same poles, same motion.
cart: X(s)/F(s) = 1 / (2s² + 4s + 50) loop: Q(s)/V(s) = 1 / (2s² + 4s + 50) poles: 2s² + 4s + 50 = 0 s = −1 ± j4.9 (ωn = 5, ζ = 0.2) import control as ct G = ct.tf([1], [2, 4, 50]) print(G.poles()) # [-1.+4.89897949j -1.-4.89897949j]Switch both on
Push the cart and close the circuit at the same moment. The cart's position x and the capacitor's charge q trace one curve: both peak at 0.305 at 0.64 s, then settle at 0.2. Each force arrow has a matching voltage.
# one routine, two systems: a2·y'' + a1·y' + a0·y = u def peak(a2, a1, a0, u, dt=0.001): y = dy = top = 0.0 for n in range(6000): # 6 s ddy = (u - a1*dy - a0*y) / a2 dy = dy + ddy*dt y = y + dy*dt top = max(top, y) return round(top, 3) m, b, k, F = 2, 4, 50, 10 # cart L, R, C, V = 2, 4, 0.02, 10 # circuit print(peak(m, b, k, F), peak(L, R, 1/C, V)) # 0.305 0.305Speed matches current
Freeze at t = 0.28 s. The cart moves fastest, 0.76 m/s, and the ammeter reads 0.76 A. Spring 7.0 N matches capacitor 7.0 V; damper 3.0 N matches resistor 3.0 V. They add to 10, so the inductor's voltage is zero.
t = 0.28 s (fastest moment, ẍ = 0) ẋ = 0.76 m/s i = 0.76 A x = 0.14 m q = 0.14 C k·x = 7.0 N ↔ q/C = 7.0 V b·ẋ = 3.0 N ↔ R·i = 3.0 V m·ẍ = 0 N ↔ L·di/dt = 0 V sum = 10 = vWhy engineers use it
One set of tools now covers both worlds: a circuit simulator can test a machine, and a damped spring explains a circuit. A second pairing, the force-current analogy, matches mass to capacitance and the spring to inductance instead.
force-voltage (this lesson) force-current F ↔ v F ↔ i ẋ ↔ i ẋ ↔ v m ↔ L m ↔ C b ↔ R b ↔ 1/R k ↔ 1/C k ↔ 1/L series loop parallel nodes Both give the same equation; pick the one whose circuit is easier to draw.
5 quick questions
Choose one answer per question. You can change your choices before checking them.
01In the force-voltage analogy, which electrical part plays the role of the mass?
Mass resists a change of velocity (F = m·dẋ/dt); an inductor resists a change of current (v = L·di/dt). So m ↔ L.
02A spring has stiffness k = 50 N/m. What capacitance stands in for it in the force-voltage analogy?
Spring force k·x matches capacitor voltage q/C, so k ↔ 1/C and C = 1/50 = 0.02 F (20 mF).
03A series loop has a source v, a resistor R, an inductor L and a capacitor C. Writing the current as i = q̇, which equation does Kirchhoff's voltage law give?
The part voltages are L·di/dt = L·q̈, R·i = R·q̇ and q/C. In one loop they add up to the source: L·q̈ + R·q̇ + q/C = v.
04The cart (2ẍ + 4ẋ + 50x = 10) and the circuit (2q̈ + 4q̇ + 50q = 10) start at rest. The cart peaks at 0.305 m. What is the largest charge on the capacitor?
Same equation, same initial conditions, same solution: q(t) equals x(t) number for number, so q peaks at 0.305 C at 0.64 s.
05In the force-current analogy, what does the mass become?
Force-current pairs force with current and velocity with voltage, so the mass becomes a capacitor and the spring becomes an inductor, in a parallel circuit.
Glossary
- Analogous systems
- Two physical systems whose models are the same differential equation, so their responses are the same up to a change of units.
- Force-voltage analogy
- Pairs force with voltage and velocity with current: mass ↔ inductance, damping ↔ resistance, stiffness ↔ 1/capacitance. A series mechanical chain becomes a series loop.
- Force-current analogy
- Pairs force with current and velocity with voltage: mass ↔ capacitance, damping ↔ 1/resistance, stiffness ↔ 1/inductance. It gives a parallel circuit.
- Kirchhoff's voltage law (KVL)
- Round any closed loop, the voltage rises equal the voltage drops: the voltages, counted with their signs, sum to zero. With one source, the drops across the parts add up to the source voltage.
- Charge q
- The electric charge stored on the capacitor, in coulombs. Current is its rate of change: i = dq/dt.
- Inductor
- A coil that resists changes in current: its voltage is L·di/dt. Inductance L is in henries (H).
- Transfer function
- Output over input in the Laplace domain with zero initial conditions. Here X(s)/F(s) = Q(s)/V(s) = 1/(2s² + 4s + 50).
Notes and sources
- The values are illustrative: the cart (m = 2 kg, b = 4 N·s/m, k = 50 N/m, F = 10 N) and a circuit built to match it (L = 2 H, R = 4 Ω, C = 20 mF, v = 10 V). Every curve and number in the figure is the exact solution of the shared equation for these values.
- Both models are ideal: a linear spring, a purely viscous damper and no table friction; an ideal inductor with no winding resistance and an ideal capacitor with no leakage. The analogy is exact for the models, and only as good as the models for real parts.
- The Python runs one routine for both systems, stepping 1 ms at a time (semi-implicit Euler). Both print 0.305, the same peak the exact solution gives.
- The cart's equation comes from the lesson "Writing the equation of motion: springs, masses and dampers"; the circuit laws from the Circuits lessons "Capacitors: current, voltage and stored energy" and "Inductors and the magnetic field"; the Laplace step from "Circuit analysis with the Laplace transform". Poles on the s-plane are in "Poles and zeros on the s-plane".
- Under the force-current analogy the same cart becomes a parallel circuit: a current source, a capacitor for the mass, a conductance 1/R for the damper and an inductor for the spring, all across one pair of nodes (Nise §2.9; Swarthmore Linear Physical Systems Analysis).
- N. S. Nise, Control Systems Engineering, 8th ed., Wiley (§2.9 Electric Circuit Analogs)
- K. Ogata, Modern Control Engineering, 5th ed., Pearson (ch. 3, mechanical and electrical systems)
- G. F. Franklin, J. D. Powell, A. Emami-Naeini, Feedback Control of Dynamic Systems, 8th ed., Pearson (ch. 2, Dynamic models)
- Swarthmore College, Linear Physical Systems Analysis: Analogous electrical and mechanical systems
- MIT OpenCourseWare 16.06 Principles of Automatic Control (S. Hall)
- MIT OpenCourseWare 6.302 Feedback Systems (Roberge, Dawson, Lundberg)
- python-control: TransferFunction (tf, poles)
Quiz Unlocks after the last step.