The interpolated solution from using the MIRK4 method to solve a BVProblem seems to be bugged. I can not access the derivatives of the solution like in the case of solutions to ODEProblems using the method given here: https://discourse.julialang.org/t/differentialequations-and-derivatives-of-solutions/49995/2. I just get the value of the solution at time t and not its derivative at time t.
Expected behavior
For a solution sol to a system of ODEs x'(t) = f(x(t)) with boundary conditions specified, get the derivatives of each component with respect to time using sol(t,Val{1})
Minimal Reproducible Example 👇
using DifferentialEquations
const g = 9.81
L = 1.0
tspan = (0.0, pi / 2)
function simplependulum!(du, u, p, t)
θ = u[1]
dθ = u[2]
du[1] = dθ
du[2] = -(g / L) * sin(θ)
end
function bc1!(residual, u, p, t)
residual[1] = u[end ÷ 2][1] + pi / 2 # the solution at the middle of the time span should be -pi/2
residual[2] = u[end][1] - pi / 2 # the solution at the end of the time span should be pi/2
end
bvp1 = BVProblem(simplependulum!, bc1!, [pi / 2, pi / 2], tspan)
ivp1! = ODEProblem(simplependulum!,[pi/4,0],tspan)
sol1 = solve(bvp1, MIRK4(), dt = 0.05)
sol2 = solve(ivp1!)
println(sol1(0.81))
println(sol1(0.81,Val{1}))
println(sol2(0.81))
println(sol2(0.81,Val{1}))
Describe the bug 🐞
The interpolated solution from using the MIRK4 method to solve a BVProblem seems to be bugged. I can not access the derivatives of the solution like in the case of solutions to ODEProblems using the method given here: https://discourse.julialang.org/t/differentialequations-and-derivatives-of-solutions/49995/2. I just get the value of the solution at time t and not its derivative at time t.
Expected behavior
For a solution
sol
to a system of ODEs x'(t) = f(x(t)) with boundary conditions specified, get the derivatives of each component with respect to time usingsol(t,Val{1})
Minimal Reproducible Example 👇
Error & Stacktrace ⚠️ No errors
Environment:
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()