From bbbd7dfe309b9368067a85dd75af4f12a5bfb4f8 Mon Sep 17 00:00:00 2001 From: oscarddssmith Date: Tue, 8 Oct 2024 10:08:29 -0400 Subject: [PATCH] add test --- test/common_interface/arkode.jl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/common_interface/arkode.jl b/test/common_interface/arkode.jl index b303bc96..45d80479 100644 --- a/test/common_interface/arkode.jl +++ b/test/common_interface/arkode.jl @@ -56,3 +56,21 @@ method = ARKODE(Sundials.Explicit(); # Solve sol = solve(prob, method) @test sol.retcode == ReturnCode.Success + + + +function lotka_volterra(du, u, p, t) + # Model parameters. + α, β, γ, δ = p + # Current state. + x, y = u + + # Evaluate differential equations. + du[1] = (α - β * y) * x # prey + du[2] = (δ * x - γ) * y # predator + + return nothing +end + +sol = solve(prob, ARKODE(), saveat = [0.1, 0.2]) +@test sol.t == [0.1, 0.2]