# Lotka–Volterra Predator-Prey Dynamics Simulator

RK4 simulation of the classic predator–prey oscillator with phase plane, closed orbits, equilibrium, and period analysis.

> Canonical page: https://elysiatools.com/en/tools/lotka-volterra-predator-prey

- **Category:** Health

- **Keywords:** lotka volterra, predator prey, lynx hare, population cycles, population dynamics, phase plane, limit cycle, coexistence equilibrium, ecology simulator, predation model, oscillation, rk4

## Overview

The Lotka–Volterra Predator-Prey Dynamics Simulator runs an RK4 integration of the classic oscillator dN/dt = rN − aNP, dP/dt = bNP − mP. Enter prey growth, predation, conversion, and mortality rates plus starting populations and duration to get time-series cycles, a closed phase-plane orbit, the coexistence equilibrium, and period analysis.

## Inputs

- **Prey growth rate r (per time unit)** (number): Per-capita prey growth with no predators present.
- **Predation rate a (per predator)** (number): Removal of prey per encounter — multiplies N·P.
- **Conversion efficiency b (prey → predator)** (number): New predators produced per prey consumed — sets the prey level needed to sustain predators (N* = m/b).
- **Predator mortality m (per time unit)** (number): Per-capita predator death rate with no prey.
- **Initial prey population N₀** (number): Starting prey population — sets the orbit amplitude together with P₀.
- **Initial predator population P₀** (number): Starting predator population.
- **Simulation duration (time units)** (number): How long to integrate — a few cycle periods (T ≈ 2π/√(r·m)) make the orbit readable.

## When to use

- When you need closed predator–prey orbits, time series, and the coexistence point N* = m/b, P* = r/a without coding an integrator.
- When you want to compare the linearized period 2π/√(r m) with the cycle length measured from the RK4 trajectory.
- When you are checking how N₀ and P₀ set orbit amplitude around the equilibrium for given rates.

## How it works

- Enter prey growth r, predation a, conversion b, predator mortality m, initial N₀ and P₀, and simulation length tMax.
- RK4 steps the Lotka–Volterra ODEs; Hamiltonian drift is monitored so the orbit stays closed.
- The HTML result plots N(t) and P(t), the N–P phase plane with the closed orbit and equilibrium, and reports cycle count, measured period, and amplitude ranges.
- Linearized period T ≈ 2π/√(r m) is shown beside the measured period from the integrated trajectory.

## Use cases

- Demonstrate lynx–hare style oscillations, predator lag, and a closed orbit around (m/b, r/a).
- Explore how raising r, a, b, or m shortens the period and widens population swings.
- Verify that a chosen (N₀, P₀) produces a conserved closed orbit with reported amplitudes and period.

## Frequently asked questions

### What equations does the simulator integrate?

The classic Lotka–Volterra system dN/dt = rN − aNP and dP/dt = bNP − mP, using RK4.

### Where is the coexistence equilibrium?

At N* = m/b and P* = r/a, plotted on the phase plane with the closed orbit.

### How is period estimated?

A linearized value T ≈ 2π/√(r m) is given together with the period measured from the simulated cycles.

### Do starting populations change the cycle?

Yes. Neutral closed orbits have amplitude fixed by N₀ and P₀; predators typically lag prey by about a quarter cycle.

### What does the output show?

HTML time-series curves, the closed phase-plane orbit with equilibrium, cycle statistics, measured period, and min/max populations.

## Related tools

