Skip to content

"each" missing? #15

@LeoGall

Description

@LeoGall

I didn't find a good example for using "each" in the Spec. Maybe it should be added to the WebRef?

Here's the most common use case for a vector of components (users can build this graphically):

model Unnamed
  Modelica.Blocks.Sources.Constant const[12];
  Modelica.Blocks.Continuous.FirstOrder firstOrder[12](T=1e-3);
equation 
  connect(const.y,firstOrder.u);
end Unnamed;

Dymola gives the following warning:

Check of Unnamed:
Automatically introducing 'each' in definition equation for variable:
firstOrder[1].T

To fix this, you have to

  • either use fill() in the parameter window
  • or go into the text layer and add "each" to the modification of T.

Result:

Modelica.Blocks.Continuous.FirstOrder firstOrder[12](each T=1e-3)

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions