Computational example Julia
Damped Harmonic Motion
From sustained oscillation to a slow return to equilibrium.
m x″ + c x′ + k x = 0
m = 1 kg · k = 4 N/m · x(0) = 1 m · v(0) = 0 m/s
Underdamped
c = 0.8 N s/m
The mass crosses equilibrium as its oscillation decays.
Displacement (m)
- Time
- 0.00 s
- Displacement
- 1.000 m
- Velocity
- 0.000 m/s
- Energy
- 2.000 J
21 saved Julia cases · 0.08 s sampling
Download selected case (CSV)Three reference presets
The Three Regimes Together
Damping removes mechanical energy. More damping does not always mean a faster return: the overdamped mass takes longer to approach equilibrium than the critically damped mass for this release from rest.

Reproduce the Result
The Julia project contains the calculation, preset inputs, tests, environment manifest, and CSV results.
Download Julia project @@ZIP_SIZE@@Published results · Julia @@JULIA_VERSION@@ · 601 samples per preset
Method and Assumptions
The state is evaluated as exp(tA)u(0) with Julia's standard-library matrix exponential. The model assumes a linear spring and viscous damping, with no driving force.
Independent analytic solutions check all three regimes. Mechanical energy, E = (m v² + k x²)/2, must decrease or remain constant.
These are saved calculations. Selecting a preset does not run code on the server.
Calculation provenance