You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code produces an incorrectly namespaced parameter constant₊k [defaults to constant₊k2[1]]. The correct answer should be
constant₊k [defaults to k2[1]]
using ModelingToolkitStandardLibrary.Blocks
@parameters t
D =Differential(t)
functionFML2(; name)
@parametersbegin
k2[1:1] = [1.0]
end
systems =@namedbegin
constant =Constant(k = k2[1])
end@variablesbeginx(t) =0end
eqs = [
D(x) ~ constant.output.u + k2[1]
]
ODESystem(eqs, t; systems, name)
end@named model =FML2()
ssys =structural_simplify((model))
julia> ssys =structural_simplify((model))
Model model with 1 equations
States (1):x(t) [defaults to 0]
Parameters (2):
k2[1] [defaults to 1.0]
constant₊k [defaults to constant₊k2[1]]: Constant output value of block
Incidence matrix:1×2 SparseArrays.SparseMatrixCSC{Num, Int64} with 1 stored entry:⋅×
This error leads to subsequent
julia> prob =ODEProblem(ssys, [], (0, 10))
ERROR: ArgumentError: Any[constant₊k2[1]] are either missing from the variable map or missing from the system's states/parameters list.
Stacktrace:
The problem appears related to k2 being an array
The text was updated successfully, but these errors were encountered:
The following code produces an incorrectly namespaced parameter
constant₊k [defaults to constant₊k2[1]]
. The correct answer should beThis error leads to subsequent
The problem appears related to
k2
being an arrayThe text was updated successfully, but these errors were encountered: