Skip to content

Indexing a solution at a time point using idxs and tuple fails #711

@TorkelE

Description

@TorkelE

MWE:

using ModelingToolkit, OrdinaryDiffEq
using ModelingToolkit: t_nounits as t, D_nounits as D

@parameters p d 
@variables X(t) Y(t)
eqs = [
    D(X) ~ p - d*X,
    Y ~ X + 1
]
@mtkbuild osys = ODESystem(eqs, t)

u0 = [X => 1.0, Y => 1.0]
tspan = (0.0, 100.0)
ps = [p => 1.0, d => 0.1]

oprob = ODEProblem(osys, u0, tspan, ps)
osol = solve(oprob)

# Yields `ERROR: Incorrect specification of `idxs``
osol(0.0; idxs=(X, Y))
osol(0.0; idxs=(osys.X, osys.Y))
osol(0.0; idxs=(:X, :Y))

# All works
osol[(X, Y)]
osol[(osys.X, osys.Y)]
osol[(:X, :Y)]

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