Analyzing a nonlinear differential system – Lotka-Volterra (predator-prey) equations
Here, we will conduct a brief analytical study of a famous nonlinear differential system: the Lotka-Volterra equations, also known as predator-prey equations. These equations are first-order differential equations that describe the evolution of two interacting populations (for example, sharks and sardines), where the predators eat the prey. This example illustrates how to obtain exact expressions and results about fixed points and their stability with SymPy.
Getting ready
For this recipe, knowing the basics of linear and nonlinear systems of differential equations is recommended.
How to do it...
- Let's create some symbols:
In [1]: from sympy import * init_printing() ...
Get IPython Interactive Computing and Visualization Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.