ModelingToolkit.jl icon indicating copy to clipboard operation
ModelingToolkit.jl copied to clipboard

Unintuitive behavior for including metadata in @parameters/@variables begin end

Open hstrey opened this issue 2 months ago • 0 comments

When declaring parameters using the new @mtkmodel DSL, one can either write: @parameters tau A or

@parameters begin
     tau
     A
end

Adding metadata to the parameters using begin end feels unintuitive: Here is what is in the documentation (seems intuitive) @parameters tau [tunable=true] A

I would have expected to write the following:

@parameters begin
          tau [tunable=true]
          A
end

but this does not work.

Instead, these two versions work:

@parameters begin
          tau, [tunable=true]
          A
end
@parameters begin
          tau
          [tunable=true]
          A
end

This syntax should at least be included in the documentation, but I would prefer the intuitive syntax if possible.

hstrey avatar Jun 05 '24 21:06 hstrey