Opened 16 years ago

Last modified 13 years ago

#1097 closed defect (fixed)

Calculation of initialisation values

Reported by: Schubert TUD Owned by: Schubert TUD
Priority: high Milestone:
Component: Simulation Code Generation Version:
Keywords: Cc: Schubert TUD,

Description

Hi,

I found another strange behaviour of OpenModelica with respect to initialisation values which I would like to point out. Consider the following model:

model Test
  Real x;
  Real b(start = 1);
equation
  der(x) = 1;
  b = x;
end Test;


If you simulate this model, you will notice that b starts at 0 instead of 1. Writing Real x(fixed = false); instead of Real x yields an even more surprising result since then x starts at 0.5?!

Clearly, x is the state and I agree that one should not equip an algebraic variable like b with an initialisation value. However, due to the equality between b and x, it is very easy to derive the correct init value for x. I also cross checked with Dymola and there you get a warning that not all initial conditions are fully specified but it starts at x=1.

I think enhancing the calculation of initialisation values would improve usability of OpenModelica a lot.

Regards,

Christian Schubert

Change History (1)

comment:1 by Willi Braun, 14 years ago

works in trunk

Note: See TracTickets for help on using tickets.