Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith committed Oct 8, 2024
1 parent 598b920 commit bbbd7df
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/common_interface/arkode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]

0 comments on commit bbbd7df

Please sign in to comment.