# Section 8.5 $\quad$ Dynamic System

Consider a $2\times 2$  homogeneous system of differential equations
\begin{eqnarray*}
% \nonumber to remove numbering (before each equation)
  \frac{dx}{dt} &=& ax+by \\
  \frac{dy}{dt} &=& cx+dy \\
\end{eqnarray*}
If the independent variable $t$ denotes time, then the above system is a **dynamic system**.
- The solution $x = x(t)$ and $y=y(t)$ represents <br /><br />
- The $xy$-plane is called <br /><br />
- A sketch of trajectory in the phase plane is called a <br /><br />
- $\frac{dx}{dt}$, $\frac{dy}{dt}$ represent velocity in $x$ and $y$ direction. A point in the phase plane at which both $\frac{dx}{dt}$ and $\frac{dy}{dt}$ are zero is called<br /><br />

**Different Types of Equilibrium Points:** <br /><br /><br /><br /><br /><br /><br />
**Stable** $\hspace{2in}$ **Unstable** $\hspace{2in}$ **Saddle Point**

The coefficient matrix $A$ will determine features of the phase portraits of the system.<br /><br /><br /><br /><br /><br /><br />

**Case 1:** $\lambda_1 < 0$, $\lambda_2 < 0$ <br /><br /><br /><br /><br /><br /><br />

**Case 2:** $\lambda_1 > 0$, $\lambda_2 > 0$<br /><br /><br /><br /><br /><br /><br />

**Case 3:** $\lambda_1 < 0$, $\lambda_2 > 0$<br /><br /><br /><br /><br /><br /><br />

**Case 4:** $\lambda_1,\lambda_2$ are Complex Numbers<br /><br /><br /><br /><br /><br /><br />

### Example 1

Determine the phase portrait of the dynamic system:
\begin{equation*}
  \mathbf{x}'(t) =
  \left[
        \begin{array}{rr}
          -2 & -2 \\
          1 & -5 \\
        \end{array}
      \right]
  \mathbf{x}(t)
\end{equation*}


```python
from sympy import *

t = symbols('t');
x1 = Function('x1');
x2 = Function('x2');
eq1 = x1(t).diff(t) + 2*x1(t) + 2*x2(t);
eq2 = x2(t).diff(t) - x1(t) + 5*x2(t);

dsolve([eq1, eq2])
```




    [x1(t) == -2*C1*exp(-4*t) - 2*C2*exp(-3*t),
     x2(t) == -2*C1*exp(-4*t) - C2*exp(-3*t)]




```python
from scipy.integrate import odeint
import numpy as np
import matplotlib.pyplot as plt

def F(x, t):
    x1, x2 = x;
    return np.array([-2*x1-2*x2, x1-5*x2]);

for i in np.arange(100):
    t = np.arange(0, 30, 0.01);
    init = (np.cos(i), np.sin(i));
    track = odeint(F, init, t);
    plt.plot(track[:,0], track[:,1]);

plt.show()
```

### Example 2

Determine the phase portrait of the dynamic system:
\begin{equation*}
  \mathbf{x}'(t) =
  \left[
        \begin{array}{rr}
          1 & -1 \\
          -2 & 0 \\
        \end{array}
      \right]
  \mathbf{x}(t)
\end{equation*}


```python
from sympy import *

t = symbols('t');
x1 = Function('x1');
x2 = Function('x2');
eq1 = x1(t).diff(t) - x1(t) + x2(t);
eq2 = x2(t).diff(t) + 2*x1(t);

dsolve([eq1, eq2])
```




    [x1(t) == -C1*exp(-t) - C2*exp(2*t), x2(t) == -2*C1*exp(-t) + C2*exp(2*t)]




```python
from scipy.integrate import odeint
import numpy as np
import matplotlib.pyplot as plt

def F(x, t):
    x1, x2 = x;
    return np.array([x1-x2, -2*x1]);

for i in np.arange(100):
    t = np.arange(0, 1, 0.01);
    init = (np.cos(i), np.sin(i));
    track = odeint(F, init, t);
    plt.plot(track[:,0], track[:,1]);

plt.show()
```

258c10a86885c6663fc8a6d855a095eb9252bb9f
ipynb
Jupyter Notebook
Jupyter_Notes/Lecture40_Sec8-5_DynamicSystem.ipynb
xiuquan0418/MAT341
2fb7ec4e5f0771f10719cb5e4a00a7ab07c49b59
MIT
Jupyter_Notes/Lecture40_Sec8-5_DynamicSystem.ipynb
xiuquan0418/MAT341
2fb7ec4e5f0771f10719cb5e4a00a7ab07c49b59
MIT
Jupyter_Notes/Lecture40_Sec8-5_DynamicSystem.ipynb
xiuquan0418/MAT341
2fb7ec4e5f0771f10719cb5e4a00a7ab07c49b59
MIT
Qwen/Qwen-72B
1. YES
2. YES