Exercise 1 - Quiz

1 Question

What is a keyword?


A keyword is a reserved word that cannot be used as a name of some entity in a model.

2 Question

What is so special about those?


Because they are reserved for constructing elements in the Modelica language, they cannot be used as identifiers, e.g., cannot be used as a variable name, class name, type name, etc..

3 Question

Name some keywords that you have come across.


For example: end, class, and, connect, else and parameter. But there are over 40 of them, so you can find many more.

4 Question

Certainly you have by now come across some of the predefined types of Modelica, if not all of them. Which are they?


Real, Integer, Boolean and String.

5 Question

What is a literal constant?


An unnamed constant that has different form depending on their type.

6 Question

Give an example of a literal constant.


true, one of the two Boolean literal values.

7 Question

Describe what the variability of an expression means.


The freedom of the expression to change value during simulation.

8 Question

Which are the degrees of expression variability? Describe the properties of the expressions having the different degrees.


The degrees of variability are constant, parameter, discrete-time and continuous-time variability.

Constant expressions
have constant variability, i.e. never change value. In constant expressions the time derivative is equal to zero.
Parameter expressions
have parameter variability, remain constant during time-dependent simulation and have time derivative equal to zero.

Discrete-time expressions:
They have discrete-time variability meaning that they are piecewise constant and change their values only at event instants during simulation.
Time derivative is equal to zero.
These expressions may include constant or parameter expressions or discrete-time variables, as well as applications of operators and functions with discrete-time arguments.

Continuous-time expressions:
They have continuous-time variability and may change their values at any time during simulation.
They may include constant, parameter and discrete-time expressions as well as continuous-time Real variables, as well as applications of operators and functions.