Interactive Mass-Spring-Damper System

Visualize and explore how damping, mass, and stiffness shape system dynamics

The Physical System

The equation of motion for a mass attached to a spring with damping is:

$$m\,y'' + c\,y' + k\,y = F(t)$$

where:

Key Decomposition

The total solution splits into two complementary parts:

yc (Complementary/Natural Response): How the system vibrates on its own, determined solely by m, c, and k. This is the solution to the homogeneous equation my'' + cy' + ky = 0.

yp (Particular/Forced Response): How the system responds to the external input F(t). This depends on the forcing function.

Total Solution: y(t) = yc(t) + yp(t)

Live Mass-Spring-Damper Animation

Watch the physical system move in real time. Adjust parameters, then press Play to see the mass oscillate, with force arrows and a live displacement trace.

1.0 kg
1.0 N·s/m
4.0 N/m
1.5 m
1.0x
Physical System
t = 0.00 s
Displacement & Forces vs Time
Real-Time Force Magnitudes
Spring (Fs)
0.0 N Damping (Fd)
0.0 N External (Fe)
0.0 N
Underdamped — ζ = 0.250 — ωn = 2.00 rad/s

Interactive Simulator

1.0 kg
1.0 N·s/m
4.0 N/m

Initial Conditions

1.0 m
0.0 m/s

Position vs Time

Phase Portrait (Velocity vs Position)

System Behavior Classification

The system's response is determined by the discriminant D = c² − 4mk:

Underdamped System

Characteristic Equation: mr² + cr + k = 0

The system oscillates with decreasing amplitude. Like a guitar string after being plucked.

Natural Frequency: ωn = 2.0 rad/s

Damping Ratio: ζ = 0.25

Worked Examples

Example 1 (Overdamped): $m = 1$, $c = 4$, $k = 3$, $x(0) = 1$, $x'(0) = 0$

Solution

Step 1: Write the equation of motion.

$$mx'' + cx' + kx = 0 \quad \Longrightarrow \quad x'' + 4x' + 3x = 0$$

Step 2: Form and solve the characteristic equation.

$$r^2 + 4r + 3 = (r+1)(r+3) = 0 \quad \Longrightarrow \quad r_1 = -1,\ r_2 = -3$$

Step 3: Classify. The discriminant is $c^2 - 4mk = 16 - 12 = 4 > 0$, so the system is overdamped: two distinct negative real roots, no oscillation.

Step 4: General solution.

$$x(t) = c_1 e^{-t} + c_2 e^{-3t}$$

Step 5: Apply the initial conditions.

$$x(0) = c_1 + c_2 = 1$$ $$x'(t) = -c_1 e^{-t} - 3c_2 e^{-3t} \quad \Longrightarrow \quad x'(0) = -c_1 - 3c_2 = 0$$

From the second equation $c_1 = -3c_2$; substituting into the first gives $-3c_2 + c_2 = 1$, so $c_2 = -\tfrac{1}{2}$ and $c_1 = \tfrac{3}{2}$.

Final Solution:

$$\boxed{x(t) = \frac{3}{2}e^{-t} - \frac{1}{2}e^{-3t}}$$
Check: $x(0) = \tfrac{3}{2} - \tfrac{1}{2} = 1$ ✓ and $x'(0) = -\tfrac{3}{2} + \tfrac{3}{2} = 0$ ✓. The mass creeps back to equilibrium without ever crossing it — the signature of an overdamped system.
Example 2 (Underdamped): $m = 1$, $c = 4$, $k = 20$, $x(0) = 0$, $x'(0) = 8$

Solution

Step 1: Equation of motion and characteristic equation.

$$x'' + 4x' + 20x = 0 \quad \Longrightarrow \quad r^2 + 4r + 20 = 0$$

Step 2: Solve for the roots.

$$r = \frac{-4 \pm \sqrt{16 - 80}}{2} = \frac{-4 \pm \sqrt{-64}}{2} = -2 \pm 4i$$

Step 3: Classify. Since $c^2 - 4mk = 16 - 80 = -64 < 0$, the system is underdamped. The decay rate is $\alpha = 2$ and the quasi-frequency is $\mu = 4$ rad/s.

Step 4: General solution.

$$x(t) = e^{-2t}\big(c_1\cos(4t) + c_2\sin(4t)\big)$$

Step 5: Apply $x(0) = 0$.

$$x(0) = c_1 = 0 \quad \Longrightarrow \quad x(t) = c_2 e^{-2t}\sin(4t)$$

Step 6: Apply $x'(0) = 8$.

