Ph · Physics

How Do You Apply Initial Conditions to Simple Harmonic Motion?

Published By the 9to5Science editorial team

At a glance

  1. 1. Write the equation

    For ideal simple harmonic motion, use acceleration equal to minus omega squared times displacement.

  2. 2. Use the general solution

    Express displacement as a cosine term plus a sine term, with two constants to determine.

  3. 3. Apply both conditions

    Substitute the initial position and velocity to find the two constants.

  4. 4. Check the result

    Differentiate the displacement and verify that it gives the specified initial velocity.

To determine a simple harmonic motion trajectory, you need the oscillator’s angular frequency and its initial position and velocity. The initial position sets where the motion starts; the initial velocity sets which way it is moving and how much of the oscillation is in the sine component.

The most direct method is to use a sine-and-cosine form of the solution. This avoids ambiguity about the phase angle and works for any initial position and velocity.

Start from the equation of motion

For an ideal oscillator, displacement xx from equilibrium satisfies

x¨+ω2x=0,\ddot{x}+\omega^2x=0,

where ω>0\omega>0 is the angular frequency, measured in radians per unit time. For a mass mm attached to a spring of stiffness kk, ω=k/m\omega=\sqrt{k/m}.

A general solution is

x(t)=Ccos⁡(ωt)+Dsin⁡(ωt),x(t)=C\cos(\omega t)+D\sin(\omega t),

where CC and DD are constants. There are two constants because the equation is second order, so you need two independent initial conditions to specify one particular motion.

Apply the initial conditions

Suppose the initial conditions are given at t=0t=0:

x(0)=x0,x˙(0)=v0.x(0)=x_0,\qquad \dot{x}(0)=v_0.

First evaluate the displacement at zero. Since cos⁡(0)=1\cos(0)=1 and sin⁡(0)=0\sin(0)=0,

x(0)=C=x0.x(0)=C=x_0.

Now differentiate to find velocity:

x˙(t)=−Cωsin⁡(ωt)+Dωcos⁡(ωt).\dot{x}(t)=-C\omega\sin(\omega t)+D\omega\cos(\omega t).

At t=0t=0, this becomes x˙(0)=Dω=v0\dot{x}(0)=D\omega=v_0, so D=v0/ωD=v_0/\omega. Therefore,

x(t)=x0cos⁡(ωt)+v0ωsin⁡(ωt).\boxed{x(t)=x_0\cos(\omega t)+\frac{v_0}{\omega}\sin(\omega t)}.

This form is often the easiest one to use: insert the measured or stated initial position and velocity directly.

Worked example

A particle oscillates with angular frequency ω=4 rad/s\omega=4\ \text{rad/s}. At t=0t=0, it is 0.030 m0.030\ \text{m} to the right of equilibrium and moving left at 0.080 m/s0.080\ \text{m/s}. Thus x0=0.030 mx_0=0.030\ \text{m} and v0=−0.080 m/sv_0=-0.080\ \text{m/s}. Substituting gives

x(t)=0.030cos⁡(4t)+−0.0804sin⁡(4t)=0.030cos⁡(4t)−0.020sin⁡(4t)m.\begin{aligned} x(t)&=0.030\cos(4t)+\frac{-0.080}{4}\sin(4t)\\ &=0.030\cos(4t)-0.020\sin(4t)\quad\text{m}. \end{aligned}

The negative sine coefficient represents the initial motion to the left. Check the initial values:

x(0)=0.030 m,x˙(0)=−4(0.020)=−0.080 m/s.x(0)=0.030\ \text{m},\qquad \dot{x}(0)=-4(0.020)=-0.080\ \text{m/s}.

The same trajectory can be written as a single cosine, x(t)=Acos⁡(ωt+ϕ)x(t)=A\cos(\omega t+\phi). Comparing coefficients, or using the initial conditions, gives

A=x02+(v0ω)2=(0.030)2+(0.020)2≈0.0361 m.A=\sqrt{x_0^2+\left(\frac{v_0}{\omega}\right)^2} =\sqrt{(0.030)^2+(0.020)^2}\approx 0.0361\ \text{m}.

For this cosine-plus-phase convention, ϕ=atan2⁡(−v0/ω,x0)\phi=\operatorname{atan2}(-v_0/\omega,x_0). Here ϕ≈0.588 rad\phi\approx0.588\ \text{rad}, so an equivalent expression is x(t)=0.0361cos⁡(4t+0.588) mx(t)=0.0361\cos(4t+0.588)\ \text{m}. The function atan2⁡(y,x)\operatorname{atan2}(y,x) uses both inputs to select the correct quadrant; this matters when the initial position or velocity is negative.

If the initial time is not zero

If the conditions are specified at time t=t0t=t_0, use elapsed time t−t0t-t_0:

x(t)=x0cos⁡(ω(t−t0))+v0ωsin⁡(ω(t−t0)),x(t)=x_0\cos\bigl(\omega(t-t_0)\bigr)+\frac{v_0}{\omega}\sin\bigl(\omega(t-t_0)\bigr),

where x0=x(t0)x_0=x(t_0) and v0=x˙(t0)v_0=\dot{x}(t_0). This ensures that substituting t=t0t=t_0 returns the stated position and velocity.

Common mistakes

  • Using position alone: Knowing x0x_0 does not usually fix the motion. At the same position, the oscillator could be moving in either direction or momentarily at rest. You also need v0v_0.
  • Forgetting the factor of ω\omega: The sine coefficient is v0/ωv_0/\omega, not v0v_0. This is necessary because differentiating a sine term introduces a factor of ω\omega.
  • Mixing phase conventions: For Acos⁡(ωt+ϕ)A\cos(\omega t+\phi), the initial velocity is −Aωsin⁡ϕ-A\omega\sin\phi. Changing the plus sign in the phase to a minus sign changes the phase relationship.
  • Using frequency in hertz as angular frequency: If a frequency ff is given in cycles per second, convert it using ω=2πf\omega=2\pi f before using these formulas.
  • Confusing displacement with absolute position: In the oscillator equation, xx is measured from the equilibrium position. If the equilibrium is at a nonzero coordinate, shift coordinates before applying the formula.

The result assumes ideal, undamped simple harmonic motion with constant angular frequency. Damping, a driving force, or a nonlinear restoring force changes the governing equation and generally changes the solution.

References

  1. Fundamentals of Physics, Halliday, Resnick, and Walker

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.