Lotka-Volterra ODE¶
| Example | |
|---|---|
| Source | DeepXDE example |
| Problem | Forward and Inverse (the Inverse mode is PINNStudio's addition) |
| Dimension | ODE (t) |
| Regime | Time-dependent |
| Geometry | — (t only) |
| Outputs | r, p |
| Settings | Default (no separate Tuned preset) |
Governing equations¶
Mathematical form (from the benchmark records):
As typed in PINNStudio's Equations page (each expression is a residual, set to zero):
Constants: ub = 200, rb = 20
As typed in PINNStudio's Equations page (Inverse mode) (each expression is a residual, set to zero):
Constants: ub = 200, rb = 20
Domain¶
- Time interval: \(t \in [0, 1]\)
Initial conditions¶
| Output | Initial value | How it is imposed (Settings: Default) |
|---|---|---|
r |
0 |
not used as a loss term |
p |
0 |
not used as a loss term |
Boundary conditions¶
No boundary-condition rows: the boundary values are imposed exactly through the network's output transform (see Methods below), or the problem has no boundary terms.
Unknowns and measured data (Inverse)¶
| Trainable parameter | Initial value | True value |
|---|---|---|
a |
1 | 2 |
d |
2 | 1.06 |
Measured data (Inverse page, measured-data files):
reference_data/deepxde/lotka_volterra/r.txt→ outputr, weight 100reference_data/deepxde/lotka_volterra/p.txt→ outputp, weight 100
Settings¶
Forward mode¶
Settings: Default — DeepXDE's own settings
- Network: FNN, hidden layers 6 × 64, inputs (t), 2 outputs; activation tanh, initializer Glorot normal
- Points: 3,000 domain, 2 boundary, 3,000 test
- Loss weights:
1,1(equations, then boundary-condition rows, then initial conditions) - Methods: output transform
r*tanh(t) + 100/ub|p*tanh(t) + 15/ub(reference); input featurest; sin(t); sin(2*t); sin(3*t); sin(4*t); sin(5*t); sin(6*t)(reference)
| Phase | Optimizer | Iterations | Learning rate | Decay |
|---|---|---|---|---|
| 1 | Adam | 50,000 | 0.001 | none |
| 2 | L-BFGS | 15,000 | — | none |
No separate Tuned preset: the Tuned item is greyed out for this example (its Default settings are PINNStudio's best).
Inverse mode¶
Settings: Default — DeepXDE's settings with PINNStudio's Inverse-mode changes (see Notes)
- Network: FNN, hidden layers 6 × 64, inputs (t), 2 outputs; activation tanh, initializer Glorot normal
- Points: 3,000 domain, 2 boundary, 3,000 test
- Loss weights:
1,1(equations, then boundary-condition rows, then initial conditions) - Methods: output transform
r*tanh(t) + 100/ub|p*tanh(t) + 15/ub(reference); input featurest; sin(t); sin(2*t); sin(3*t); sin(4*t); sin(5*t); sin(6*t)(reference)
| Phase | Optimizer | Iterations | Learning rate | Decay |
|---|---|---|---|---|
| 1 | Adam | 50,000 | 0.001 | none |
| 2 | L-BFGS | 15,000 | — | none |
No separate Tuned preset: the Tuned item is greyed out for this example (its Default settings are PINNStudio's best).
Results¶
The configuration selected in PINNStudio's benchmark study, run on one RTX 4090. Forward: relative L₂ error of each output at the last reference time. Inverse: each parameter's relative error and, per seed, the largest of them (worst parameter error).
Forward problem¶
Settings: Default — the example's own settings (not in the tuning sweep); the example has no separate Tuned preset for this mode. Values: median over seeds 2026, 1, 2.
| Output | Relative L₂ |
|---|---|
| r | 2.1 × 10⁻³ |
| p | 1.4 × 10⁻³ |
Inverse problem¶
Settings: Default — the example's own settings (no change did better); the example has no separate Tuned preset for this mode. Values: median over seeds 2026, 1, 2.
| Parameter | True value | Recovered | Relative error |
|---|---|---|---|
| a | 2 | 2 | 0 % |
| d | 1.06 | 1.06 | 0 % |
Worst parameter error: 0 % (the median over the seeds of each seed's largest error).
Full benchmark record: every setting tried, the per-seed values and all figures are in the benchmark records on GitHub.
Loading it in PINNStudio¶
- Forward: toolbar Examples: › Forward › under the ── ODE ── heading, Lotka-Volterra ODE › Default, then Solve.
- Inverse: toolbar Examples: › Inverse › under the ── ODE ── heading, Lotka-Volterra ODE › Default, then Solve.
Loading an example fills in every setting; anything you change before Solve is listed in the Training Log. Your save folder, GPU, random-seed and plot-style settings are kept.
Reference solution¶
- Reference data files:
reference_data/deepxde/lotka_volterra/
Notes¶
- Populations scaled by ub = 200, time by rb = 20, as in DeepXDE's script; the initial values (100/ub, 15/ub) are imposed exactly by the output transform. Reference computed with SciPy's solve_ivp by tools/make_deepxde_reference_data.py.
- Inverse mode (PINNStudio's addition): the prey growth rate a (2 in the forward equations; initial guess 1) and the predator death rate d (1.06; initial guess 2) are learned from both populations (reference_data/deepxde/lotka_volterra).
Definition and records¶
- Definition:
EXAMPLESentry "Lotka-Volterra equation" inpinnstudio/core/deepxde_examples.py- Inverse mode (PINNStudio's addition):
ADDED_INVERSE["Lotka-Volterra equation"], same file
- Inverse mode (PINNStudio's addition):
- Equations: Governing equations on this page
- Reference data:
reference_data/deepxde/lotka_volterra/, written bytools/make_deepxde_reference_data.py - Measured data (Inverse):
reference_data/deepxde/lotka_volterra/, written bytools/make_deepxde_reference_data.py - Benchmark records:
benchmarks/problems/lotka-volterra-ode.md, its entry in the examples overview, the benchmark collection - Tuning-study configurations (records of the tuning study; open one with Problem › Open Saved Problem...; not presets of the Examples list):
Lotka-Volterra ODE (tuned).pinn.json,Lotka-Volterra ODE, inverse mode (tuned).pinn.json - Methods (Default and Tuned settings): Networks and Fourier features
- DeepXDE example: Lotka_Volterra.py (documentation)
- Cite: Lu et al. 2021 (DeepXDE)
How the benchmark values were measured and checked: Reproducibility.

