When calling the MIRK solver on BVProblem with an initial guess of type MVector the solver returns a 'Failure' as return code.
Here's a MRE
using StaticArrays, BoundaryValueDiffEq
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 bc2a!(resid_a, u_a, p) # u_a is at the beginning of the time span
resid_a[1] = u_a[1] + pi / 2 # the solution at the beginning of the time span should be -pi/2
end
function bc2b!(resid_b, u_b, p) # u_b is at the ending of the time span
resid_b[1] = u_b[1] - pi / 2 # the solution at the end of the time span should be pi/2
end
#This is the same problem that appears in the docs, but using 'MVector' for the initial condition.
bvp_SA = TwoPointBVProblem(simplependulum!, (bc2a!, bc2b!), MVector{2}([pi / 2, pi / 2]), tspan;
bcresid_prototype = (zeros(1), zeros(1)))
sol_SA = solve(bvp_SA, MIRK4(), dt = 0.05)
println("Retcode using MVector: ", sol_SA.retcode) #This will printout 'Failure'
No Error is thrown, just a retcode: Failure
Environment:
Output of using Pkg; Pkg.status()
julia> using Pkg; Pkg.status()
Status `~/Temp/IssueBVPandStaticArrays/Project.toml`
⌃ [764a87c0] BoundaryValueDiffEq v5.7.1
[634d3b9d] DrWatson v2.15.0
⌃ [90137ffa] StaticArrays v1.9.4
Info Packages marked with ⌃ have new versions available and may be upgradable.
Output of using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
When calling the MIRK solver on BVProblem with an initial guess of type
MVector
the solver returns a 'Failure' as return code.Here's a MRE
No
Error
is thrown, just aretcode: Failure
Environment:
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
Additional context In this topic in Julia's discourse channel I give a bit more details of the parts of the MIRK solver that throw such error.