Skip to content

Symbolic arrays: NameState has no field symbolify #2720

@baggepinnen

Description

@baggepinnen
@variables x(t)[1:2] y(t)
eqs = [
    D(x) ~ -x
    y ~ sum(x.^2)
]
@mtkbuild sys = ODESystem(eqs, t)
prob = ODEProblem(sys, [x => [1.0, 2.0]], (0.0, 1.0))
julia> prob = ODEProblem(sys, [x => [1.0, 2.0]], (0.0, 1.0))
ERROR: type NameState has no field symbolify
Stacktrace:
  [1] getproperty
    @ ./Base.jl:37 [inlined]
  [2] toexpr(x::Symbolics.ArrayOp{AbstractVector{Real}}, st::SymbolicUtils.Code.NameState)
    @ Symbolics ~/.julia/packages/Symbolics/Eas9m/src/arrays.jl:993
  [3] (::SymbolicUtils.Code.var"#4#5"{SymbolicUtils.Code.NameState})(x::Symbolics.ArrayOp{AbstractVector{Real}})
    @ SymbolicUtils.Code ~/.julia/packages/SymbolicUtils/c0xQb/src/code.jl:187
  [4] iterate
    @ ./generator.jl:47 [inlined]
  [5] collect_to!(dest::Vector{…}, itr::Base.Generator{…}, offs::Int64, st::Int64)
    @ Base ./array.jl:892
  [6] collect_to!(dest::Vector{…}, itr::Base.Generator{…}, offs::Int64, st::Int64)
    @ Base ./array.jl:900
  [7] collect_to_with_first!(dest::Vector{…}, v1::Function, itr::Base.Generator{…}, st::Int64)
    @ Base ./array.jl:870
  [8] _collect(c::Vector{…}, itr::Base.Generator{…}, ::Base.EltypeUnknown, isz::Base.HasShape{…})
    @ Base ./array.jl:864
  [9] collect_similar(cont::Vector{Any}, itr::Base.Generator{Vector{…}, SymbolicUtils.Code.var"#4#5"{…}})
    @ Base ./array.jl:763
 [10] map(f::Function, A::Vector{Any})
    @ Base ./abstractarray.jl:3285
 [11] toexpr(O::SymbolicUtils.BasicSymbolic{Real}, st::SymbolicUtils.Code.NameState)
    @ SymbolicUtils.Code ~/.julia/packages/SymbolicUtils/c0xQb/src/code.jl:187
 [12] toexpr(a::SymbolicUtils.Code.Assignment, st::SymbolicUtils.Code.NameState)
    @ SymbolicUtils.Code ~/.julia/packages/SymbolicUtils/c0xQb/src/code.jl:97

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions