ModelingToolkit.jl
ModelingToolkit.jl copied to clipboard
Cannot add both default value and description to variables created in multiline statements (but parameters work).
Simple MWE:
using ModelingToolkit
@parameters begin
p = 1.0, [description="A parameter."]
end # Works
@variables t X(t) = 1.0 [description="A variable."] # Works
@variables begin
t
X(t) = 1.0, [description="A variable."]
end # ERROR: syntax: misplaced assignment statement in "[description = "A variable."]" around
Vanilla @variables
doesn't support that; I'll see how that can be added.
But note that inside the @mtkmodel
, such a thing just works.
Sounds good. There are quite a few situations where one uses this outside of @mtkmodel
. Especially if you have a lot statements like this, things become unreadable without begin ... end
blocks. This is not very urgent, but definitely something it would be good to fix sooner rather than later.