The main difference between section algorithmand section equationis that each equation in a section is equationused to model the model. In the section algorithm, you have assignment operators that are required. This means that you can overwrite the influence of a previous assignment. As a concrete example, in the following section equation:
equation
a = b;
a = c;
. . , , algorithm
algorithm
a := b;
a := c;
.
" ", . algorithm . . , , . :
algorithm
sum := 0;
prod := 1;
for i in 1:10 loop
sum := sum + x[i];
prod := prod * x[i];
end for;
sum prod . , , , :
algorithm
sum := 1+2+3+4+5+6+7+8+9+10;
prod := 1*2*3*4*5*6*7*8*9*10;
... ...
equation
sum = 1+2+3+4+5+6+7+8+9+10;
prod = 1*2*3*4*5*6*7*8*9*10;
equation. equation:
equation
sum = 0;
for i in 1:10 loop
sum = sum + i;
, 11 :
equation
sum = 0;
sum = sum + 1;
sum = sum + 2;
...
sum = sum + 10;
, 11 ! , .
, , algorithm , , , . , , - "" . equation .
P.S. - Modelica , , , , . , . Modelica, , . Modelica equation algorithm, . .