```python
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
import numpy as np
import sympy as sp
import scipy.linalg as sl
from sympy.interactive import printing
printing.init_printing(use_latex=True)
```


```python
#Defining the symbols.
S,H,P,A,T,R= sp.symbols('S,H,P,A,T,R')
N,beta_1,beta_2,d,mu_1,p,k_1,k_2,mu_2,mu_3,rho=sp.symbols('N,beta_1,beta_2,d,mu_1,p,k_1,k_2,mu_2,mu_3,rho')
```


```python
#Equations representing our system
dot_S=N-d*beta_1*S*H/N-d*beta_2*p*S/N-d*S-mu_1*S
display(dot_S)
dot_H=d*beta_1*S*H/N+d*beta_2*p*S/N-k_1*H-d*H
display(dot_H)
dot_P=k_1*H-k_2*p-mu_2*p-d*p
display(dot_P)
dot_A=k_2*p-mu_3*A-d*A-rho*A
display(dot_A)
dot_T=mu_2*p+mu_3*A-d*T
display(dot_T)
dot_R=mu_1*S-d*R
display(dot_R)
```


```python
#Creating equations from the expressions above.
SEq = sp.Eq(dot_S,0)
display(SEq)
HEq = sp.Eq(dot_H,0)
display(HEq)
PEq = sp.Eq(dot_P,0)
display(PEq)
AEq = sp.Eq(dot_A,0)
display(AEq)
TEq = sp.Eq(dot_T,0)
display(TEq)
#REq = sp.Eq(dot_R,0)
#display(REq)
```


```python
#Determining the equilibrium points.
EqPnts = sp.solve( (SEq,HEq,PEq,AEq,TEq), S,H,p,A,T )
display(EqPnts)
```


```python
#Linearization of the system.
F_i=sp.Matrix([d*beta_1*S*H/N+d*beta_2*p*S/N,0,0,0])
F_i
```


```python
V_i=sp.Matrix([k_1*H-d*H,-dot_P,-dot_A,-dot_T])
V_i
```


```python
Mat=sp.Matrix([H,p,A,T])
Mat
```


```python
F=F_i.jacobian(Mat)
F
```


```python
V=V_i.jacobian(Mat)
V
```


```python
VInv=V.inv()
VInv
```


```python
G=F*VInv
G
```


```python
p=EqPnts[1][0]
q=EqPnts[1][1]
r=EqPnts[1][2]
s=EqPnts[1][3]
t=EqPnts[1][4]
G1=G.subs([(S,p),(H,q),(p,r),(A,s),(T,t)])
G1
```


```python
EV=G1.eigenvals()
EV
```


```python

```


```python

```

c6cac83ca9ecb22b65c4c3126ffd94ae4a523662
ipynb
Jupyter Notebook
Untitled1.ipynb
winniekulei/Personal_python_ex
0a90c6faf6702eda714000b3e35f6ddc6f049aac
MIT
Untitled1.ipynb
winniekulei/Personal_python_ex
0a90c6faf6702eda714000b3e35f6ddc6f049aac
MIT
Untitled1.ipynb
winniekulei/Personal_python_ex
0a90c6faf6702eda714000b3e35f6ddc6f049aac
MIT
Qwen/Qwen-72B
1. YES
2. YES