SHM Displacement Calculator – x(t) = A cos(ωt + φ) Evaluator
Use this free SHM Displacement Calculator to evaluate the equation of motion x(t) = A cos(ωt + φ) at any instant — it gives the displacement, velocity and acceleration of an oscillator at the time t you choose.
The other SHM pages on this site deal in extremes: the period, the peak speed, the total energy. This one deals in moments. Give it the amplitude A, the period T, a phase constant φ and any instant t, and it evaluates the full equation of motion at that instant — where the oscillator is, how fast it is moving, and how hard it is accelerating, all three at once. It is the difference between knowing a train's top speed and reading its timetable: everything the oscillator will ever do is encoded in x(t) = A cos(ωt + φ), and this calculator reads it out second by second.
Three knobs set the whole story. A stretches the motion's size; ω = 2π/T sets its tempo; φ, the phase constant, sets where in its cycle the oscillator was when the clock started. That third knob is the one students underestimate. Two oscillators with identical A and T can be perfect opposites — one at its extreme while the other crosses the centre — differing only in φ. Phase is the oscillator's memory of how it was launched, and this page makes it a first-class input rather than an afterthought.
Differentiation does the rest, twice: v(t) = −Aω sin(ωt + φ) and a(t) = −Aω² cos(ωt + φ) = −ω²x(t). Note the economy of it — displacement is a cosine, velocity the same curve shifted a quarter cycle, acceleration the displacement curve flipped and scaled. One motion, three readings, all locked together; change any input and the calculator re-derives the trio instantly.
Formula
Displacement x = A cos(ωt + φ) • velocity v = −Aω sin(ωt + φ) • acceleration a = −ω²x • with ω = 2π/T; A in metres, t in seconds, angles in radians
The phase φ is fixed by the launch conditions: if the oscillator starts at displacement x0 with velocity v0, then A = √(x0² + (v0/ω)²) and tan φ = −v0/(ωx0). Released from rest at the extreme, v0 = 0 gives φ = 0 — the calculator's default and the commonest textbook case. Struck from the centre, x0 = 0 gives φ = −90°, and the cosine becomes a sine in disguise. A sine-based equation, x = A sin(ωt + φ′), describes the same family of motions with φ′ = φ + 90°; the choice between sine and cosine forms is bookkeeping, not physics — but mixing them mid-problem is a reliable source of sign errors.
| Symbol | Meaning | Units |
|---|---|---|
| x | displacement from equilibrium at time t | m |
| A | amplitude — maximum displacement | m |
| ω | angular frequency, ω = 2π/T | rad/s |
| t | time since the clock started | s |
| φ | phase constant — cycle position at t = 0 | rad (or °) |
| v, a | velocity and acceleration at time t | m/s, m/s² |
Phase: the oscillator's memory
Ask two identical oscillators the same question — where are you at t = 1 s? — and they can give opposite answers. The difference is φ. Phase compresses the entire launch history into one angle: released from the right extreme (φ = 0), released from the left (φ = 180°), flicked through the centre (φ = −90° or +90° depending on direction). At any later time the quantity ωt + φ, the total phase, locates the oscillator on its cycle with complete precision: phase modulo 360° is position on the reference circle, and every observable — x, v, a — is a projection of that single rotating angle.
This is why phase, not time, is the natural coordinate of oscillation physics. Coupled oscillators exchange energy according to their phase difference; resonant driving works when the push maintains the right phase against the velocity; noise-cancelling headphones synthesise a wave 180° out of phase with the intruder. In every case the amplitude and frequency get the headlines, but the phase does the deciding. The calculator's φ input is your handle on all of it.
A practical warning lives here too: calculators and formulas assume radians unless told otherwise. Entering φ = 90 intending degrees, into a radian formula, rotates the oscillator by 90 radians — more than fourteen full cycles — and the outputs become lottery numbers. Convert degrees to radians (multiply by π/180) before evaluating by hand, and when checking this page's results on a handheld calculator, confirm its angle mode first. More SHM answers are lost to the RAD/DEG toggle than to any physics.
Phase also wraps. φ and φ + 360° describe the identical launch, and a negative φ is just a head start measured the other way: φ = −90° and φ = +270° place the oscillator at the same point with the same velocity. When comparing phases from different sources, always reduce them to a common range — 0 to 360°, or −180° to +180° — before subtracting, or phantom full cycles sneak into the difference and masquerade as disagreements that the oscillators themselves know nothing about.
How to use
- Enter the amplitude A in metres and the period T in seconds.
- Enter the phase constant φ (use 0 for "released from rest at the positive extreme at t = 0").
- Enter the instant t you care about, in seconds.
- Read x, v and a at that instant — and sanity-check with a = −ω²x, which must hold exactly.
Worked examples
Example 1 — an eighth of a cycle in. A = 0.05 m, T = 2 s, t = 0.25 s, φ = 0:
ω = π = 3.14 rad/s and ωt = 0.785 rad (45°). x = 0.05 cos 45° = 0.0354 m; v = −0.05 × π × sin 45° = −0.11 m/s; a = −π² × 0.0354 = −0.35 m/s². The oscillator is past halfway out, moving back inward, accelerating inward.
Example 2 — the centre crossing. Same oscillator at t = 0.5 s (a quarter cycle): ωt = 90°, so x = 0 m; v = −0.05 × π = −0.157 m/s — the peak speed, negative because it travels in the −x direction; a = 0 m/s². All three signatures of the centre appear together.
Example 3 — the far extreme. Same oscillator at t = 1.0 s (half a cycle): ωt = 180°, so x = −0.05 m; v = 0 m/s; a = −π² × (−0.05) = +0.49 m/s² — peak acceleration, pointing back toward the centre, as it must.
Example 4 — launched with a phase. A = 0.1 m, T = 4 s, φ = +90°, at t = 1 s: ω = 1.57 rad/s, total phase = 1.57 × 1 + 1.57 = π (180°). x = 0.1 cos 180° = −0.1 m; v = 0 m/s; a = −2.47 × (−0.1) = +0.25 m/s². The head start of φ moved the far extreme a full second earlier than Example 3's timing.
Example 5 — a fast, small oscillator. A = 0.02 m, T = 0.5 s, t = 0.1 s, φ = 0: ω = 12.57 rad/s, ωt = 1.257 rad (72°). x = 0.02 cos 72° = 0.0062 m; v = −0.02 × 12.57 × sin 72° = −0.239 m/s; a = −157.91 × 0.0062 = −0.98 m/s².
Example 6 — started at the centre. A = 0.08 m, T = 1.6 s, φ = −90° (struck through the centre at t = 0), at t = 0.4 s: ω = 3.93 rad/s and the total phase is 1.57 − 1.57 = 0. x = 0.08 m — the first extreme, reached a quarter period after the strike; v = 0 m/s; a = −15.42 × 0.08 = −1.23 m/s².
Evaluating the motion in real life
Predicting a swing's position for a sensor. A photogate or camera trigger that must catch a pendulum bob at a chosen point needs the time that point occurs — invert the cosine, or evaluate forward with this calculator until x matches. Ride-control systems on cranes do this continuously to cancel load sway.
Cam and follower design. A cam converts rotation into a follower's x(t). Near-sinusoidal cams are chosen precisely because their v and a profiles are the smooth cosines of this page — peak acceleration sets the spring force that keeps the follower in contact.
Vibration isolation checks. Given a machine's A and T, evaluating x, v, a at the mount's worst instant verifies the isolator never bottoms out — a displacement question, not a maxima question.
Synchronising strobes and cameras. To freeze an oscillator at a chosen pose, flash the strobe at the t where the phase matches — the same calculation that places a timing light on an engine's flywheel mark.
Music synthesis. A pure tone is x(t) for air pressure. Layering tones with chosen phases builds timbre; the calculator's trio is the mathematics every synthesiser evaluates millions of times per second.
Medical ultrasound and imaging. Tissue interfaces oscillate under the probe's wave; knowing displacement and velocity at an instant underlies Doppler blood-flow estimates, where the velocity reading is the diagnosis.
Finding the instant instead: inverting the cosine
Half the practical questions run the equation backwards: not "where is it at t?" but "when is it at x?" The inversion is t = (arccos(x/A) − φ)/ω, with two solutions per cycle for every x strictly between −A and A — the oscillator passes each interior point twice, once in each direction, with velocities of opposite sign. The velocity's sign disambiguates: choose the arccos branch whose −sin is negative for outward-to-inward travel. At the extremes the two solutions merge into one instant per cycle, and outside [−A, A] there is no solution at all — the calculator's forward answers quietly encode all of this, since evaluating at a spread of t values maps the whole timetable.
Worked flavour: for Example 1's oscillator (A = 0.05 m, T = 2 s), when is x = +0.025 m? arccos(0.5) = 60° = 1.047 rad, so t = 1.047/π = 0.333 s on the way in, and by symmetry 2 − 0.333 = 1.667 s on the way back out — two answers, exactly as the two-passages rule demands. At the first instant the velocity is negative (inward), at the second positive (outward), with the same magnitude both times, ω√(A² − x²) = π × √(0.0025 − 0.000625) = 0.136 m/s — a complete description of both crossings from one inversion, obtained without solving anything twice.
Two oscillators: phase difference and beats
Put two oscillators side by side and their phase difference Δφ becomes the interesting quantity. Δφ = 0: they move as one, and side-by-side springs or pendulums reinforce each other's effect. Δφ = 180°: they mirror each other, cancelling — the principle behind active vibration cancellation and noise-cancelling headphones, which manufacture the anti-phase twin of an unwanted oscillation. In between, every shade of partial agreement exists, and coupled systems — two pendulums on a shared string, say — spontaneously evolve their Δφ, handing energy back and forth.
If the two oscillators differ slightly in frequency, Δφ itself drifts steadily, and the sum of their motions swells and fades in the phenomenon called beats. Piano tuners live by it: two strings meant to agree produce beats at the difference of their frequencies, and the tuner adjusts until the beats vanish — phase arithmetic done by ear. This calculator supplies the raw material for all of it: evaluate both motions at the same t and compare.
Reading a real trace back into A, ω and φ
Experimental traces arrive as wiggles; the equation turns them back into numbers. The amplitude is half the peak-to-peak height. The period is the spacing of matching peaks. The phase falls out of any single trusted instant: if the trace crosses zero heading downward at t = 0.3 s, then ω × 0.3 + φ = 90°, and φ follows by subtraction. Motion-capture software and oscilloscopes automate exactly this fit, reporting A, f and φ for everything from a trembling bridge cable to a patient's tremor. When the fitted φ jumps between sessions while A and f hold steady, the system's launch conditions changed; when f itself drifts, the underlying stiffness or mass is changing — the equation is a diagnostic instrument, not just a predictor.
Quick reference: one cycle, eighth by eighth (φ = 0)
| t / T | x | v | a |
|---|---|---|---|
| 0 | +A | 0 | −ω²A |
| 1/8 | +0.71A | −0.71Aω | −0.71ω²A |
| 1/4 | 0 | −Aω | 0 |
| 3/8 | −0.71A | −0.71Aω | +0.71ω²A |
| 1/2 | −A | 0 | +ω²A |
| 3/4 | 0 | +Aω | 0 |
| 1 | +A | 0 | −ω²A |
Every row is a fingerprint check for the calculator: at any eighth of a cycle, the three outputs must sit on this pattern scaled by your A and ω. If a result breaks the pattern — nonzero v at an extreme, say — an input, most often the phase or the angle mode, has slipped.
Common mistakes
- Degrees in a radian formula. ωt must be in radians when ω is in rad/s. A phase entered as "90" instead of π/2 destroys the result completely — the commonest failure with this calculator.
- Guessing φ instead of deriving it. φ is fixed by the launch: from rest at +A means φ = 0; through the centre means φ = ±90°. A wrong φ shifts every answer in time.
- Dropping the minus sign in v. v = −Aω sin(ωt + φ). With φ = 0 and small t, the mass released from +A moves in the −x direction — a positive v at that instant signals a lost sign.
- Expecting a to point along the motion. Acceleration opposes displacement (a = −ω²x), so while the mass travels outward its acceleration already points homeward.
- Using T where ω belongs. The argument is ωt = 2πt/T. Entering t/T as the cosine's argument shrinks the phase by 2π and reports the oscillator nearly where it started.
FAQ
What does a negative velocity mean here?
It means the object is moving in the negative x direction — back toward (or past) the centre — at that instant.
Why is the acceleration always opposite to x?
Because a = −ω²x: the restoring force always pulls toward the centre, so acceleration points opposite to the displacement.
What phase constant starts the object at the centre?
φ = −90° (or 270°) gives x(0) = A cos(−90°) = 0, with the object moving at maximum speed.
How do I find A and φ from a real launch?
From the starting position x0 and velocity v0: A = √(x0² + (v0/ω)²) and tan φ = −v0/(ωx0), choosing the quadrant that matches the signs of x0 and v0.
Can t be larger than the period?
Yes — the motion repeats every T, so t = 7.3 s with T = 2 s behaves exactly like t = 1.3 s. The cosine handles the wrapping automatically.
Why does the calculator need φ in radians?
Because ω is in radians per second, ωt is in radians, and φ must share the unit to be added to it. Degrees must be converted (× π/180) first.
What is the displacement after exactly one period?
Identical to the start: x(T) = A cos(2π + φ) = x(0). Periodicity is built into the cosine.
How is this related to circular motion?
x(t) is the projection of uniform circular motion onto a diameter — the reference circle. The calculator evaluates the shadow of a point circling at ω with starting angle φ.
Does damping change the equation?
Yes: a factor e^(−βt) multiplies the amplitude, so A slowly shrinks and the period lengthens slightly. For light damping over a few cycles, this calculator's undamped answers stay accurate.
Can I evaluate velocity without the displacement formula?
At a known position, v = ±ω√(A² − x²) gives the speed directly; the sign is chosen by the direction of travel. The full time evaluation on this page resolves the sign for you.