Skip to content

ShiftIndex does not work for array variables #2843

@baggepinnen

Description

@baggepinnen
k = ShiftIndex(Clock(1))
@variables x(t)[1:2]


julia> x(k)
ERROR: MethodError: objects of type Symbolics.Arr{Num, 1} are not callable
Use square brackets [] for indexing an Array.┌ Error: Hint-handler #495 for MethodError in ControlSystemsBase caused an error
└ @ Base.Experimental experimental.jl:321

Stacktrace:
 [1] top-level scope
   @ REPL[47]:1

julia> x[1](k)
ERROR: Cannot shift an expression with multiple independent variables (x(t))[1].
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] (::Num)(k::ShiftIndex)
   @ ModelingToolkit ~/.julia/packages/ModelingToolkit/K7h8l/src/discretedomain.jl:206
 [3] top-level scope
   @ REPL[48]:1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions