When using interactive_evolution (and possibly other function that support idxs; I haven't tested them), the idxs parameter doesn't seem to behave correctly. When using DynamicalSystem's double pendulum system (param order is [θ₁,ω₁,θ₂,ω₂]) and attempting to graph both theta values, this is what I get:
julia> using GLMakie, DynamicalSystems, InteractiveDynamics
julia> ds = Systems.double_pendulum()
4-dimensional continuous dynamical system
state: [1.5708, 0.0, 0.0, 0.5]
rule f: doublependulum_rule
in-place? false
jacobian: ForwardDiff
parameters: [10.0, 1.0, 1.0, 1.0, 1.0]
julia> interactive_evolution(ds; idxs = [1, 3]);
juila> # Click "Step" ("run" does nothing):
Error in callback:
BoundsError: attempt to access Tuple{Float64, Float64} at index [3]
If I attempt to use a tuple for idxs instead, as sometimes suggested by the documentation (I assume either an Array or a Tuple is supposed to be fine), I get this type error:
When using
interactive_evolution
(and possibly other function that supportidxs
; I haven't tested them), theidxs
parameter doesn't seem to behave correctly. When using DynamicalSystem's double pendulum system (param order is[θ₁,ω₁,θ₂,ω₂]
) and attempting to graph both theta values, this is what I get:Stacktrace
```julia Stacktrace: [1] getindex @ ./tuple.jl:29 [inlined] [2] getindex @ ~/.julia/packages/StaticArrays/6D1fn/src/SArray.jl:94 [inlined] [3] (::InteractiveDynamics.var"#69#77"{typeof(identity), SVector{2, Int64}, Vector{Int64}, Int64, Observable{Vector{Point{2, Float32}}}, Vector{Observable}, SimpleDiffEq.SimpleATsit5Integrator{true, Vector{SVector{4, Float64}}, Float64, Vector{Float64}, SciMLBase.ODEFunction{true, DynamicalSystemsBase.var"#30#32"{ContinuousDynamicalSystem{false, SVector{4, Float64}, 4, typeof(DynamicalSystemsBase.Systems.doublependulum_rule), Vector{Float64}, DynamicalSystemsBase.var"#9#15"{typeof(DynamicalSystemsBase.Systems.doublependulum_rule)}, SMatrix{4, 4, Float64, 16}, true}, Int64}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, typeof(DynamicalSystemsBase._parallelnorm)}, Int64})(clicks::Int64) @ InteractiveDynamics ~/.julia/packages/InteractiveDynamics/NHT8Y/src/chaos/trajanim.jl:175 [4] #invokelatest#2 @ ./essentials.jl:716 [inlined] [5] invokelatest @ ./essentials.jl:714 [inlined] [6] notify @ ~/.julia/packages/Observables/OFj0u/src/Observables.jl:88 [inlined] [7] setindex!(observable::Observable{Any}, val::Int64) @ Observables ~/.julia/packages/Observables/OFj0u/src/Observables.jl:248 [8] (::Makie.MakieLayout.var"#615#625"{Observable{Symbol}, Observable{Any}})(#unused#::MouseEvent) @ Makie.MakieLayout ~/.julia/packages/Makie/lgPZh/src/makielayout/layoutables/button.jl:87 [9] (::Makie.MakieLayout.var"#30#31"{Makie.MakieLayout.var"#615#625"{Observable{Symbol}, Observable{Any}}})(event::MouseEvent) @ Makie.MakieLayout ~/.julia/packages/Makie/lgPZh/src/makielayout/mousestatemachine.jl:86 [10] #invokelatest#2 @ ./essentials.jl:716 [inlined] [11] invokelatest @ ./essentials.jl:714 [inlined] [12] (::Makie.PrioCallback)(val::MouseEvent) @ Makie ~/.julia/packages/Makie/lgPZh/src/interaction/PriorityObservable.jl:16 [13] #invokelatest#2 @ ./essentials.jl:716 [inlined] [14] invokelatest @ ./essentials.jl:714 [inlined] [15] notify(observable::Makie.PriorityObservable{MouseEvent}) @ Makie ~/.julia/packages/Makie/lgPZh/src/interaction/PriorityObservable.jl:84 [16] setindex! @ ~/.julia/packages/Makie/lgPZh/src/interaction/PriorityObservable.jl:78 [inlined] [17] (::Makie.MakieLayout.var"#100#102"{Scene, Base.RefValue{Bool}, Base.RefValue{Union{Nothing, Makie.Mouse.Button}}, Base.RefValue{Float64}, Base.RefValue{Float64}, Base.RefValue{Bool}, Base.RefValue{Bool}, Base.RefValue{Union{Nothing, Makie.Mouse.Button}}, Base.RefValue{Bool}, Base.RefValue{Point{2, Float32}}, Base.RefValue{Point{2, Float32}}, Base.RefValue{Makie.Mouse.Action}, Makie.PriorityObservable{MouseEvent}, Float64, Module})(event::Makie.MouseButtonEvent) @ Makie.MakieLayout ~/.julia/packages/Makie/lgPZh/src/makielayout/mousestatemachine.jl:259 [18] #invokelatest#2 @ ./essentials.jl:716 [inlined] [19] invokelatest @ ./essentials.jl:714 [inlined] [20] (::Makie.PrioCallback)(val::Makie.MouseButtonEvent) @ Makie ~/.julia/packages/Makie/lgPZh/src/interaction/PriorityObservable.jl:16 [21] #invokelatest#2 @ ./essentials.jl:716 [inlined] [22] invokelatest @ ./essentials.jl:714 [inlined] [23] notify(observable::Makie.PriorityObservable{Makie.MouseButtonEvent}) @ Makie ~/.julia/packages/Makie/lgPZh/src/interaction/PriorityObservable.jl:84 [24] setindex! @ ~/.julia/packages/Makie/lgPZh/src/interaction/PriorityObservable.jl:78 [inlined] [25] (::GLMakie.var"#mousebuttons#78"{Makie.PriorityObservable{Makie.MouseButtonEvent}})(window::GLFW.Window, button::GLFW.MouseButton, action::GLFW.Action, mods::Int32) @ GLMakie ~/.julia/packages/GLMakie/TfSB1/src/events.jl:89 [26] _MouseButtonCallbackWrapper(window::GLFW.Window, button::GLFW.MouseButton, action::GLFW.Action, mods::Int32) @ GLFW ~/.julia/packages/GLFW/BWxfF/src/callback.jl:43 [27] PollEvents @ ~/.julia/packages/GLFW/BWxfF/src/glfw3.jl:620 [inlined] [28] pollevents @ ~/.julia/packages/GLMakie/TfSB1/src/screen.jl:545 [inlined] [29] fps_renderloop(screen::GLMakie.Screen, framerate::Float64) @ GLMakie ~/.julia/packages/GLMakie/TfSB1/src/rendering.jl:21 [30] renderloop(screen::GLMakie.Screen; framerate::Float64) @ GLMakie ~/.julia/packages/GLMakie/TfSB1/src/rendering.jl:48 [31] renderloop(screen::GLMakie.Screen) @ GLMakie ~/.julia/packages/GLMakie/TfSB1/src/rendering.jl:41 [32] (::GLMakie.var"#56#58"{GLMakie.Screen})() @ GLMakie ./task.jl:429 ```If I attempt to use a tuple for idxs instead, as sometimes suggested by the documentation (I assume either an Array or a Tuple is supposed to be fine), I get this type error:
Versions: