#EPIDEMIC MODEL


```python
import sympy as sm
import matplotlib as plt
import numpy as np
import scipy.linalg as la
from sympy.interactive import printing
printing.init_printing(use_latex=True)
```


```python


#Variable definition
S,E,I,A,R= sm.symbols('S,E,I,A,R')
beta,q,mu,eta,p,gamma,alpha,N= sm.symbols('beta,q,mu,eta,p,gamma,alpha,N')


#the system of equations
Sdot = N-beta*S*(I+q*A)-mu*S
display(Sdot)
Edot=beta*S*(I+q*A)-(mu+eta)*E
display(Edot)
Idot = p*eta*E-(mu+gamma)*I
display(Idot)
Adot=(1-p)*eta*E-(mu+alpha)*A
display(Adot)
Rdot=gamma*I+alpha*A-mu*R
display(Rdot)
```


```python
#Equilibrium points
SEq = sm.Eq(Sdot,0)
EEq = sm.Eq(Edot,0)
IEq = sm.Eq(Idot,0)
AEq = sm.Eq(Adot,0)
REq = sm.Eq(Rdot,0)
#hEq = sm.Eq(h,0)
# compute fixed points
equilibriam_points = sm.solve( (SEq,EEq,IEq,AEq,REq), S,E,I,A,R )
display(equilibriam_points)
```


```python
F_i=sm.Matrix([beta*S*(I+q*A),0,0])
F_i
```


```python
V_i=sm.Matrix([(mu+eta)*E,-Idot,-Adot])
V_i
```


```python
Mat=sm.Matrix([E,I,A])
Mat
```


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


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


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


```python
G=F*V_inv
G
```


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


```python
p=equilibriam_points[0][0]
q=equilibriam_points[0][1]
r=equilibriam_points[0][2]
Jacsub1=G.subs([(S,p),(E,q),(I,r)])
Jacsub1
```


```python
p
```


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


```python

```


```python

```


```python

```

38c3be7c44970373cdf7d620a23496b083058cb8
ipynb
Jupyter Notebook
WQUIZ3.ipynb
winniekulei/Personal_python_ex
0a90c6faf6702eda714000b3e35f6ddc6f049aac
MIT
WQUIZ3.ipynb
winniekulei/Personal_python_ex
0a90c6faf6702eda714000b3e35f6ddc6f049aac
MIT
WQUIZ3.ipynb
winniekulei/Personal_python_ex
0a90c6faf6702eda714000b3e35f6ddc6f049aac
MIT
Qwen/Qwen-72B
1. YES
2. YES