Mass-nonlinear spring system

A numerical differential equation solver can also be used if the spring is nonlinear. For a linear spring, the force is proportional to the extension of the spring, $F=-kx$. For a hard spring, the force grows faster than linearly as the spring is extended. An example of a hard spring force is $F=-kx|x|$. For a soft spring, the force grows slower than linearly as the spring is extended. An example of a soft spring force is $F=-k\sin(x)$. In the simulation below, the spring is stretched from its equilibrium position and the mass $m$ is released from rest. If friction is neglected, the mass oscillates around the equilibrium position of the spring. For nonlinear springs, the oscillation frequency depends on the amplitude of the oscillations. For hard springs, the frequency increases with amplitude and for soft springs, the frequency decreases with amplitude.

     

$k=$ 20 [N/m]

$m=$ 0.4 [kg]

$x(t_0)=$ 0.02 [m]

The period of the oscillations depends on the initial amplitude $x(t_0)$.

 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$