Undamped oscillations of a mass-spring system

A mass of $m$ is attached to a linear spring with a spring constant $k$. The force on the mass is given by Hooke's law, $F=-kx$. If the mass is given a push, it executes oscillations of the form $x(t) = A\cos (\omega t)$. Here $A$ is the amplitude of the motion and $\omega$ is the angular frequency. Newton's law for this case can be written as a differential equation,

$$ m\frac{d^2x}{dt^2} + kx = 0.$$

Substituting $x(t)$ into the differential equation yields,

$$ -m\omega^2A\cos(\omega t) + kA\cos(\omega t) = 0.$$

Thus the angular frequency is,

$$\omega^2= \frac{k}{m}.$$

Since there is no damping, the amplitude of the oscillations will not decrease with time. The energy of the system stays constant. The kinetic energy of the mass will be converted to potential energy stored in the spring and that will get converted back to kinetic energy of the mass. For the initial conditions $x(t=0) = x_0$, $v_x(t=0) = v_{x0}$, the solution is,

$$x(t) = x_0\cos (\omega t) +\frac{v_{x0}}{\omega}\sin (\omega t).$$

To visualize the motion, the equations are loaded into the numerical second order differential equation solver below.

$k=$ 0.2 [N/m]

$m=$ 0.4 [kg]

The angular frequency is $\omega=\sqrt{\frac{k}{m}}=$ 0.707 rad/s. The period of the oscillations is $T=2\pi/\omega =$ 8.89 s.

 Numerical 2nd order differential equation solver 

$ \large \frac{dx}{dt}=$

$v_x$

$ \large a_x=\frac{F_x}{m}=\frac{dv_x}{dt}=$

Intitial conditions:

$x(t_0)=$

$\Delta t=$

$v_x(t_0)=$

$N_{steps}$

$t_0=$

Plot:

vs.

 

 $t$       $x$      $v_x$
Question