4 Ω2 H20 mFx = 00.10.20.3mq = 00.10.20.3C10 V0.00 Aoilm = 2 kg
01234560.00.10.20.3time (s)x (m)CART POSITION x(t)x, cartsettles at 0.2 mpeak 0.305 m01234560.00.10.20.3time (s)q (C)CAPACITOR CHARGE q(t)q, circuitsettles at 0.2 Cpeak 0.305 C
Back row: wall, spring, oil damper, cart and the ruler for xFront row: a series loop of source, resistor, inductor, capacitor and ammeter, with a gauge for the charge qPlots: x(t) and q(t), each the exact solution of the same equationArrows and tags: each force on the cart and its matching voltage in the loopA 2 kg cart with a spring and a damper, and a series RLC circuit built to match it. Under the force-voltage analogy (force ↔ voltage, velocity ↔ current, m ↔ L, b ↔ R, k ↔ 1/C) both obey 2y'' + 4y' + 50y = 10, so the cart's position and the capacitor's charge follow one curve. 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.

Two systems

  1. 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.

Matching the parts

One answer

What is happening

# step 1/11 · cart
# about: Wall (fixed), Cart m = 2 kg, Spring k = 50 N/m, Damper b = 4 N·s/m, Push F = 10 N

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²)

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. 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.