Hi, working in DiffferentialEquations.jl
, I find that a bunch of solvers don’t work with SecondOrderODE
. This seems to be a bug at least a couple of years old, is there any way to use these solvers without reducing the problem to two first-order problems? (I am concerned that treating a 2nd-order problem as coupled first-order problems would not be “symplectic”, in terms of conserving “energy”, and thus be less accurate.)
This is the error message I get each time:
DimensionMismatch("parent has 4 elements, which is incompatible with length 2")
Here is some sample code:
function SinCosDiffEqToSolve!(ddu,du,u,p,t)
ddu[1] = -u[1]
end
prob = SecondOrderODEProblem(SinCosDiffEqToSolve!,[2.0],[3.0],(0.0,1.0))
sol = solve(prob, AutoVern9(Rodas4()), dense=true, reltol=1e-12, abstol=1e-12)
OR:
sol = solve(prob, AutoVern9(Rodas5()), dense=true, reltol=1e-12, abstol=1e-12)
OR:
sol = solve(prob, AutoVern9(KenCarp4()), dense=true, reltol=1e-12, abstol=1e-12)
OR:
sol = solve(prob, AutoTsit5(Rosenbrock23()), dense=true, reltol=1e-12, abstol=1e-12)
Thanks for any info!