This repository contains an interactive web application for exploring the Lotka-Volterra predator-prey equations, with a focus on connecting the mathematical notation to actual Python code implementation.
- Interactive equations with hover explanations for each term
- Direct links between equation variables/constants and their code implementations
- Complete Python implementation of the model
- Interactive tooltips show code snippets for each mathematical component
- Tabbed interface to switch between math and code views
index.html- The main HTML file for the interactive documentationstyles.css- CSS styles for the applicationscript.js- JavaScript for the interactive featureslotka_volterra.py- Python implementation of the Lotka-Volterra model
- Open
index.htmlin a web browser - Hover over any term in the equations to see:
- Its meaning in the model
- How it's implemented in Python code
- Switch between "Equations" and "Python Implementation" tabs to see different views
- Run the Python implementation directly with
python lotka_volterra.py
The Lotka-Volterra equations describe the dynamics of a simple predator-prey ecosystem. The model consists of two coupled differential equations:
- For prey population growth: dx/dt = αx - βxy
- For predator population growth: dy/dt = -γy + δxy
Where:
- x: Prey population
- y: Predator population
- α: Prey growth rate
- β: Predation rate
- γ: Predator death rate
- δ: Predator efficiency
- Python 3.x
- NumPy
- Matplotlib
- SciPy
Install dependencies with:
pip install numpy matplotlib scipy