using BoundaryValueDiffEq
using Plots
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
using OrdinaryDiffEq
u₀_2 = [-1.6, -1.7] # the initial guess
function bc3!(residual, sol, p, t)
residual[1] = sol(pi / 4)[1] + pi / 2 # use the interpolation here, since indexing will be wrong for adaptive methods
residual[2] = sol(pi / 2)[1] - pi / 2
end
bvp3 = BVProblem(simplependulum!, bc3!, u₀_2, tspan)
sol3 = solve(bvp3, Shooting(Vern7()))
which works as expected.
However, when I try to solve with MIRK4(), the solution interpolation in the BC does not seem to work. Is this expected?
sol3 = solve(bvp3, MIRK4(), dt=0.05)
MethodError: objects of type Vector{Vector{Float64}} are not callable
Use square brackets [] for indexing an Array.
Issue #107 looks to me as if it should be working?
I follow the simple pendulum example 3
which works as expected.
However, when I try to solve with MIRK4(), the solution interpolation in the BC does not seem to work. Is this expected?
Issue #107 looks to me as if it should be working?