This tool simulates a mass hanging from a spring, with a damper (dashpot) resisting its motion and an optional external force pushing on it. Its motion follows the ODE below, where y is the displacement from the hanging equilibrium at time t, y′ is the velocity, y″ is the acceleration, m, b and k are the mass, damping and stiffness parameters, and f(t) is an external forcing function you choose from a family of common functions.
Set the parameters and the forcing, then watch the motion, the position–velocity phase portrait, and the time series move together. Gravity does not appear in the equation because y is measured from the point where the spring already balances the weight (see Physics & Mathematics).
The phase portrait is shown only when the equation is autonomous, that is, when the external force does not change with (no forcing, or a constant force).
With the current , the direction field changes from moment to moment, so a single – portrait does not describe the motion. Follow it in the time series instead.
The motion of a vertical spring–mass–damper is modeled by a 2nd-order linear ODE. It comes from Newton's second law applied to the net force on the mass: gravity, the spring's restoring force from Hooke's law, a damping force proportional to velocity, and the external force . With upward taken as positive,
Here is how far the weight stretches the spring when the mass hangs at rest, so . Those two forces cancel exactly, which is why drops out once is measured from the hanging equilibrium rather than from the spring's natural length. Without forcing, the equation is homogeneous and behaves exactly like the horizontal spring–mass system.
With forcing, every solution is a homogeneous solution plus one particular solution:
The homogeneous part solves and carries the two constants and , which the initial conditions set. Its two building blocks and are listed in the four-cases table in the next section. The particular part is any one solution of the full equation and has no free constants. The next two sections find each part in turn.
When , both characteristic roots have negative real part, so decays to zero and approaches . For periodic forcing, is therefore called the steady state. In the time series, the "show " and "show " options overlay each part on the displacement plot, and at every moment the two add up to . When , never decays, so the natural oscillation stays mixed in with the forced one.
Without forcing the equation is . Because it is linear with constant coefficients, look for solutions of the form . Substituting gives , and since is never zero, must solve the characteristic equation
The quadratic formula gives its roots. Their two terms are worth naming, because they reappear in every case below:
When , the square root is imaginary, , which is where the form comes from.
Dividing by puts the characteristic equation in standard form, which defines the natural frequency and the damping ratio :
Because the leading coefficient is now 1, the product and the sum of the roots give both of them back:
For complex roots , this means , the distance of the roots from the origin in the complex plane, and . For real roots, is the arithmetic mean of and divided by their geometric mean, so , with equality only when the two roots coincide.
The sign of the discriminant , or equivalently whether is less than, equal to, or greater than 1, decides the case. The two roots are the values listed as eigenvalues in the Signatures panel, and the case name there matches the table below. Each parameter preset puts the system in one of these cases.
| Case | Condition | Roots | Motion | |
|---|---|---|---|---|
| Undamped | Oscillates forever with constant amplitude and period . | |||
| Underdamped | Oscillates inside the decaying envelope , with quasi-period , longer than the undamped period. | |||
| Critically damped | (repeated) | No oscillation, and it crosses equilibrium at most once. This is the fastest return to rest without oscillating for a given and . | ||
| Overdamped | , both negative | No oscillation, and it crosses equilibrium at most once. The return gets slower as grows, because moves toward 0. |
Here is the repeated root, and , with the root closer to zero.
There are two standard methods for finding .
This method applies when is a polynomial, an exponential, a sine or cosine, or sums and products of these. Take the trial form listed for your forcing in the forcing-family table below, substitute it into , and solve for its coefficients. If the trial form already solves the homogeneous equation, multiply it by . For example, with and the trial form is itself a homogeneous solution, so becomes . That is pure resonance, and it is the case the page flags.
This method works for any continuous . The formula needs a leading coefficient of 1, so divide the equation by first, which makes the forcing . With and from the homogeneous solution,
Integrate and to get and . The Wronskian is never zero, and for each case it is
| Case | |||
|---|---|---|---|
| Undamped | |||
| Underdamped | |||
| Critically damped | |||
| Overdamped |
Variation of parameters handles forcings that have no trial form, such as the square and sawtooth waves, at the cost of two integrals. When a trial form exists, undetermined coefficients is usually faster.
A step or a pulse is constant on each time interval, so on each interval while the force is on and 0 while it is off. At each switch, and carry over continuously, and and are found again from those values. An impulse delivers momentum instantly, so stays continuous but jumps:
After the strike the motion is free, starting from that new velocity.
Let and , with and . Transforming the equation turns it into algebra in Y:
The first term comes from the initial conditions alone. Its inverse transform is the free motion that starts from and , which is a homogeneous solution. The second term comes from the forcing alone, with the mass starting at rest. Both terms share the denominator , the characteristic polynomial with in place of , so its zeros, the poles of , are exactly the characteristic roots. For the first term, partial fractions and the inverse transform give each of the four cases directly, with the constants already fixed by the initial conditions:
| Case | Condition and roots | Denominator | Partial fractions | Free motion |
|---|---|---|---|---|
| Undamped | ||||
| Underdamped | ||||
| Critically damped | ||||
| Overdamped |
Completing the square in the underdamped denominator is what produces the shift , and the first shifting theorem turns that shift into the envelope . A repeated pole gives , whose inverse transform is , which is where the extra factor of in the critically damped case comes from.
The forcing term works the same way once from the forcing-family table is multiplied in. Its denominator then also contains the poles of , and those poles produce . When a pole of lands on a characteristic root, that pole becomes repeated. This is the Laplace view of the multiply-by- rule for resonance.
Laplace transforms are especially convenient for switched forcing. The second shifting theorem,
turns a delay into the factor . That is why the step, pulse and impulse in the forcing-family table have such simple transforms, and why the response to a force switched on at is the response to the same force switched on at 0, shifted to start at . For the impulse from rest, , the impulse response of the system.
Trial forms use undetermined coefficients and . If a trial form already solves the homogeneous equation, multiply it by . The square and sawtooth waves have no finite trial form, so use their Fourier series term by term, variation of parameters, or the Laplace transform.
| Name | Parameters | Trial form of |
|---|
For sinusoidal forcing, or , with , the homogeneous part dies out and the mass oscillates at the forcing frequency with steady-state amplitude and phase lag :
is largest where the expression under the square root is smallest. Setting its derivative with respect to equal to zero gives
This is the practical resonance frequency. It exists only when , that is . For heavier damping, decreases steadily from = 0 and there is no practical resonance. With no damping, = and is unbounded there, which is pure resonance.