Skip to content

Commit

Permalink
Only computing two instances now in the parameter case.
Browse files Browse the repository at this point in the history
  • Loading branch information
benedict-96 committed Jul 8, 2024
1 parent 382b318 commit eca602a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions test/test_hodeensembles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@ function test_multiple_initial_conditions(cho::Module)
# ensemble solution
esol = integrate(epr, ImplicitMidpoint())

sol = integrate(cho.hodeproblem(), ImplicitMidpoint())
@test esol.s[1].q.d.parent sol.q.d.parent
@test esol.s[2].q.d.parent sol.q.d.parent
@test esol.s[2].q.d.parent esol.s[1].q.d.parent
end

function test_multiple_parameters(cho::Module)
params_vec = Vector{NamedTuple}()

for i in 0:1
param_vals = ()
for key in keys(cho.default_parameters)
param_vals = (param_vals..., cho.default_parameters[key] .+ 1. * i)
end

# take the first parameter (compute the ensemble by changing this parameter)
key = keys(cho.default_parameters)[1]

params_vec = push!(params_vec, NamedTuple{keys(cho.default_parameters)}(param_vals))
end

Expand All @@ -33,9 +32,7 @@ function test_multiple_parameters(cho::Module)
# ensemble solution
esol = integrate(epr, ImplicitMidpoint())

sol = integrate(cho.hodeproblem(), ImplicitMidpoint())
@test esol.s[1].q.d.parent sol.q.d.parent
@test esol.s[2].q.d.parent sol.q.d.parent
@test esol.s[2].q.d.parent esol.s[1].q.d.parent
end

test_multiple_initial_conditions(cho)
Expand Down

0 comments on commit eca602a

Please sign in to comment.