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

Seems to be a bug, but not sure... #14

Open
xuelx1 opened this issue Jan 23, 2024 · 1 comment
Open

Seems to be a bug, but not sure... #14

xuelx1 opened this issue Jan 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@xuelx1
Copy link

xuelx1 commented Jan 23, 2024

Describe the bug 🐞

Examples given, Birth-Death System and Telegraph Model, doesn't work well.

When I run Birth-Death System one line after another, it goes right until the last line "sol = solve(prob, Vern7())", and it comes" LoadError: BoundsError: attempt to access Tuple{Int64} at index [2]"

Same thing happens when I tried Telegraph Model, but this time, "ERROR: LoadError: BoundsError: attempt to access Tuple{Int64, Int64} at index [3]"

Error & Stacktrace ⚠️

ERROR: LoadError: BoundsError: attempt to access Tuple{Int64, Int64} at index [3]
Stacktrace:
  [1] getindex
    @ .\tuple.jl:31 [inlined]
  [2] getindex
    @ .\multidimensional.jl:98 [inlined]
  [3] macro expansion
    @ C:\Users\xlx\.julia\packages\RuntimeGeneratedFunctions\Yo8zx\src\RuntimeGeneratedFunctions.jl:163 [inlined]
  [4] macro expansion
    @ .\none:0 [inlined]
  [5] generated_callfunc
    @ .\none:0 [inlined]
  [6] (::RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:du, :u, :p, :t), FiniteStateProjection.var"#_RGF_ModTag", FiniteStateProjection.var"#_RGF_ModTag", (0xbf4759ff, 0xd5f410d0, 0xba16b9ab, 0x61ffe46e, 0xd93d7742), Expr})(::Matrix{Float64}, ::Matrix{Float64}, ::Vector{Float64}, ::Float64)
    @ RuntimeGeneratedFunctions C:\Users\xlx\.julia\packages\RuntimeGeneratedFunctions\Yo8zx\src\RuntimeGeneratedFunctions.jl:150
  [7] (::ODEFunction{true, SciMLBase.FullSpecialize, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:du, :u, :p, :t), FiniteStateProjection.var"#_RGF_ModTag", FiniteStateProjection.var"#_RGF_ModTag", (0xbf4759ff, 0xd5f410d0, 0xba16b9ab, 0x61ffe46e, 0xd93d7742), Expr}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing})(::Matrix{Float64}, ::Vararg{Any})
    @ SciMLBase C:\Users\xlx\.julia\packages\SciMLBase\szsYq\src\scimlfunctions.jl:2266
  [8] ode_determine_initdt(u0::Matrix{Float64}, t::Float64, tdir::Float64, dtmax::Float64, abstol::Float64, reltol::Float64, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), prob::ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, SciMLBase.FullSpecialize, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:du, :u, :p, :t), FiniteStateProjection.var"#_RGF_ModTag", FiniteStateProjection.var"#_RGF_ModTag", (0xbf4759ff, 0xd5f410d0, 0xba16b9ab, 0x61ffe46e, 0xd93d7742), Expr}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, integrator::OrdinaryDiffEq.ODEIntegrator{Vern7{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Matrix{Float64}, Nothing, Float64, Vector{Float64}, Float64, Float64, Float64, Float64, Vector{Matrix{Float64}}, ODESolution{Float64, 3, Vector{Matrix{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{Float64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, SciMLBase.FullSpecialize, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:du, :u, :p, :t), FiniteStateProjection.var"#_RGF_ModTag", FiniteStateProjection.var"#_RGF_ModTag", (0xbf4759ff, 0xd5f410d0, 0xba16b9ab, 0x61ffe46e, 0xd93d7742), Expr}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, Vern7{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, SciMLBase.FullSpecialize, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:du, :u, :p, :t), FiniteStateProjection.var"#_RGF_ModTag", FiniteStateProjection.var"#_RGF_ModTag", (0xbf4759ff, 0xd5f410d0, 0xba16b9ab, 0x61ffe46e, 0xd93d7742), Expr}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{Float64}}, Vector{Float64}, Vector{Vector{Matrix{Float64}}}, OrdinaryDiffEq.Vern7Cache{Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, DiffEqBase.Stats, Nothing}, ODEFunction{true, SciMLBase.FullSpecialize, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:du, :u, :p, :t), FiniteStateProjection.var"#_RGF_ModTag", FiniteStateProjection.var"#_RGF_ModTag", (0xbf4759ff, 0xd5f410d0, 0xba16b9ab, 0x61ffe46e, 0xd93d7742), Expr}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Vern7Cache{Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, 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{}}, Matrix{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit})
    @ OrdinaryDiffEq C:\Users\xlx\.julia\packages\OrdinaryDiffEq\FFFcA\src\initdt.jl:53
  [9] auto_dt_reset!
    @ C:\Users\xlx\.julia\packages\OrdinaryDiffEq\FFFcA\src\integrators\integrator_interface.jl:449 [inlined]
 [10] handle_dt!(integrator::OrdinaryDiffEq.ODEIntegrator{Vern7{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, true, Matrix{Float64}, Nothing, Float64, Vector{Float64}, Float64, Float64, Float64, Float64, Vector{Matrix{Float64}}, ODESolution{Float64, 3, Vector{Matrix{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Matrix{Float64}}}, ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, SciMLBase.FullSpecialize, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:du, :u, :p, :t), FiniteStateProjection.var"#_RGF_ModTag", FiniteStateProjection.var"#_RGF_ModTag", (0xbf4759ff, 0xd5f410d0, 0xba16b9ab, 0x61ffe46e, 0xd93d7742), Expr}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, Vern7{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{true, SciMLBase.FullSpecialize, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:du, :u, :p, :t), FiniteStateProjection.var"#_RGF_ModTag", FiniteStateProjection.var"#_RGF_ModTag", (0xbf4759ff, 0xd5f410d0, 0xba16b9ab, 0x61ffe46e, 0xd93d7742), Expr}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{Matrix{Float64}}, Vector{Float64}, Vector{Vector{Matrix{Float64}}}, OrdinaryDiffEq.Vern7Cache{Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}}, DiffEqBase.Stats, Nothing}, ODEFunction{true, SciMLBase.FullSpecialize, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:du, :u, :p, :t), FiniteStateProjection.var"#_RGF_ModTag", FiniteStateProjection.var"#_RGF_ModTag", (0xbf4759ff, 0xd5f410d0, 0xba16b9ab, 0x61ffe46e, 0xd93d7742), Expr}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Vern7Cache{Matrix{Float64}, Matrix{Float64}, Matrix{Float64}, typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, 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{}}, Matrix{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit})
    @ OrdinaryDiffEq C:\Users\xlx\.julia\packages\OrdinaryDiffEq\FFFcA\src\solve.jl:555
 [11] __init(prob::ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, SciMLBase.FullSpecialize, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:du, :u, :p, :t), FiniteStateProjection.var"#_RGF_ModTag", FiniteStateProjection.var"#_RGF_ModTag", (0xbf4759ff, 0xd5f410d0, 0xba16b9ab, 0x61ffe46e, 0xd93d7742), Expr}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, alg::Vern7{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, timeseries_init::Tuple{}, ts_init::Tuple{}, ks_init::Tuple{}, recompile::Type{Val{true}}; 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::Nothing, dtmax::Float64, force_dtmin::Bool, adaptive::Bool, gamma::Rational{Int64}, abstol::Nothing, reltol::Nothing, qmin::Rational{Int64}, qmax::Int64, qsteady_min::Int64, qsteady_max::Int64, beta1::Nothing, beta2::Nothing, qoldinit::Rational{Int64}, controller::Nothing, fullnormalize::Bool, failfactor::Int64, maxiters::Int64, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), internalopnorm::typeof(LinearAlgebra.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::OrdinaryDiffEq.DefaultInit, kwargs::@Kwargs{})
    @ OrdinaryDiffEq C:\Users\xlx\.julia\packages\OrdinaryDiffEq\FFFcA\src\solve.jl:517
 [12] __init (repeats 5 times)
    @ C:\Users\xlx\.julia\packages\OrdinaryDiffEq\FFFcA\src\solve.jl:10 [inlined]
 [13] #__solve#740
    @ C:\Users\xlx\.julia\packages\OrdinaryDiffEq\FFFcA\src\solve.jl:5 [inlined]
 [14] __solve
    @ C:\Users\xlx\.julia\packages\OrdinaryDiffEq\FFFcA\src\solve.jl:1 [inlined]
 [15] solve_call(_prob::Any, args::Vararg{Any}; merge_callbacks::Any, kwargshandle::Any, kwargs...)
    @ DiffEqBase C:\Users\xlx\.julia\packages\DiffEqBase\s433k\src\solve.jl:559 [inlined]
 [16] solve_call
    @ C:\Users\xlx\.julia\packages\DiffEqBase\s433k\src\solve.jl:529 [inlined]
 [17] solve_up(prob::ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, SciMLBase.FullSpecialize, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:du, :u, :p, :t), FiniteStateProjection.var"#_RGF_ModTag", FiniteStateProjection.var"#_RGF_ModTag", (0xbf4759ff, 0xd5f410d0, 0xba16b9ab, 0x61ffe46e, 0xd93d7742), Expr}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, sensealg::Nothing, u0::Matrix{Float64}, p::Vector{Float64}, args::Vern7{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; kwargs::@Kwargs{})
    @ DiffEqBase C:\Users\xlx\.julia\packages\DiffEqBase\s433k\src\solve.jl:1020
 [18] solve_up
    @ DiffEqBase C:\Users\xlx\.julia\packages\DiffEqBase\s433k\src\solve.jl:993 [inlined]
 [19] #solve#40
    @ DiffEqBase C:\Users\xlx\.julia\packages\DiffEqBase\s433k\src\solve.jl:930 [inlined]
 [20] solve(prob::ODEProblem{Matrix{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, SciMLBase.FullSpecialize, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:du, :u, :p, :t), FiniteStateProjection.var"#_RGF_ModTag", FiniteStateProjection.var"#_RGF_ModTag", (0xbf4759ff, 0xd5f410d0, 0xba16b9ab, 0x61ffe46e, 0xd93d7742), Expr}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, args::Vern7{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False})
    @ DiffEqBase C:\Users\xlx\.julia\packages\DiffEqBase\s433k\src\solve.jl:920
 [21] top-level scope
    @ D:\HuaweiMoveData\Users\xlx\Desktop\创\julia\test2.jl:22

Environment (please complete the following information):

  • Output of using Pkg; Pkg.status()
Status `C:\Users\xlx\.julia\environments\v1.10\Project.toml`
⌅ [479239e8] Catalyst v12.3.2
⌃ [0c46a032] DifferentialEquations v7.10.0
⌅ [5b8099bc] DomainSets v0.5.15
  [069e79ea] FiniteStateProjection v0.2.1
  [7073ff75] IJulia v1.24.2
⌃ [961ee093] ModelingToolkit v8.46.1
⌃ [1dea7af3] OrdinaryDiffEq v6.58.2
⌅ [0c5d862f] Symbolics v4.14.0
Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated`
@xuelx1 xuelx1 added the bug Something isn't working label Jan 23, 2024
@kaandocal
Copy link
Collaborator

Hi @xuelx1, I think you ran into some versioning issue that should have been resolved much earlier. The updated version 0.3 of this package is out just now and should fix this - could you please try to re-run the code after updating FSP.jl and let me know if it works? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants