LDDS

Tutorial 2: Lagrangian descriptors for 1 DoF dynamical system with forcing

In this notebook we will show how to calculate Lagrangian descriptors for a forced dynamical systsem with a two-dimensional phase space. This converts the problem into a system with a non-autonomous vector field due to the time-dependent perturbation. We illustrate this use with the Duffing oscillator.

We begin by importing the LDDS module, and from it, all the functions necessary to calculate and plot LDs, and also the ones that define the Duffing vector field and the forcig introduced.

Forced Duffing oscillator

The time-dependent Hamiltonian that describes the forced Doffing oscillator is:

\begin{equation*} H(x,p_x,t) = \dfrac{1}{2}p_x^2 - \dfrac{\alpha}{2}x^2 + \dfrac{\beta}{4}x^4 - f(t) x \end{equation*}

where $\alpha$ and $\beta$ are the model parameters and $f(t)$ is the time-dependent focing added to the system.

The non-autonomous vector field that defines the dynamical system is given by:

\begin{align} \dot{x} & = \dfrac{\partial H}{\partial p_x} = f_1(x,p_x) = p_x \\[.2cm] \dot{p}_x & = -\dfrac{\partial H}{\partial x} = f_2(x,p_x) = \alpha x - \beta x^3 + f(t) \end{align}

The LDDS software package offers two different options for the external forcing. The first type of forcing is $f(t) = A\sin(\omega \, (t+t_0))$ and the second one is $f(t) = A \, \mathrm{sech} \, (t+t_0)\sin(\omega \, (t+t_0))$, where $t = t_0$ represents the initial time. The perturbations are characterized by an amplitude $A$ and a frequency $\omega$. We will test both types of perturbations in this tutorial.

Define the unperturbed vector field of the Duffing oscillator

Define 2D spatial grid to compute LDs

Setup parameters for Lagrangian descriptors

Setup the type-1 perturbation $f(t) = A\sin(\omega \, (t+t_0))$

Compute and draw LDs at time $t = t_0$

Compute LDs for another initial time

Our next goal is to test the other type of forcing that the LDDS package implements. To do so, we first set up again the parameters for the method of Lagrangian descriptors. We will use now the arclength definition of LDs in the computation.

Setup parameters for Lagrangian descriptors

Setup the type-2 perturbation $f(t) = A \, \mathrm{sech} \, (t+t_0)\sin(\omega \, (t+t_0))$

Compute and draw LDs at time $t = t_0$