Lotka-Volterra 2d
Lotka–Volterra models are used in mathematical biology for modelling population dynamics of animal species, as well as many other fields where predator-prey and similar models appear. The dynamics of the growth of two interacting species can be modelled by the following noncanonical Hamiltonian system
Sub-models
The Euler-Lagrange equations of the Lotka-Volterra model can be obtained from different Lagrangians, which are connected by gauge transformations. Although they all lead to the same equations of motion, they lead to different variational integrators. Therefore different models based on different Lagrangians are implemented.
GeometricProblems.LotkaVolterra2d
— ModuleLotka-Volterra model in 2D
GeometricProblems.LotkaVolterra2dSymmetric
— ModuleLotka-Volterra model in 2D with symmetric Lagrangian
This Lagrangian is a slight generalization of Equation (5) in José Fernández-Núñez, Lagrangian Structure of the Two-Dimensional Lotka-Volterra System, International Journal of Theoretical Physics, Vol. 37, No. 9, pp. 2457-2462, 1998.
GeometricProblems.LotkaVolterra2dSingular
— ModuleLotka-Volterra model in 2D with "singular" Lagrangian
This Lagrangian is equivalent to the Lagrangian of the symmetric Lotka-Volterra model. It differs only by a gauge transformation with the term $- 1/2 \, d(\log(q_1) \log(q_2))/dt$. It leads to the same Euler-Lagrange equations but to a different variational integrator.
GeometricProblems.LotkaVolterra2dGauge
— ModuleLotka-Volterra model in 2D with symmetric Lagrangian with gauge term
This Lagrangian is equivalent to the Lagrangian of the symmetric Lotka-Volterra model. It differs only by a gauge transformation with the term $d(q_1 q_2)/dt$. It leads to the same Euler-Lagrange equations but to a different variational integrator.
User Functions
GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_dg
— FunctionCreates an implicit ODE object for the Lotka-Volterra 2D model for use with DG integrators.
GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_idae
— FunctionCreates an implicit DAE object for the Lotka-Volterra 2D model.
GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_iode
— FunctionCreates an implicit ODE object for the Lotka-Volterra 2D model.
GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_ode
— FunctionCreates an ODE object for the Lotka-Volterra 2D model.
GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_pdae
— FunctionCreates a partitioned DAE object for the Lotka-Volterra 2D model.
GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_pode
— FunctionCreates a partitioned ODE object for the Lotka-Volterra 2D model.
GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_slrk
— FunctionCreates a variational DAE object for the Lotka-Volterra 2D model for use with SLRK integrators.
GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_vdae
— FunctionCreates a variational DAE object for the Lotka-Volterra 2D model.
GeometricProblems.LotkaVolterra2d.lotka_volterra_2d_vode
— FunctionCreates a variational ODE object for the Lotka-Volterra 2D model.
Plotting Functions
GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d!
— MethodPlots the solution of a 2D Lotka-Volterra model together with the energy error.
Arguments:
sol <: Solution
equ <: Equation
Keyword aguments:
nplot=1
: plot everynplot
th time stepxlims=:auto
: xlims for solution plotylims=:auto
: ylims for solution plotlatex=true
: use LaTeX guides
GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d!
— MethodPlots the solution of a 2D Lotka-Volterra model together with the energy error.
Arguments:
sol <: Solution
equ <: Equation
Keyword aguments:
nplot=1
: plot everynplot
th time stepxlims=:auto
: xlims for solution plotylims=:auto
: ylims for solution plotlatex=true
: use LaTeX guides
GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d
— MethodPlots the solution of a 2D Lotka-Volterra model together with the energy error.
Arguments:
sol <: Solution
equ <: Equation
Keyword aguments:
nplot=1
: plot everynplot
th time stepxlims=:auto
: xlims for solution plotylims=:auto
: ylims for solution plotlatex=true
: use LaTeX guides
GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution!
— MethodPlots the solution of a 2D Lotka-Volterra model.
Arguments:
sol <: Solution
equ <: Equation
Keyword aguments:
nplot=1
: plot everynplot
th time stepxlims=:auto
: xlims for solution plotylims=:auto
: ylims for solution plotlatex=true
: use LaTeX guides
GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution!
— MethodPlots the solution of a 2D Lotka-Volterra model.
Arguments:
sol <: Solution
equ <: Equation
Keyword aguments:
nplot=1
: plot everynplot
th time stepxlims=:auto
: xlims for solution plotylims=:auto
: ylims for solution plotlatex=true
: use LaTeX guides
GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_solution
— MethodPlots the solution of a 2D Lotka-Volterra model.
Arguments:
sol <: Solution
equ <: Equation
Keyword aguments:
nplot=1
: plot everynplot
th time stepxlims=:auto
: xlims for solution plotylims=:auto
: ylims for solution plotlatex=true
: use LaTeX guides
GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces!
— MethodPlots time traces of the solution of a 2D Lotka-Volterra model and its energy error.
Arguments:
sol <: Solution
equ <: Equation
Keyword aguments:
nplot=1
: plot everynplot
th time steplatex=true
: use LaTeX guides
GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces!
— MethodPlots time traces of the solution of a 2D Lotka-Volterra model and its energy error.
Arguments:
sol <: Solution
equ <: Equation
Keyword aguments:
nplot=1
: plot everynplot
th time steplatex=true
: use LaTeX guides
GeometricProblems.LotkaVolterra2dPlots.plot_lotka_volterra_2d_traces
— MethodPlots time traces of the solution of a 2D Lotka-Volterra model and its energy error.
Arguments:
sol <: Solution
equ <: Equation
Keyword aguments:
nplot=1
: plot everynplot
th time steplatex=true
: use LaTeX guides