- [Chess FEN, PGN & Elo Rating Tutor](https://elysiatools.com/en/tools/chess-fen-pgn-elo-rating-tutor): Parse & validate FEN board snapshots, PGN/SAN movetext (with parity, check/mate counts, threefold); compute Elo rating updates from win/draw/loss results, with Lichess/Chess.com tier bands
- [eGFR Calculator (CKD-EPI 2021 Race-Free)](https://elysiatools.com/en/tools/egfr-ckd-epi): Estimate glomerular filtration rate (eGFR) with the CKD-EPI 2021 race-free creatinine equation: eGFR = 142 × min(SCr/κ, 1)^α × max(SCr/κ, 1)^(−1.200) × 0.9938^Age × 1.012 if female, where κ = 0.7 (female) / 0.9 (male) and α = −0.241 (female) / −0.302 (male). This 2021 update (Inker et al., NEJM 2021) removed the race multiplier from the 2009 equation and changed the leading coefficient from 141 to 142. Returns a BSA-INDEXED eGFR for CKD staging (G1–G5); for drug dosing use un-indexed CrCl (Cockcroft-Gault). Valid for stable adults, not AKI/pregnancy/amputees/extremes. Not medical advice.
- [eGFR Calculator (MDRD Simplified)](https://elysiatools.com/en/tools/egfr-mdrd): Estimate glomerular filtration rate (eGFR) with the simplified 4-variable MDRD equation (2006 re-expressed, IDMS-traceable): eGFR (mL/min/1.73 m²) = 175 × SCr^−1.154 × Age^−0.203 × (0.742 if female) × (1.212 if Black). The 175 constant replaced the original 186 after IDMS-standardized creatinine calibration. The legacy race coefficient 1.212 is OFF by default (the 2021 CKD-EPI race-free equation removed it) and is provided only for historical comparison. Returns a BSA-INDEXED eGFR for CKD staging (G1–G5); for drug dosing use un-indexed CrCl (Cockcroft-Gault). Derived from Levey AS et al., Ann Intern Med 2006. Valid for stable adults, not AKI/pregnancy/extremes. Not medical advice.
- [Dialysis Dose Kt/V Calculator (Daugirdas 2nd Gen.)](https://elysiatools.com/en/tools/kt-v-dialysis-dose): Estimate single-pool Kt/V (spKt/V) for a hemodialysis session with the Daugirdas second-generation formula: Kt/V = −ln(R − 0.008·t) + (4 − 3.5·R) × UF / W, where R = Post-BUN/Pre-BUN, t = treatment time (h), UF = ultrafiltration volume (kg), W = post-dialysis weight (kg). The first term captures urea removal and generation; the second corrects for volume contraction. KDOQI target: spKt/V ≥1.2 per session (minimum delivered dose) for conventional thrice-weekly hemodialysis, target ~1.4. Requires post-dialysis BUN drawn by slow-flow/stop-pump technique. Derived from Daugirdas JT, J Am Soc Nephrol 1993. Valid for intermittent hemodialysis; not for peritoneal dialysis or CRRT/SLED. Not medical advice.
- [NIH Stroke Scale (NIHSS)](https://elysiatools.com/en/tools/nihss-score): Calculate the NIH Stroke Scale (NIHSS) to quantify acute stroke neurologic deficit across 11 categories (15 scored items, with left & right limb motor graded separately). Items: 1a Level of consciousness (0–3), 1b LOC questions (0–2), 1c LOC commands (0–2), 2 Best gaze (0–2), 3 Visual fields (0–3), 4 Facial palsy (0–3), 5a/5b Motor arm left/right (0–4 each), 6a/6b Motor leg left/right (0–4 each), 7 Limb ataxia (0–2), 8 Sensory (0–2), 9 Best language (0–3), 10 Dysarthria (0–2), 11 Extinction/inattention (0–2). Both left and right limb motor scores are summed into the total (standard NIHSS); the tool also reports the more-affected side (max of left/right) for clinical context. Range 0–42; higher = more severe. Interpretation: 0 no symptoms, 1–4 minor, 5–15 moderate, 16–20 moderate-to-severe, 21–42 severe. Derived from Brott et al. 1989 (Stroke) and NINDS instructions. Scoring reliability is examiner-dependent and should be performed by trained personnel. Not medical advice.
- [Effective Renal Plasma Flow Calculator (PAH Clearance)](https://elysiatools.com/en/tools/renal-plasma-flow): Estimate ERPF from PAH clearance (C = U·V/P, normal ~500–700 mL/min), plus true RPF, renal blood flow from Hct, and filtration fraction from GFR. Not medical advice.
- [Data Boundary Processor](https://elysiatools.com/en/tools/data-boundary-processor): Advanced boundary value processing tool that identifies and handles minimum/maximum values in numerical data. Perfect for data validation, range checking, statistical analysis, and data preprocessing. Features: - Multiple boundary detection methods (absolute, percentile, standard deviation) - Flexible handling strategies (clip, remove, replace, transform) - Custom range validation - Asymmetric boundary handling - Batch processing capabilities - Comprehensive boundary statistics - Data quality assessment - Visual boundary reports Common Use Cases: - Data validation and quality control - Sensor data range checking - Financial data limit enforcement - Statistical data preprocessing - Machine learning feature engineering - Database constraint validation
- [Multi-Timezone Working-Hours Overlap Finder](https://elysiatools.com/en/tools/meeting-timezone-overlap-finder): Find meeting windows where 2–6 participants across time zones are all working. Computes UTC intersection, ranks by comfort, exports .ics.

## Samples

- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Duplicate Line Samples](https://elysiatools.com/en/samples/text-duplicate-line-samples): Sample files with various types of duplicate lines for testing duplicate removal tools
- [Special Characters Samples](https://elysiatools.com/en/samples/text-special-characters-samples): Sample text files with various special characters, punctuation, and symbols for testing non-alphanumeric character removal
- [Code Comment Samples](https://elysiatools.com/en/samples/code-comment-samples): Sample code files with various comment styles for testing comment removal

## Related content

- [Population Ecology, Biodiversity, and Food Web Calculators](https://elysiatools.com/en/hubs/population-ecology-biodiversity-food-web-calculators): Model population growth, carrying capacity, species interactions, field estimates, biodiversity, and trophic energy transfer in one ecology workflow.
- [Audio Encoding and Format Conversion Tools](https://elysiatools.com/en/hubs/audio-convert): Compare audio format conversion, bitrate changes, sample-rate conversion, codec swaps, and export tools in one hub for delivery and archive workflows.
- [Image Format Conversion and Animated Export Tools](https://elysiatools.com/en/hubs/image-convert): Compare image format converters for JPG, PNG, GIF, AVIF, WebP, TIFF, ICO, base64, and animation-friendly exports in one hub.
- [JSON Interchange and Format Translation Tools](https://elysiatools.com/en/hubs/json-convert): Compare JSON conversion tools for CSV, YAML, TOML, GraphQL, XML, Markdown, Excel, BSON, EDN, and related structured formats in one hub.
