Skip to content

Commit

Permalink
Fixing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kaandocal committed Apr 24, 2024
1 parent 24ac103 commit 5884e7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/birthdeath2D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ sol = solve(prob, Vern7(), abstol=1e-6, saveat=tt)
@test marg(sol.u[3], dims=1) pdf.(Poisson(ps[3] / ps[4] * (1 - exp(-ps[4] * tt[3]))), 0:Nmax) atol=1e-4

A = convert(SparseMatrixCSC, sys, (Nmax+1, Nmax+1), ps, 0)
f = (du,u,t) -> mul!(du, A, u)
f = (du,u,p,t) -> mul!(vec(du), A, vec(u))

probA = ODEProblem(f, u0, 10.0)
solA = solve(prob, Vern7(), abstol=1e-6, saveat=tt)
solA = solve(probA, Vern7(), abstol=1e-6, saveat=tt)

@test sol.u[1] solA.u[1] atol=1e-4
@test sol.u[2] solA.u[2] atol=1e-4
Expand Down
4 changes: 2 additions & 2 deletions test/feedbackloop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ u0[1] = 1.0
prob = convert(ODEProblem, sys, u0, maximum(tt), ps)
sol = solve(prob, Vern7(), abstol=1e-6, saveat=tt)

f = (du,u,t) -> mul!(du, A, u)
f = (du,u,p,t) -> mul!(vec(du), A, vec(u))

probA = ODEProblem(f, u0, 10.0)
solA = solve(prob, Vern7(), abstol=1e-6, saveat=tt)
solA = solve(probA, Vern7(), abstol=1e-6, saveat=tt)

@test sol.u[1] solA.u[1] atol=1e-4
@test sol.u[2] solA.u[2] atol=1e-4
Expand Down

0 comments on commit 5884e7c

Please sign in to comment.