In this module we would like to work with a general non-linear dynamical system: $$ \begin{align} \dot{x} &= f(x,t,u;\mu) + d,\quad x(0)=x_0 \\ y_k &= g(x_k,t_k,u_k;\mu) + \epsilon \end{align} $$
In this module we are mainly concerned with how to learn the dynamical model from data (and its interpretation)
Given
Identify $$ \begin{align} \dot{x} &= \hat{f}(x,t,u;\mu),\quad x(0)=x_0 \\ y_k &= \hat{g}(x_k,t_k,u_k;\mu) \end{align} $$
What are dynamical features in these examples?
For example,
Need to understand what we are fitting, before we fit anything...
If we have two scalar states $x$ and $y$, and $$ \begin{align} \dot{x} &= f_1(x,y) \\ \dot{y} &= f_2(x,y) \end{align} $$ Then at $(x,y)$ one can compute $(\dot{x},\dot{y})$ as the direction to evolve - so called vector field
We will be using this example as a toy problem later as well
pltQuiver([-3,3], 31, np.pi/4, [-0.1,-0.2], 1)
# Trajectories on phase plane
pltPhasePlaneNL([-2.5,1.5],15,[1,1],1,np.pi/4,[-0.1,-0.2],1, ifLin=False)
# Trajectories as regular time response (Plotting only the first state)
x0s = [-2.5, -0.9, 1.5]
pltRespSweep(x0s, [1], [1], np.pi/4, [-0.1,-0.2], label='x0', tf=25, ifLin=False)
# How about now - unstable limit cycle?
pltQuiver([-3,3], 31, np.pi/4, [-0.1,-0.2], -1)
Consider the time-invariant case
For linear stability analysis, when it does not work, we might intuitively blame on the linearization, but is that always the case?
What about diagonalization?
Let's consider the linearized system from previous example with $x^*=0$.
The eigenvectors and eigenvalues of $A$ are $$ V=\begin{bmatrix} \cos(\pi/4-\delta) & \cos(\pi/4+\delta) \\ \sin(\pi/4-\delta) & \sin(\pi/4+\delta) \end{bmatrix},\quad \Lambda=\begin{bmatrix} -0.1 & 0 \\ 0 & -0.2 \end{bmatrix} $$
So the linear system should be stable, at least when $t\rightarrow \infty$
However, when $\delta\rightarrow 0$, $V$ becomes ill-conditioned. What happens then?
Let's start from $x_0=[1.0, 0.1]$ and solve the linear system response for $\delta=\pi/4, 0.1, 0.05, 0.02$
X0 = [1, 0.1]
ds = [np.pi/4, 0.1, 0.05, 0.02]
pltPhasePlaneSS(X0, ds)
Depending on $\delta$, the transient growth may throw the states back to nonlinear region and possibly experience new instability.
# Taking delta=0.05 for example - Look at the overshoot in linear response in upper right
pltPhasePlaneNL([-0.2,1.0],15,[0.1,0.1],1,0.05,[-0.1,-0.2],1)
# Sample time responses - again note the overshoot
xs = [0.4, 0.8, 1.2]
pltRespSweep(xs, [0.1], [1], 0.05, [-0.1,-0.2], label='x0', tf=25)
For a linear system to exhibit stable dynamics, we require all eigenvalues of its operator $A$ to satisfy $Re(\lambda_i(A))<0$.
We will dive into this characteristics in the next lecture - which bridges to the general nonlinear dynamics