« View all new features in Mathematica 9  previous  |  next 
New in Mathematica 9Parametric Differential Equations

Sensitivity of the Duffing Equation 

Explore the sensitivity of the Duffing equation to initial conditions.

To simplify the computations that follow, use ParametricNDSolveValue with only the initial conditions as parameters and other values fixed.

In[1]:=
Click for copyable input
X
Out[1]=

The derivatives of the ParametricFunction with respect to a and b are the sensitivities with respect to the initial values for x and its derivative x, respectively.

In[2]:=
Click for copyable input
X
Out[2]=

Show a plot of the solution starting at {0, 0} and log plots of the sensitivities.

In[3]:=
Click for copyable input
X
Out[3]=

The enormous sensitivities indicate that even a small change in either of these parameters will lead to a large deviation in the solution. Shown below are the solutions with a small perturbation from the origin in either direction.

In[4]:=
Click for copyable input
X
Out[4]=

Another way to visualize the sensitivity is to locally break it down into components parallel and perpendicular to the direction of the trajectory in the phase plane.

Define a function that gives a vector perpendicular to the trajectory as a function of time.

In[5]:=
Click for copyable input
X

Now define functions that give the magnitude of the components of the sensitivity with respect to the initial value of x in the parallel and perpendicular directions.

In[6]:=
Click for copyable input
X
In[7]:=
Click for copyable input
X

For this equation, the two components grow at comparable rates.

The component breakdown allows a nice visualization in the phase plane. Changing the scaling of the sensitivity makes it possible to see it for different time intervals.

In[8]:=
Click for copyable input
X
Out[8]=