```python
#SIR EPIDEMIC MODEL
```


```python
import matplotlib.pyplot as plt
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,I,V,= sp.symbols('S,I,V')
rho,mu,beta,alpha,gamma,N=sp.symbols('rho,mu,beta,alpha,gamma,N')
```


```python
#Equations representing our system
dot_S_t=(1-rho)*mu*N-beta*S*I/N-(mu+alpha)*S
display(dot_S_t)
dot_I_t=beta*S*I/N-(mu+gamma)*I
display(dot_I_t)
dot_V_t=rho*mu*N+gamma*I-mu*V+alpha*S
display(dot_V_t)
```


```python
#Creating equations from the expressions above.
SEq = sp.Eq(dot_S_t,0)
display(SEq)
IEq = sp.Eq(dot_I_t,0)
display(IEq)
VEq = sp.Eq(dot_V_t,0)
display(VEq)
```


```python
#Determining the equilibrium points.
EqPnts = sp.solve( (SEq,IEq,VEq), S,I,V )
display(EqPnts)
```


```python
#Linearization of the system.
Matrix=sp.Matrix([dot_S_t,dot_I_t,dot_V_t])
Matrix
```


```python
Mat=sp.Matrix([S,I,V])
Mat
```


```python
JacobianMat=Matrix.jacobian(Mat)
JacobianMat
```


```python
EV1=JacobianMat.eigenvals()
display(EV1)
```


```python
p=EqPnts[1][0]
q=EqPnts[1][1]
r=EqPnts[1][2]
Jacsub=JacobianMat.subs([(S,p),(I,q),(V,r)])
Jacsub
```


```python
EV1=Jacsub.eigenvals()
display(EV1)
```


```python
p=EqPnts[0][0]
q=EqPnts[0][1]
r=EqPnts[0][2]
Jacsub1=JacobianMat.subs([(S,p),(I,q),(V,r)])
Jacsub1
```


```python
EV1=Jacsub1.eigenvals()
display(EV1)
```


```python

```

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