Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR with callback: attempt to access 1-element view(::Vector{Float64}, 1:1) with eltype Float64 at index [-1] #798

Closed
rveltz opened this issue Sep 3, 2021 · 3 comments · Fixed by SciML/DiffEqBase.jl#728

Comments

@rveltz
Copy link

rveltz commented Sep 3, 2021

Hi,

I am sorry if this is not really a MWE.

I am trying to compute the Poincare section of a simple ODE with flow phi(t,x). I have a section Σ and I write t(x) the hitting time of Σ from initial condition x. So basically, I want to compute phi(t(x),x) - x. This is accomplished in the callable struct probPsh below.

using Revise, Plots
using OrdinaryDiffEq, ForwardDiff, Test
	using BifurcationKit, LinearAlgebra, Parameters, Setfield
	const BK = BifurcationKit
	const FD = ForwardDiff

function Fsl!(f, u, p, t)
	@unpack r, μ, ν, c3, c5 = p
	u1 = u[1]
	u2 = u[2]

	ua = u1^2 + u2^2

	f[1] = r * u1 - ν * u2 - ua * (c3 * u1 - μ * u2) - c5 * ua^2 * u1
	f[2] = r * u2 + ν * u1 - ua * (c3 * u2 + μ * u1) - c5 * ua^2 * u2
	return f
end
Fode(f, x, p, t) = Fsl!(f, x, p, t)

par_sl = (r = 0.5, μ = 0., ν = 1.0, c3 = 1.0, c5 = 0.0,)
u0 = [.001, .001]

normals = [[-1., 0.]]
centers = [zeros(2)]


par_hopf = (@set par_sl.r = 0.1)
prob = ODEProblem(Fode, u0, (0., 100.), par_hopf)

probPsh = PoincareShootingProblem(2, par_hopf,prob, Rodas4(), normals, centers; rtol = abstol=1e-10, reltol=1e-9)

This works probPsh([0.30429879744900434], par_hopf) but if I change a tiny bit the parameters

probPsh([0.30429879744900434], @set par_hopf.r = 0.09243096156871472)

I get the error below. Note that ypu get the same error by doing probPsh.flow([0.0, 0.30429879744900434], (@set par_hopf.r = 0.09243096156871472), Inf64) which is more or less a direct call to DiffEq.solve