$$x'(t) = c_2\big(-2e^{-2t}\sin(4t) + 4e^{-2t}\cos(4t)\big) \quad \Longrightarrow \quad x'(0) = 4c_2 = 8$$ $$c_2 = 2$$

Final Solution:

$$\boxed{x(t) = 2e^{-2t}\sin(4t)}$$
Physical reading: the mass oscillates with quasi-period $T_d = \dfrac{2\pi}{\mu} = \dfrac{\pi}{2}$ seconds inside the decaying envelope $\pm 2e^{-2t}$.
Example 3 (Critically Damped): $m = 1$, $c = 4$, $k = 4$, $x(0) = 2$, $x'(0) = 0$

Solution

Step 1: Characteristic equation.

$$x'' + 4x' + 4x = 0 \quad \Longrightarrow \quad r^2 + 4r + 4 = (r+2)^2 = 0$$

Step 2: Repeated root. $r = -2$ (double), because $c^2 - 4mk = 16 - 16 = 0$. This is exactly critical damping: $c = c_{cr} = 2\sqrt{mk} = 4$.

Step 3: General solution for a repeated root.

$$x(t) = (c_1 + c_2 t)e^{-2t}$$

Step 4: Apply the initial conditions.

$$x(0) = c_1 = 2$$ $$x'(t) = c_2 e^{-2t} - 2(c_1 + c_2 t)e^{-2t} \quad \Longrightarrow \quad x'(0) = c_2 - 2c_1 = 0$$ $$c_2 = 2c_1 = 4$$

Final Solution:

$$\boxed{x(t) = (2 + 4t)e^{-2t}}$$
Why engineers care: critical damping returns the mass to equilibrium in the shortest time without overshoot. Reduce $c$ by even a little and the response oscillates; increase it and the return becomes sluggish.
Example 4 (Undamped Resonance): $x'' + 4x = 3\cos(2t)$, $x(0) = 0$, $x'(0) = 0$

Solution

Step 1: Find the complementary solution.

$$r^2 + 4 = 0 \quad \Longrightarrow \quad r = \pm 2i \quad \Longrightarrow \quad x_c(t) = c_1\cos(2t) + c_2\sin(2t)$$

The natural frequency is $\omega_n = 2$ rad/s — and the forcing frequency is also $2$ rad/s. This is pure resonance.

Step 2: Choose the trial form (multiply by $t$). Because $\cos(2t)$ already appears in $x_c$, we must use

$$x_p(t) = t\big(A\cos(2t) + B\sin(2t)\big)$$

Step 3: Substitute. Differentiating twice and simplifying gives

$$x_p'' + 4x_p = -4A\sin(2t) + 4B\cos(2t)$$

Step 4: Match coefficients with $3\cos(2t)$.

$$-4A = 0,\qquad 4B = 3 \quad \Longrightarrow \quad A = 0,\ B = \frac{3}{4}$$ $$x_p(t) = \frac{3}{4}t\sin(2t)$$

Step 5: Apply the initial conditions to $x = x_c + x_p$.

$$x(0) = c_1 = 0$$ $$x'(t) = 2c_2\cos(2t) + \frac{3}{4}\big(\sin(2t) + 2t\cos(2t)\big) \quad \Longrightarrow \quad x'(0) = 2c_2 = 0$$

Final Solution:

$$\boxed{x(t) = \frac{3}{4}t\sin(2t)}$$
Resonance: the amplitude $\tfrac{3}{4}t$ grows without bound. With no damping, forcing a system at its natural frequency destroys it — this is the mechanism behind the Tacoma Narrows and Broughton Bridge failures.

📝 Exam-Style Practice Problems

These problems are similar in style and difficulty to past exam questions. Click each problem to reveal the step-by-step solution.

Practice 1: Free system with $m=2, c=8, k=8$ — classify and solve

Solution

Step 1: Form the characteristic equation. For $mx(t)'' + cx'(t) + kx(t) = 0$:

$$2r^2 + 8r + 8 = 0 \quad \Rightarrow \quad r^2 + 4r + 4 = 0$$

Step 2: Factor and find roots.

$$(r+2)^2 = 0 \quad \Rightarrow \quad r = -2 \text{ (repeated)}$$

Step 3: Classify the damping. Check the discriminant: $D = c^2 - 4mk = 64 - 64 = 0$. Since $D = 0$, this is critically damped.

Step 4: Interpret the classification. The damping coefficient $\zeta = \dfrac{c}{2\sqrt{mk}} = \dfrac{8}{2\sqrt{2 \cdot 8}} = \dfrac{8}{8} = 1$. When $\zeta = 1$, the system is critically damped — it returns to equilibrium as quickly as possible without oscillating.

