### evaluation

#### Modelica Evaluation Order

I can't really find any answer in the Modelica specification so ill ask you guys. The specification states that A tool is free to solve equations, reorder expressions and to not evaluate expressions if their values do not influence the result (e.g. short-circuit evaluation of Boolean expressions). If-statements and if-expressions guarantee that their clauses are only evaluated if the appropriate condition is true, but relational operators generating state or time events will during continuous integration have the value from the most recent event. If a numeric operation overflows the result is undefined. For literals it is recommended to automatically convert the number to another type with greater precision. Now, I wonder, can the tool choose to evaluate an expression several time in an integrator step? For example (probably not an valid example, just to give you guys an idea of what I was wondering :) ) Real x; equation der(x) = -t; Modelica.Utilities.Streams.print(String(time)); This will print the same time for several times, so I figured that there is some kind of iteration going on. But I would really like to have it confirmed by some source.

That is normal. Variable step size solvers (like dassl) can go back and forth in time to find the direction of the curve. Also, if you have events more values can be generated at the same time. If you want to print time or values just at exact time instants you need when equations: when sample(0, 1) then Modelica.Utilities.Streams.print(String(time)); end when; Read more in the Modelica Spec about sample. Is also possible to use fixed step size solvers like Euler or so.

### Related Links

Math notation understanding

What criterias do you look for in a WAF (web application firewall)?

Predictionio evaluation fails with Text Classification template

Evaluation of APL direct functions

Modelica Evaluation Order

how compilers evaluate mathematical expressions? [closed]

What does “top-level evaluation” mean?

Boolean expression evaluation with a given context

Is relying on short-circuit evaluation good design? [closed]

Objectively evaluating new GUI toolkits

what are evaluation techniques for HCI projects (without involving users, or psychologist)?

Evaluating developers [closed]

Options to Common Criteria

What are some useful criteria for deciding on which software package to go for?

Having to set objectives for developers, even though objectives don't work [closed]

How would you go about evaluating a programmer? [closed]