ERROR: BoundsError: attempt to access 1-element view(::Vector{Float64}, 1:1) with eltype Float64 at index [-1]
Stacktrace:
  [1] throw_boundserror(A::SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true}, I::Tuple{Int64})
    @ Base ./abstractarray.jl:651
  [2] checkbounds
    @ ./abstractarray.jl:616 [inlined]
  [3] getindex
    @ ./subarray.jl:308 [inlined]
  [4] allowed_getindex
    @ ~/.julia/packages/ArrayInterface/CYf5x/src/ArrayInterface.jl:201 [inlined]
  [5] find_callback_time(integrator::OrdinaryDiffEq.ODEIntegrator{Rodas4{2, true, DefaultLinSolve, Val{:forward}}, true, Vector{Float64}, Nothing, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, Float64, Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Rodas4{2, true, DefaultLinSolve, Val{:forward}}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.Rodas4Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEq.RodasTableau{Float64, Float64}, SciMLBase.TimeGradientWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, DefaultLinSolve, SparseDiffTools.ForwardColorJacCache{Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 2}}, Vector{Float64}, Vector{Vector{Tuple{Float64, Float64}}}, UnitRange{Int64}, Nothing}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.TimeGradientWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 1}}}}, DiffEqBase.DEStats}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.Rodas4Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEq.RodasTableau{Float64, Float64}, SciMLBase.TimeGradientWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, DefaultLinSolve, SparseDiffTools.ForwardColorJacCache{Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 2}}, Vector{Float64}, Vector{Vector{Tuple{Float64, Float64}}}, UnitRange{Int64}, Nothing}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.TimeGradientWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 1}}}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(opnorm), Nothing, CallbackSet{Tuple{VectorContinuousCallback{BifurcationKit.var"#pSection#900"{SectionPS{Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}}, BifurcationKit.var"#affect!#901", Nothing, typeof(DiffEqBase.INITIALIZE_DEFAULT), typeof(DiffEqBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, DiffEqBase.CallbackCache{Vector{Float64}, Vector{Float64}}, OrdinaryDiffEq.DefaultInit}, callback::VectorContinuousCallback{BifurcationKit.var"#pSection#900"{SectionPS{Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}}, BifurcationKit.var"#affect!#901", Nothing, typeof(DiffEqBase.INITIALIZE_DEFAULT), typeof(DiffEqBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}, counter::Int64)
    @ DiffEqBase ~/.julia/packages/DiffEqBase/WKucm/src/callbacks.jl:789
  [6] find_first_continuous_callback
    @ ~/.julia/packages/DiffEqBase/WKucm/src/callbacks.jl:466 [inlined]
  [7] handle_callbacks!
    @ ~/.julia/packages/OrdinaryDiffEq/ajk4M/src/integrators/integrator_utils.jl:249 [inlined]
  [8] _loopfooter!(integrator::OrdinaryDiffEq.ODEIntegrator{Rodas4{2, true, DefaultLinSolve, Val{:forward}}, true, Vector{Float64}, Nothing, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, Float64, Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Rodas4{2, true, DefaultLinSolve, Val{:forward}}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.Rodas4Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEq.RodasTableau{Float64, Float64}, SciMLBase.TimeGradientWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, DefaultLinSolve, SparseDiffTools.ForwardColorJacCache{Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 2}}, Vector{Float64}, Vector{Vector{Tuple{Float64, Float64}}}, UnitRange{Int64}, Nothing}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.TimeGradientWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 1}}}}, DiffEqBase.DEStats}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.Rodas4Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEq.RodasTableau{Float64, Float64}, SciMLBase.TimeGradientWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, DefaultLinSolve, SparseDiffTools.ForwardColorJacCache{Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 2}}, Vector{Float64}, Vector{Vector{Tuple{Float64, Float64}}}, UnitRange{Int64}, Nothing}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.TimeGradientWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 1}}}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(opnorm), Nothing, CallbackSet{Tuple{VectorContinuousCallback{BifurcationKit.var"#pSection#900"{SectionPS{Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}}, BifurcationKit.var"#affect!#901", Nothing, typeof(DiffEqBase.INITIALIZE_DEFAULT), typeof(DiffEqBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, DiffEqBase.CallbackCache{Vector{Float64}, Vector{Float64}}, OrdinaryDiffEq.DefaultInit})
    @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/ajk4M/src/integrators/integrator_utils.jl:204
  [9] loopfooter!
    @ ~/.julia/packages/OrdinaryDiffEq/ajk4M/src/integrators/integrator_utils.jl:168 [inlined]
 [10] solve!(integrator::OrdinaryDiffEq.ODEIntegrator{Rodas4{2, true, DefaultLinSolve, Val{:forward}}, true, Vector{Float64}, Nothing, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, Float64, Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Rodas4{2, true, DefaultLinSolve, Val{:forward}}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.Rodas4Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEq.RodasTableau{Float64, Float64}, SciMLBase.TimeGradientWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, DefaultLinSolve, SparseDiffTools.ForwardColorJacCache{Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 2}}, Vector{Float64}, Vector{Vector{Tuple{Float64, Float64}}}, UnitRange{Int64}, Nothing}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.TimeGradientWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 1}}}}, DiffEqBase.DEStats}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.Rodas4Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEq.RodasTableau{Float64, Float64}, SciMLBase.TimeGradientWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, DefaultLinSolve, SparseDiffTools.ForwardColorJacCache{Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 2}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UJacobianWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 2}}, Vector{Float64}, Vector{Vector{Tuple{Float64, Float64}}}, UnitRange{Int64}, Nothing}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.TimeGradientWrapper{ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}}, Float64}, Float64, 1}}}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(opnorm), Nothing, CallbackSet{Tuple{VectorContinuousCallback{BifurcationKit.var"#pSection#900"{SectionPS{Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}}, BifurcationKit.var"#affect!#901", Nothing, typeof(DiffEqBase.INITIALIZE_DEFAULT), typeof(DiffEqBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, DiffEqBase.CallbackCache{Vector{Float64}, Vector{Float64}}, OrdinaryDiffEq.DefaultInit})
    @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/ajk4M/src/solve.jl:479
 [11] #__solve#471
    @ ~/.julia/packages/OrdinaryDiffEq/ajk4M/src/solve.jl:5 [inlined]
 [12] #solve_call#42
    @ ~/.julia/packages/DiffEqBase/WKucm/src/solve.jl:61 [inlined]
 [13] solve_up(prob::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, sensealg::Nothing, u0::Vector{Float64}, p::NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, args::Rodas4{0, true, DefaultLinSolve, Val{:forward}}; kwargs::Base.Iterators.Pairs{Symbol, Any, NTuple{4, Symbol}, NamedTuple{(:save_everystep, :callback, :rtol, :reltol), Tuple{Bool, VectorContinuousCallback{BifurcationKit.var"#pSection#900"{SectionPS{Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}}, BifurcationKit.var"#affect!#901", Nothing, typeof(DiffEqBase.INITIALIZE_DEFAULT), typeof(DiffEqBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}, Float64, Float64}}})
    @ DiffEqBase ~/.julia/packages/DiffEqBase/WKucm/src/solve.jl:87
 [14] #solve#43
    @ ~/.julia/packages/DiffEqBase/WKucm/src/solve.jl:73 [inlined]
 [15] flowTimeSol(x::Vector{Float64}, p::NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, tm::Float64, pb::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}; alg::Rodas4{0, true, DefaultLinSolve, Val{:forward}}, kwargs::Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:callback, :rtol, :reltol), Tuple{VectorContinuousCallback{BifurcationKit.var"#pSection#900"{SectionPS{Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}}, BifurcationKit.var"#affect!#901", Nothing, typeof(DiffEqBase.INITIALIZE_DEFAULT), typeof(DiffEqBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}, Float64, Float64}}})
    @ BifurcationKit ~/work/prog_gd/julia/dev/dev1/BifurcationKit/src/periodicorbit/Flow.jl:9
 [16] #flow#790
    @ ~/work/prog_gd/julia/dev/dev1/BifurcationKit/src/periodicorbit/Flow.jl:33 [inlined]
 [17] #821#822
    @ ~/work/prog_gd/julia/dev/dev1/BifurcationKit/src/periodicorbit/Flow.jl:157 [inlined]
 [18] #821
    @ ~/work/prog_gd/julia/dev/dev1/BifurcationKit/src/periodicorbit/Flow.jl:157 [inlined]
 [19] #_#814
    @ ~/work/prog_gd/julia/dev/dev1/BifurcationKit/src/periodicorbit/Flow.jl:143 [inlined]
 [20] (::Flow{Int64, BifurcationKit.var"#821#833"{BifurcationKit.var"#821#822#834"{Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:callback, :rtol, :reltol), Tuple{VectorContinuousCallback{BifurcationKit.var"#pSection#900"{SectionPS{Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}}, BifurcationKit.var"#affect!#901", Nothing, typeof(DiffEqBase.INITIALIZE_DEFAULT), typeof(DiffEqBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}, Float64, Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Rodas4{0, true, DefaultLinSolve, Val{:forward}}}}, BifurcationKit.var"#823#835"{BifurcationKit.var"#823#824#836"{Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:callback, :rtol, :reltol), Tuple{VectorContinuousCallback{BifurcationKit.var"#pSection#900"{SectionPS{Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}}, BifurcationKit.var"#affect!#901", Nothing, typeof(DiffEqBase.INITIALIZE_DEFAULT), typeof(DiffEqBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}, Float64, Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Rodas4{0, true, DefaultLinSolve, Val{:forward}}}}, BifurcationKit.var"#825#837"{BifurcationKit.var"#825#826#838"{Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:callback, :rtol, :reltol), Tuple{VectorContinuousCallback{BifurcationKit.var"#pSection#900"{SectionPS{Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}}, BifurcationKit.var"#affect!#901", Nothing, typeof(DiffEqBase.INITIALIZE_DEFAULT), typeof(DiffEqBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}, Float64, Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Rodas4{0, true, DefaultLinSolve, Val{:forward}}}}, BifurcationKit.var"#827#839"{BifurcationKit.var"#827#828#840"{Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:callback, :rtol, :reltol), Tuple{VectorContinuousCallback{BifurcationKit.var"#pSection#900"{SectionPS{Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}}, BifurcationKit.var"#affect!#901", Nothing, typeof(DiffEqBase.INITIALIZE_DEFAULT), typeof(DiffEqBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}, Float64, Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Rodas4{0, true, DefaultLinSolve, Val{:forward}}}}, BifurcationKit.var"#829#841"{BifurcationKit.var"#829#830#842"{Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:callback, :rtol, :reltol), Tuple{VectorContinuousCallback{BifurcationKit.var"#pSection#900"{SectionPS{Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}}, BifurcationKit.var"#affect!#901", Nothing, typeof(DiffEqBase.INITIALIZE_DEFAULT), typeof(DiffEqBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}, Float64, Float64}}}, Rodas4{0, true, DefaultLinSolve, Val{:forward}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Nothing, BifurcationKit.var"#831#843"{BifurcationKit.var"#831#832#844"{Base.Iterators.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:callback, :rtol, :reltol), Tuple{VectorContinuousCallback{BifurcationKit.var"#pSection#900"{SectionPS{Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}}}, BifurcationKit.var"#affect!#901", Nothing, typeof(DiffEqBase.INITIALIZE_DEFAULT), typeof(DiffEqBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}, Float64, Float64}}}, Rodas4{0, true, DefaultLinSolve, Val{:forward}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, ODEFunction{true, typeof(Fode), UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}}})(x::Vector{Float64}, p::NamedTuple{(:r, :μ, :ν, :c3, :c5), NTuple{5, Float64}}, t::Float64)
    @ BifurcationKit ~/work/prog_gd/julia/dev/dev1/BifurcationKit/src/periodicorbit/Flow.jl:143
 [21] top-level scope
    @ ~/.julia/packages/Setfield/NshXm/src/sugar.jl:192
@ChrisRackauckas
Copy link
Member

This should be fixed in DiffEqBase v6.73.2

@rveltz
Copy link
Author

rveltz commented Sep 4, 2021

I am not sure, I get:

julia> probPsh.flow([0.0, 0.30429879744900434], (@set par_hopf.r = 0.09243096156871472), Inf64) # this gives an error in DiffEqBase
ERROR: Callback handling failed. Please file an issue with code to reproduce.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] find_callback_time(integrator::OrdinaryDiffEq.ODEIntegrator{Rodas4{2, true, DefaultLinSolve, Val{:forward}}, true, Vector{Float64}, Nothing, Float64, NamedTuple{(:r, , , :c3, :c5), NTuple{5, Float64}}, Float64, Float64, Float64, Float64, Vector{Vector{Float64}}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, NamedTuple{(:r, 

@rveltz
Copy link
Author

rveltz commented Nov 16, 2021

In BifurcationKit 1.8.0, the call has changed to

probPsh = PoincareShootingProblem(prob, Rodas4(), normals, centers; rtol = abstol=1e-10, reltol=1e-9)

but the error remains the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants