Git Repository  
 The Duffing Oscillator
The Duffing oscillator is a simple spring mass model that includes a cubic spring nonlinearity. The differential equation for the unforced Duffing oscillator is:

${d^2 x}/{dt^2} + 2 c {dx}/{dt} + x + ε x^3 = 0$

This can be converted to first order form by defining a velocity coordinate $v = {dx}/{dt}$. The system of ordinary differential equations (ODEs) is then represented as:

${dx}/{dt} = v$
${dv}/{dt} = - (2 c · v + x + ε x^3)$

The vector field form of the unforced Duffing oscillator is:

$V(x,v) = {dx}/{dt} {∂}/{∂ x} + {dv}/{dt} {∂}/{∂ v} = v {∂}/{∂ x} - (2 c · v + x + ε x^3) {∂}/{∂ v}$

The 1-D generalized modal equation $V(f) = {dx}/{dt} {∂ f}/{∂ x} + {dv}/{dt} {∂ f}/{∂ v} = v {∂ f}/{∂ x} - (2 c · v + x + ε x^3) {∂ f}/{∂ v} = 1$ can be solved to find a modal solution. A modal solution of this equation, with parameters $c=0.2$ and $ε=0.05$, is shown below. The generalized modal equation $f$ was solved by starting with an initial contour and calculating the ODE trajectory of each point on the contour. The ODE solutions drag the initial contour to a new contour of the function $f$ for each value of the independent variable $t$. This is sometimes referred to as Lie dragging, and $V(f)$ is referred to as a Lie derivative, but is simply an expression of the chain rule of calculus. Contours were plotted at timesteps $t = i·1.5$ where i assumes the integer values 0 through 11. An animation of the time evolution of $f$ can be seen below.

Show ODE Solutions
Show Modal Contours
v  
x