Step 5: General solution. For a repeated root $r_0 = -2$:

$$\boxed{x(t) = (c_1 + c_2 t)e^{-2t}}$$

The term $(c_1 + c_2 t)$ decays exponentially as $e^{-2t}$, ensuring the system settles without bouncing.

Practice 2: Underdamped IVP with $m=1, c=2, k=5$; $x(0)=1, x'(0)=0$

Solution

Step 1: Form the characteristic equation.

$$r^2 + 2r + 5 = 0$$

Step 2: Use the quadratic formula.

$$r = \frac{-2 \pm \sqrt{4-20}}{2} = \frac{-2 \pm \sqrt{-16}}{2} = \frac{-2 \pm 4i}{2} = -1 \pm 2i$$

Step 3: Classify the damping. The discriminant is $D = c^2 - 4mk = 4 - 20 = -16 < 0$. This is underdamped ($\zeta = \dfrac{2}{2\sqrt{5}} \approx 0.447 < 1$). The system oscillates with decreasing amplitude.

Step 4: General solution. From $r = -1 \pm 2i$, we have $\alpha = -1$ and $\beta = 2$:

$$x(t) = e^{-t}(c_1\cos(2t) + c_2\sin(2t))$$

Step 5: Apply initial condition $x(0) = 1$.

$$1 = e^0(c_1\cos 0 + c_2\sin 0) = c_1 \quad \Rightarrow \quad c_1 = 1$$

Step 6: Find the derivative.

$$x'(t) = -e^{-t}(c_1\cos(2t) + c_2\sin(2t)) + e^{-t}(-2c_1\sin(2t) + 2c_2\cos(2t))$$

Step 7: Apply initial condition $x'(0) = 0$.

$$0 = -e^0(c_1 + 0) + e^0(0 + 2c_2) = -c_1 + 2c_2 = -1 + 2c_2$$
$$c_2 = \frac{1}{2}$$

Step 8: Particular solution.

$$\boxed{x(t) = e^{-t}\left(\cos(2t) + \frac{1}{2}\sin(2t)\right)}$$

The exponential envelope $e^{-t}$ damps the oscillation at frequency $\beta = 2$ rad/s. As $t \to \infty$, $x(t) \to 0$.

Practice Problems

Test your understanding with these multiple-choice questions. Click a choice to see if you're correct.

Q1: A mass-spring-damper has $m = 1$ kg, $c = 6$ N·s/m, $k = 8$ N/m. How does it behave?

Q2: For an undamped system with $m = 4$ kg and $k = 36$ N/m, what is the natural frequency $\omega_n$?

Q3: A system has $m = 1$ kg, $c = 4$ N·s/m, $k = 16$ N/m. What is the damping ratio $\zeta = \dfrac{c}{2\sqrt{mk}}$?

Q4: For the undamped forced system $x'' + 9x = 2\cos(3t)$, what is the correct trial form for $x_p$?

Q5: For $m = 2$ kg and $k = 50$ N/m, what damping constant $c$ makes the system critically damped?

Q6: A free system with $m = 1$, $c = 2$, $k = 10$ has roots $r = -1 \pm 3i$. What is the quasi-period of the oscillation?

Real-World Examples

Car Suspension

Critically damped suspensions provide the smoothest ride—the car returns to level without bouncing. Too much damping makes it feel stiff; too little makes it bouncy.

Building During Earthquake

Tall buildings act as damped oscillators. Engineers must understand resonance—when the earthquake frequency matches the building's natural frequency, amplification occurs.

Speaker Cone

A speaker cone is a driven damped oscillator. The forcing is the electrical signal; the response is sound. Proper damping prevents distortion.

Door Closer

A critically damped door closer closes smoothly without slamming or bouncing. Adjust the damping coefficient to control closure speed.

Connection to Chapter 2 Topics

How It All Fits Together

Section 2.1 (Homogeneous DEs): You learned to find yc, the natural response determined by the characteristic equation mr² + cr + k = 0. The three cases (overdamped, critically damped, underdamped) directly correspond to the three cases of the discriminant.

Section 2.2 (Undetermined Coefficients): You learned to find yp for common forcing functions like constants and sinusoids. Use the method based on the form of F(t).

Here: You see both working together in real time. The sliders let you explore how changes in m, c, and k affect the natural response, and how different forcing functions shape the forced response. The visualization makes the theory come alive.

Key Takeaways