Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modelica (Dymola) Declaration with Formula - What Is This?

What type of declaration is this?

Real x = time^2;

I can put it in a model before any equation or algorithm section.

The issue for me is that it is not a static parameter, but rather it has a formula attached to it that works non-statically - the value is set every time step.

What kind of declaration is it? Short model or short function definition? New instances of a class? A 'type' class?

Any help (especially with a reference to either Fritzon's or Tiller's book) will help me sleep at night.

like image 921
Rocky Scott Avatar asked Dec 13 '25 07:12

Rocky Scott


2 Answers

That is a binding equation in a variable declaration and it will become a normal equation during compilation of the model. See https://modelica.org/documents/ModelicaSpec34.pdf, chapter 8.

like image 73
Adrian Pop Avatar answered Dec 15 '25 16:12

Adrian Pop


If you want to modify the variable the Dialog annotation might be convenient, e.g., Real x = time^2 annotation(Dialog);

like image 34
tbeu Avatar answered Dec 15 '25 16:12

tbeu