Skip to content

Array operations inside @equations macro #3586

Open
@matthew-kapp

Description

@matthew-kapp

Question❓

Am I correct that array operations are not supported within the @mtkmodel macro yet? If not, is it planned to do so?

According to the docs it only mentions support for parameters and variables [https://docs.sciml.ai/ModelingToolkit/stable/basics/MTKLanguage/#Different-ways-to-define-symbolics-arrays:], so I assume it's not supported yet. Also, if I use for example, it works:

eqs =[
    [h[i] ~ h[i-1] + Q̇[i-1]/ṁ for i in 2:N_elements]
    ]

but this does not work:

@equations begin
    [h[i] ~ h[i-1] + Q̇[i-1]/ṁ for i in 2:N_elements]
 end

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions