Let’s look at the List type from the previous example again. In that example, we had an AllElements method that returned a slice of all elements in the list. With Modelica iterators, we can do it better - as shown below.
To run this program, compile and simulate it using your Modelica-compliant environment.
The output will look something like this:
Now that we can run and build basic Modelica programs, let’s learn more about the language.