# 15.7. Analyzing a nonlinear differential system — Lotka-Volterra (predator-prey) equations


```python
from sympy import *
init_printing(pretty_print=True)

var('x y')
var('a b c d', positive=True)
```


```python
f = x * (a - b * y)
g = -y * (c - d * x)
```


```python
solve([f, g], (x, y))
```


```python
(x0, y0), (x1, y1) = _
```


```python
M = Matrix((f, g))
M
```


```python
J = M.jacobian((x, y))
J
```


```python
M0 = J.subs(x, x0).subs(y, y0)
M0
```


```python
M0.eigenvals()
```


```python
M1 = J.subs(x, x1).subs(y, y1)
M1
```


```python
M1.eigenvals()
```

d573361a0f669882d49d3c9d610bd18a4f406754
ipynb
Jupyter Notebook
001-Jupyter/001-Tutorials/002-IPython-Cookbook/chapter15_symbolic/07_lotka.ipynb
jhgoebbert/jupyter-jsc-notebooks
bcd08ced04db00e7a66473b146f8f31f2e657539
BSD-3-Clause
001-Jupyter/001-Tutorials/002-IPython-Cookbook/chapter15_symbolic/07_lotka.ipynb
jhgoebbert/jupyter-jsc-notebooks
bcd08ced04db00e7a66473b146f8f31f2e657539
BSD-3-Clause
001-Jupyter/001-Tutorials/002-IPython-Cookbook/chapter15_symbolic/07_lotka.ipynb
jhgoebbert/jupyter-jsc-notebooks
bcd08ced04db00e7a66473b146f8f31f2e657539
BSD-3-Clause
2022-01-13T18:49:12.000Z
2022-01-13T18:49:12.000Z
Qwen/Qwen-72B
1. YES
2. YES