Skip to content

Plotting does not work if system does not have dynamicsΒ #1044

@asinghvi17

Description

@asinghvi17

Describe the bug 🐞

I have a sine oscillator with only observed quantities, no dynamics or differential equations. Plotting doesn't work here.

Expected behavior

Something should be plotted.

Minimal Reproducible Example πŸ‘‡

MWE is in comment number 2 (note it's BSD-3 code so fine to distribute)

Error & Stacktrace ⚠️

julia> lines(sol)
ERROR: BoundsError: attempt to access 0-element Vector{Tuple} at index [1]
Stacktrace:
  [1] throw_boundserror(A::Vector{Tuple}, I::Tuple{Int64})
    @ Base ./essentials.jl:14
  [2] getindex
    @ ./essentials.jl:916 [inlined]
  [3] diffeq_to_arrays(sol::SciMLBase.ODESolution{…}, plot_analytic::Bool, denseplot::Bool, plotdensity::Int64, tspan::Nothing, vars::Vector{…}, tscale::Symbol, plotat::Nothing)
    @ SciMLBase ~/.julia/packages/SciMLBase/Ha7rZ/src/solutions/solution_interface.jl:453
  [4] convert_arguments(PT::Type{…}, sol::SciMLBase.ODESolution{…}; plot_analytic::Bool, denseplot::MakieCore.Automatic, plotdensity::MakieCore.Automatic, plotat::Nothing, tspan::Nothing, tscale::Symbol, vars::Nothing, idxs::Nothing)
    @ SciMLBaseMakieExt ~/.julia/packages/SciMLBase/Ha7rZ/ext/SciMLBaseMakieExt.jl:108
  [5] convert_arguments(PT::Type{…}, sol::SciMLBase.ODESolution{…})
    @ SciMLBaseMakieExt ~/.julia/packages/SciMLBase/Ha7rZ/ext/SciMLBaseMakieExt.jl:38

Environment (please complete the following information):
MTK v9 but otherwise irrelevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions