I offer here a quasi-minimal example of the latest iterator failure.
I also tried the RadauIIA3 solver, getting the same result.
By the way, there seems to be two different versions of the RadauIIA5 solver with the same name — one in BoundaryValueDiffEq, and one in OrdinaryDiffEqFIRK that is incomparible with BVProblem.
Only the last 2 lines of this are important — most of the rest is context.
using BoundaryValueDiffEq
function f!(dy_dr, y, par, t)
y1, y2 = y
par1, par2 = par
dy_dt[1] = 2*y1 + t*par1
dy_dt[2] = 3*y2 - t/par2
dy_dt
end
function initialGuess(t)
# Would be nice to have access here to parameters in par, as in bc!
guess1 = t^2
guess2 = t^3
[guess1, guess2]
end
function bc!(resid, y, par, t)
# y[1,i] & y[2,i] were evaluated at t[i]
par1, par2 = par
resid[1] = abs(y[1,1] - par1)
resid[2] = abs(y[2,end] - par2)
end
tspan = (0.0, 50.0)
par = (1.0, 2.0)
bvp = BVProblem(f!, bc!, initialGuess, tspan, par)
sol = solve(bvp, RadauIIA5(); abstol=1e-2, reltol=1e-2)
which produced this…
**ERROR:** LoadError: ArgumentError: Package BoundaryValueDiffEqFIRK not found in current path.
- Run `import Pkg; Pkg.add("BoundaryValueDiffEqFIRK")` to install the BoundaryValueDiffEqFIRK package.
Stacktrace:
[1] **macro expansion**
@ ./loading.jl:2296 [inlined]
[2] **macro expansion**
@ ./lock.jl:273 [inlined]
[3] **__require(**into::Module, mod::Symbol**)**
@ Base ./loading.jl:2271
[4] **#invoke_in_world#3**
@ ./essentials.jl:1089 [inlined]
[5] **invoke_in_world**
@ ./essentials.jl:1086 [inlined]
[6] **require(**into::Module, mod::Symbol**)**
@ Base ./loading.jl:2260
[7] **include(**fname::String**)**
@ Main ./sysimg.jl:38
[8] top-level scope
@ REPL[366]:1
in expression starting at /Users/andy 1/Applications/Julia/RealisticSeismology-main/BVProblem,Example1.jl:2
**julia>** include("../../../BVProblem,Example1.jl")
**ERROR:** LoadError: MethodError: no method matching iterate(::typeof(initialGuess))
The function `iterate` exists, but no method is defined for this combination of argument types.
Closest candidates are:
iterate(::Expronicon.JLMatch)
@ Expronicon ~/.julia/packages/Expronicon/Oa1rJ/src/match.jl:139
iterate(::Expronicon.JLMatch, ::Any)
@ Expronicon ~/.julia/packages/Expronicon/Oa1rJ/src/match.jl:139
iterate(::DataStructures.EnumerateAll)
@ DataStructures ~/.julia/packages/DataStructures/95DJa/src/multi_dict.jl:98
...
Stacktrace:
[1] **isempty(**itr::Function**)**
@ Base ./essentials.jl:1121
[2] **norm(**itr::Function, p::Int64**)**
@ LinearAlgebra ~/.julia/juliaup/julia-1.11.2+0.x64.apple.darwin14/share/julia/stdlib/v1.11/LinearAlgebra/src/generic.jl:602
[3] **ODE_DEFAULT_NORM(**u::Function, t::Float64**)**
@ DiffEqBase ~/.julia/packages/DiffEqBase/slKc5/src/common_defaults.jl:83
[4] **__init(**prob::BVProblem{…}, alg::RadauIIA5{…}, timeseries_init::Tuple{}, ts_init::Tuple{}, ks_init::Tuple{}, recompile::Type{…}; saveat::Tuple{}, tstops::Tuple{}, d_discontinuities::Tuple{}, save_idxs::Nothing, save_everystep::Bool, save_on::Bool, save_start::Bool, save_end::Nothing, callback::Nothing, dense::Bool, calck::Bool, dt::Float64, dtmin::Float64, dtmax::Float64, force_dtmin::Bool, adaptive::Bool, gamma::Rational{…}, abstol::Float64, reltol::Float64, qmin::Rational{…}, qmax::Int64, qsteady_min::Int64, qsteady_max::Rational{…}, beta1::Nothing, beta2::Nothing, qoldinit::Rational{…}, controller::Nothing, fullnormalize::Bool, failfactor::Int64, maxiters::Int64, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), internalopnorm::typeof(opnorm), isoutofdomain::typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), unstable_check::typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), verbose::Bool, timeseries_errors::Bool, dense_errors::Bool, advance_to_tstop::Bool, stop_at_next_tstop::Bool, initialize_save::Bool, progress::Bool, progress_steps::Int64, progress_name::String, progress_message::typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), progress_id::Symbol, userdata::Nothing, allow_extrapolation::Bool, initialize_integrator::Bool, alias_u0::Bool, alias_du0::Bool, initializealg::OrdinaryDiffEqCore.DefaultInit, kwargs::@Kwargs{}**)**
@ OrdinaryDiffEqCore ~/.julia/packages/OrdinaryDiffEqCore/hCoet/src/solve.jl:326
[5] **__solve(**::BVProblem{…}, ::RadauIIA5{…}; kwargs::@Kwargs{…}**)**
@ OrdinaryDiffEqCore ~/.julia/packages/OrdinaryDiffEqCore/hCoet/src/solve.jl:6
[6] **solve_call(**_prob::BVProblem{…}, args::RadauIIA5{…}; merge_callbacks::Bool, kwargshandle::Nothing, kwargs::@Kwargs{…}**)**
@ DiffEqBase ~/.julia/packages/DiffEqBase/slKc5/src/solve.jl:612
[7] **solve_up(**prob::BVProblem{…}, sensealg::Nothing, u0::Function, p::Tuple{…}, args::RadauIIA5{…}; kwargs::@Kwargs{…}**)**
@ DiffEqBase ~/.julia/packages/DiffEqBase/slKc5/src/solve.jl:1080
[8] **solve(**prob::BVProblem{…}, args::RadauIIA5{…}; sensealg::Nothing, u0::Nothing, p::Nothing, wrap::Val{…}, kwargs::@Kwargs{…}**)**
@ DiffEqBase ~/.julia/packages/DiffEqBase/slKc5/src/solve.jl:1003
[9] top-level scope
@ ~/Applications/Julia/RealisticSeismology-main/BVProblem,Example1.jl:39
[10] **include(**fname::String**)**
@ Main ./sysimg.jl:38
[11] top-level scope
@ REPL[366]:1
in expression starting at /Users/andy 1/Applications/Julia/RealisticSeismology-main/BVProblem,Example1.jl:39
Some type information was truncated. Use `show(err)` to see complete types.