Opened 18 years ago

Last modified 18 years ago

#83 closed defect (fixed)

Can't use a parameter to set the initial value of a state variable

Reported by: AlbertoLeva Owned by: AlbertoLeva
Priority: critical Milestone:
Component: Version:
Keywords: Cc: AlbertoLeva, Adrian Pop

Description


Change History (2)

comment:1 by AlbertoLeva, 18 years ago

Initialising with a start value given as parameter does not seem to work.
For example, in a model containing something like

model Tank
...
Modelica.SIunits.length level(start=l_start);
...
parameter Modelica.SIunits.length l_start=0 "initial tank level [m]";
...
end Tank;
...
Model Plant;
...
Tank Tank1(...,l_start=1,...);
...
end Plant;

the value of parameter l_start has no effect.

I have also tried to fill initial values in Plant_init.txt, as suggested in
http://www.ida.liu.se/~pelab/modelica/OpenModelica/releases/1.3.1/doc/OpenModelicaImplStatus-2005-10-11.html.
It didn't work too, as the default value (0 in the example above) seems to
override unconditionally.

Is it possible to have the parameter substituted as "start" value prior to the
compilation? Note that not having parametric initialisation (and also having to
tinker with a txt file each time) is very annoying when several instances of a
model have to be used, with different initial states (typical e.g. of
thermohydraulic models).

Thank you in advance for your attention.

comment:2 by Peter Aronsson, 18 years ago

This bug has been solved.

Note: See TracTickets for help on using tickets.