Class ODE_Lotka_Volterra
- java.lang.Object
-
- ODE_Lotka_Volterra
-
- All Implemented Interfaces:
FirstOrderDifferentialEquations
public class ODE_Lotka_Volterra extends Object implements FirstOrderDifferentialEquations
Example of a system of first order differential equations (ODEs).
Lotka-Volterra equations for rabbitsr(t)
and foxesf(t)
:
dr/dt = r(t) * ( a - b * f(t) ) df/dt = f(t) * ( d * r(t) - c )
-
-
Constructor Summary
Constructors Constructor Description ODE_Lotka_Volterra(double a, double b, double c, double d)
Stores the parameters of the equations.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
computeDerivatives(double t, double[] y, double[] ydot)
Computesdr/dt
anddf/dt
.int
getDimension()
Returns the number of states(=2).
-
-
-
Constructor Detail
-
ODE_Lotka_Volterra
public ODE_Lotka_Volterra(double a, double b, double c, double d)
Stores the parameters of the equations.
-
-
Method Detail
-
getDimension
public int getDimension()
Returns the number of states(=2).- Specified by:
getDimension
in interfaceFirstOrderDifferentialEquations
-
computeDerivatives
public void computeDerivatives(double t, double[] y, double[] ydot)
Computesdr/dt
anddf/dt
.- Specified by:
computeDerivatives
in interfaceFirstOrderDifferentialEquations
-
-