Two systems
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.
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.
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.
Matching the parts
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.
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.
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 Ω.
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.
One answer
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.
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.
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.
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.
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.