---
title: Temporary Title
allDay: false
startTime: 12:30
endTime: 14:30
date: 2024-09-23
completed: null
---
# Motivation for Nonlinear Dynamics
1. Started with an example of a simple spring-mass. This is a linear system by default
2. Then we talked about an undamped pendulum. Linear for only small angle assumption...
EOM:
$$ \ddot{\theta} = -\frac{g}{l} \sin(\theta) $$
Small angle assumption makes this just like $$\ddot x+ \omega^2 x = 0$$
To look at stability, we could look at the poles. But for us we're going to do things in the time domain and look at first order systems.
$$ \left[ \matrix{ \ddot x \\ \dot x} \right] = 
\left[ \matrix{ 0 & -\omega^2 \\ 1 & 0 } \right] 
\left[ \matrix{ \dot x \\ x } \right] $$
Recall from last time:
- $\Delta = \det(A)$
- $\tau = \text{tr}(A)$
When we look at these for this matrix, we see we should have a center.
Our general solution should be:
$x(t) = A \sin(\omega t + \phi)$
$y(t) = \dot x(t) = A \cos(\omega t + \phi)$
Recall the trig identity $\sin(x)^2 + \cos(x)^2 = 1$
Then:
$$x^2 + \frac{y^2}{\omega^2} = A^2$$
and for the $\omega = \sqrt{\frac{k}{m}}$ case

$$\frac{k}{2} x^2 + \frac{m}{2} \dot x^2 = \frac{k A^2}{2}$$
This is recognizably the sum of energy for a system!
## Damped Oscillation (Linear)
$$ m \ddot x + c \dot x + k x = 0 $$
$$ \ddot x + \beta \dot x + \omega^2 x = 0, \beta>0, \omega>0 $$
Where $\dot x = y$ and $\dot y = -\beta y - \omega^2 x$
$$ \left[ \matrix{ \dot x \\ \dot y} \right] = 
\left[ \matrix{ 0 & 1 \\ -\omega^2 & - \beta } \right] 
\left[ \matrix{ y \\ x } \right] $$
Now we look at our parabola chart to see where we are:
$\tau^2 - 4 \Delta = \beta^2 - 4 \omega^2$
Stable Spiral (Underdamped)
- $z < 0 \rightarrow \tau^2 - 4 \Delta<0 \rightarrow \tau^2 < 4 \Delta$$
Degenerate Node (Stable) ((Critically Damped))
- $z = 0 \rightarrow \tau^2 = 4 \Delta$$
Stable Node (Overdamped)
- $z > 0 \rightarrow \tau^2 - 4 \Delta>0 \rightarrow \tau^2 > 4 \Delta$$

These things relate directly to the eigenvectors and eigenvectors of the system.
## Eigenvalues and Eigenvectors
$z = \beta^2 - 4 \omega^2$
Solving for lambda ($\det[A - I\lambda]$) will lead us towards the same expression for z. This is what's under the square root.
# Nonlinear Things (Finally!)
## Nonlinear Pendulum
### Undamped
$$ \ddot{\theta} = -\frac{g}{l} \sin(\theta) $$
$\dot \theta = \zeta = P(\theta, \zeta)$
$$ {\bf J} = 
\left[ \matrix{ \frac{\partial P}{\partial \theta} &  \frac{\partial P}{\partial \zeta} \\ \frac{\partial Q}{\partial \theta} & \frac{\partial Q}{\partial \zeta}} \right] = 

\left[ \matrix{ 0 & 1\\ -\omega^2 \sin(\theta) & 0 } \right]  
 $$
 What ar the equilibrium points?
$$\left[ \matrix{ \dot \theta \\ \dot \zeta} \right ] =  \left[ \matrix{ \zeta \\ -\omega^2 \sin(\theta) } \right] $$
This system is in equilibrium when $\dot \theta = \dot \zeta = 0$, which is when $\zeta = \sin(\theta) = 0$ . 
For $\bf J$:
- $\tau = 0$
- $\Delta = \omega^2 \cos(\theta)$
Then:
- $\theta$ is 0, $\Delta = \omega^2 >0$, center, marginally stable
- $\theta = n \pi$, $\Delta = - \omega^2 <0$, saddle. Unstable
What does the phase plane look like?
![[Pasted image 20240923133628.png]]
How do we know which way the saddle points will kick us? The eigenvalues. The centers correlate to when the pendulum can't go around and around, the saddles are when you're wildin.

### Damped
What about when we have damping?
![[Pasted image 20240923133900.png]]
Now we have stable spirals!
$$ {\bf J} = 
\left[ \matrix{ \frac{\partial P}{\partial \theta} &  \frac{\partial P}{\partial \zeta} \\ \frac{\partial Q}{\partial \theta} & \frac{\partial Q}{\partial \zeta}} \right] = 
\left[ \matrix{ 0 & 1\\ -\omega^2 \sin(\theta) & -\beta } \right]  
 $$
  What are the equilibrium points?
$$\left[ \matrix{ \dot \theta \\ \dot \zeta} \right ] =  \left[ \matrix{ \zeta \\ -\beta\zeta-\omega^2 \sin(\theta) } \right] $$
For $\bf J$:
- $\tau = -\beta$
- $\Delta = \pm\omega^2$
Then:
- $\theta$ is 0, $\Delta = \omega^2 >0$, spiral. Stable
- $\theta = n \pi$, $\Delta = - \omega^2 <0$, saddle. Unstable
---
# Competing Species Problems
We have a Species X vs. Species Y.
$$\dot x = x(\beta-\delta x -\gamma y) = \beta x - \delta x^2 - \gamma xy$$
$$\dot y = y(b - d y - c x) = by - dy^2 -cxy$$
>[!note] Coupling Terms
>$\gamma x y$ and $c x y$ are coupling terms.
>These equations are coupled because of these. Without them x and y would just be doing their own thing.
## Computing our Jacobian
$$ {\bf J} = 
\left[ \matrix{ \frac{\partial P}{\partial x} &  \frac{\partial P}{\partial y} \\ \frac{\partial Q}{\partial x} & \frac{\partial Q}{\partial y}} \right] = 
\left[ \matrix{ \beta -2\delta x - \gamma y & -\gamma x\\ - c y & b - 2dy - cx} \right]  
 $$
 Now we can actually do stuff with this in python instead of by hand.


# Written Notes

  ![[Nonlinear Planar Systems.png]]