Mass-spring system

A mass $m$ is attached to a linear spring of spring constant $k$. The spring is stretched 2 cm from its equilibrium position and the mass is released from rest. If friction is neglected, the mass then executes harmonic motion around the equilibrium position of the spring. The force on the mass is given by Hooke's law, $F=-kx$. The acceleration of the mass is $a_x=-kx/m$.The motion is in a line which we can take to be the $x$-axis. The equations are loaded into the numerical second order differential equation solver below.

$k=$ 0.2 [N/m]

$m=$ 0.4 [kg]

The period of the oscillations is $T=2\pi\sqrt{\frac{m}{k}}=$ 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$