I am trying to solve a number of ODEs for a set of variables (u_1, u_2, ..., u_6
) using MethodOfLines.jl
, but I get this error
MethodError: no method matching nameof(::SymbolicUtils.Term{SymbolicUtils.FnType{Tuple, Real}, Nothing})
Closest candidates are:
nameof(!Matched::SymbolicUtils.Sym) at C:\Users\User\.julia\packages\SymbolicUtils\v2ZkM\src\types.jl:144
nameof(!Matched::ModelingToolkit.AbstractSystem) at C:\Users\User\.julia\packages\ModelingToolkit\Uaky4\src\systems\abstractsystem.jl:140
nameof(!Matched::DataType) at C:\Users\User\AppData\Local\Programs\Julia-1.7.0\share\julia\base\reflection.jl:223
...
(::MethodOfLines.var"#12#27"{Nothing})(::SymbolicUtils.Term{Real, Base.ImmutableDict{DataType, Any}})@discretize_vars.jl:43
iterate@generator.jl:47[inlined]
_collect(::Vector{Any}, ::Base.Generator{Vector{Any}, MethodOfLines.var"#12#27"{Nothing}}, ::Base.EltypeUnknown, ::Base.HasShape{1})@array.jl:744
collect_similar(::Vector{Any}, ::Base.Generator{Vector{Any}, MethodOfLines.var"#12#27"{Nothing}})@array.jl:653
map(::Function, ::Vector{Any})@abstractarray.jl:2849
MethodOfLines.DiscreteSpace(::Vector{Symbolics.VarDomainPairing}, ::Vector{Any}, ::Vector{SymbolicUtils.Sym{Real, Base.ImmutableDict{DataType, Any}}}, ::MethodOfLines.MOLFiniteDifference{MethodOfLines.CenterAlignedGrid})@discretize_vars.jl:41
symbolic_discretize(::ModelingToolkit.PDESystem, ::MethodOfLines.MOLFiniteDifference{MethodOfLines.CenterAlignedGrid})@MOL_discretization.jl:37
discretize(::ModelingToolkit.PDESystem, ::MethodOfLines.MOLFiniteDifference{MethodOfLines.CenterAlignedGrid})@MOL_discretization.jl:120
top-level scope@Local: 45[inlined]
The error doesn’t show up, if I name the variables individually (@variables u_1, u_2, ..., u_6
). But I have a lot of functions that need to be iterated over to define the equations and boundary conditions, and that would not be convenient.
Any idea how I can deal with this?