using GeometricIntegrators: integrate, ImplicitMidpoint
using GeometricEquations: EnsembleProblem
using GeometricProblems.CoupledHarmonicOscillator: hodeproblem, default_parameters, tspan, tstep, hamiltonian, p₀, q₀
const m₁ = default_parameters.m₁
const m₂ = default_parameters.m₂
const k₁ = default_parameters.k₁
const k₂ = default_parameters.k₂
const k = Float64.(0.0:0.1:4)
params_collection = [(m₁ = m₁, m₂ = m₂, k₁ = k₁, k₂ = k₂, k = k_val) for k_val in k]
ensemble_problem = EnsembleProblem(hodeproblem().equation, tspan, tstep, (q = q₀, p = p₀), params_collection)
ensemble_solution = integrate(ensemble_problem, ImplicitMidpoint())
julia> ensemble_solution = integrate(ensemble_problem, ImplicitMidpoint())
ERROR: MethodError: no method matching vectorfield(::Vector{Float64})
Closest candidates are:
vectorfield(::GeometricBase.AbstractStateVariable)
@ GeometricBase ~/.julia/packages/GeometricBase/d27AC/src/data/state_variables.jl:131
Stacktrace:
[1] (::GeometricIntegrators.Integrators.var"#15#21")(::Int64)
@ GeometricIntegrators.Integrators ./none:0
[2] iterate
@ ./generator.jl:47 [inlined]
[3] collect(itr::Base.Generator{UnitRange{Int64}, GeometricIntegrators.Integrators.var"#15#21"})
@ Base ./array.jl:834
[4] GeometricIntegrators.Integrators.SolutionStepPODE(t::Float64, q::Vector{…}, p::Vector{…}, parameters::@NamedTuple{…}; nhistory::Int64, internal::@NamedTuple{…})
@ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/solutions/solution_step_pode.jl:67
[5] SolutionStepPODE
@ ~/.julia/packages/GeometricIntegrators/yNYjW/src/solutions/solution_step_pode.jl:63 [inlined]
[6] GeometricIntegrators.Integrators.SolutionStep(problem::HODEProblem{…}, extrap::GeometricIntegrators.Extrapolators.MidpointExtrapolation; kwargs::@Kwargs{…})
@ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/solutions/solution_step_constructors.jl:17
[7] GeometricIntegrators.Integrators.SolutionStep(problem::HODEProblem{…}, method::GeometricIntegrators.Integrators.IPRK{…}, extrap::GeometricIntegrators.Extrapolators.MidpointExtrapolation)
@ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/solutions/solution_step_constructors.jl:52
[8] SolutionStep
@ ~/.julia/packages/GeometricIntegrators/yNYjW/src/solutions/solution_step_constructors.jl:52 [inlined]
[9] GeometricIntegrators.Integrators.GeometricIntegrator(problem::HODEProblem{…}, integratormethod::GeometricIntegrators.Integrators.IPRK{…}, solvermethod::SimpleSolvers.Newton, iguess::GeometricIntegrators.Extrapolators.HermiteExtrapolation)
@ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/integrators/integrator.jl:165
[10] #GeometricIntegrator#82
@ ~/.julia/packages/GeometricIntegrators/yNYjW/src/integrators/integrator.jl:185 [inlined]
[11] GeometricIntegrators.Integrators.GeometricIntegrator(problem::HODEProblem{Float64, Float64, Vector{…}, HODE{…}, @NamedTuple{…}, @NamedTuple{}, @NamedTuple{…}, @NamedTuple{…}}, method::GeometricIntegrators.Integrators.IPRK{RungeKutta.PartitionedTableau{…}})
@ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/integrators/integrator.jl:178
[12] GeometricIntegrators.Integrators.GeometricIntegrator(::HODEProblem{Float64, Float64, Vector{…}, HODE{…}, @NamedTuple{…}, @NamedTuple{}, @NamedTuple{…}, @NamedTuple{…}}, ::ImplicitMidpoint; kwargs::@Kwargs{})
@ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/integrators/rk/abstract.jl:58
[13] integrate(problems::HODEEnsemble{Float64, Float64, Vector{…}, HODE{…}, @NamedTuple{…}, @NamedTuple{}, Vector{…}, Vector{…}}, method::ImplicitMidpoint; kwargs::@Kwargs{})
@ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/integrators/integrator.jl:37
[14] integrate(problems::HODEEnsemble{Float64, Float64, Vector{…}, HODE{…}, @NamedTuple{…}, @NamedTuple{}, Vector{…}, Vector{…}}, method::ImplicitMidpoint)
@ GeometricIntegrators.Integrators ~/.julia/packages/GeometricIntegrators/yNYjW/src/integrators/integrator.jl:33
[15] top-level scope
@ REPL[14]:1
Some type information was truncated. Use `show(err)` to see complete types.
I get the same error when supplying a vector of initial conditions instead of a vector of parameters.