```python
from epipack import SymbolicEpiModel
import sympy as sy 
```


```python
u, v, k, f = sy.symbols("u v k f")
```


```python
GS = SymbolicEpiModel([u,v])

GS.set_processes([
    # third-order coupling
    (u, v, v, v, v),
    # birth and death
    (None, f, u),
    (u, f, None),
    (v, f+k, None),
],ignore_rate_position_checks=True)
```

    /Users/bfmaier/Seafile/forschung/disease_dynamics/epipack/epipack/symbolic_epi_models.py:572: UserWarning: events do not sum to zero for each column:-f*u + f - v*(f + k)
      warnings.warn("events do not sum to zero for each column:" + str(test_sum))





    <epipack.symbolic_epi_models.SymbolicEpiModel at 0x1647136d0>




```python
GS.ODEs_jupyter()
```


$\displaystyle \frac{d}{d t} u = - f u + f - u v^{2}$



$\displaystyle \frac{d}{d t} v = v \left(- f - k + u v\right)$



```python
GS.find_fixed_points()
```




$\displaystyle \left\{\left( 1, \  0\right), \left( - \frac{- f + \left(f + k\right) \left(\frac{f}{2 \left(f + k\right)} - \frac{\sqrt{- f \left(4 f^{2} + 8 f k - f + 4 k^{2}\right)}}{2 \left(f + k\right)}\right)}{f}, \  \frac{f}{2 \left(f + k\right)} - \frac{\sqrt{- f \left(4 f^{2} + 8 f k - f + 4 k^{2}\right)}}{2 \left(f + k\right)}\right), \left( - \frac{- f + \left(f + k\right) \left(\frac{f}{2 \left(f + k\right)} + \frac{\sqrt{- f \left(4 f^{2} + 8 f k - f + 4 k^{2}\right)}}{2 \left(f + k\right)}\right)}{f}, \  \frac{f}{2 \left(f + k\right)} + \frac{\sqrt{- f \left(4 f^{2} + 8 f k - f + 4 k^{2}\right)}}{2 \left(f + k\right)}\right)\right\}$




```python
GS.jacobian()
```




$\displaystyle \left[\begin{matrix}- f - v^{2} & - 2 u v\\v^{2} & - f - k + 2 u v\end{matrix}\right]$




```python
GS.get_eigenvalues_at_disease_free_state({"u":1})
```




    {-f: 1, -f - k: 1}




```python
print(GS.ODEs())
print()
print(GS.find_fixed_points())
print()
print(GS.jacobian())
print()
print(GS.get_eigenvalues_at_disease_free_state({"u":1}))
```

    [Eq(Derivative(u, t), -f*u + f - u*v**2), Eq(Derivative(v, t), v*(-f - k + u*v))]
    
    FiniteSet((1, 0), (-(-f + (f + k)*(f/(2*(f + k)) - sqrt(-f*(4*f**2 + 8*f*k - f + 4*k**2))/(2*(f + k))))/f, f/(2*(f + k)) - sqrt(-f*(4*f**2 + 8*f*k - f + 4*k**2))/(2*(f + k))), (-(-f + (f + k)*(f/(2*(f + k)) + sqrt(-f*(4*f**2 + 8*f*k - f + 4*k**2))/(2*(f + k))))/f, f/(2*(f + k)) + sqrt(-f*(4*f**2 + 8*f*k - f + 4*k**2))/(2*(f + k))))
    
    Matrix([[-f - v**2, -2*u*v], [v**2, -f - k + 2*u*v]])
    
    {-f: 1, -f - k: 1}



```python

```

ae746d89ea7578378767e9dbd5b6d85a4a4867ad
ipynb
Jupyter Notebook
cookbook/notebooks/epipack_gray_scott_example.ipynb
benmaier/epipack
3a2ffb3e673e3499a553ed47c3621cd88877e6d2
MIT
2020-10-22T10:59:10.000Z
2022-01-05T02:24:21.000Z
cookbook/notebooks/epipack_gray_scott_example.ipynb
benmaier/epipack
3a2ffb3e673e3499a553ed47c3621cd88877e6d2
MIT
2021-03-06T10:18:14.000Z
2021-09-06T21:34:46.000Z
cookbook/notebooks/epipack_gray_scott_example.ipynb
benmaier/epipack
3a2ffb3e673e3499a553ed47c3621cd88877e6d2
MIT
2021-06-17T14:26:03.000Z
2021-08-13T02:11:00.000Z
Qwen/Qwen-72B
1. YES
2. YES