Numerical Methods

Outline

Introduction

Linear
Equations

Interpolation

Numerical
Solutions

Computer
Measurement

      

Mass-nonlinear spring system

A mass $m$ is attached to a nonlinear linear spring that exerts a force $F=-kx|x|$. The spring is stretched 2 cm from its equilibrium position and the mass is released from rest. If friction is neglected, the mass oscillates around the equilibrium position of the spring. The acceleration of the mass is $a_x=-kx|x|/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=$ 20 [N/m]

$m=$ 0.4 [kg]

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$