Opened 17 years ago

Last modified 14 years ago

#137 closed defect (fixed)

Start values are not propagated correctly to the init_txt file

Reported by: Francesco Casella Owned by: Francesco Casella
Priority: critical Milestone:
Component: Simulation Code Generation Version: 1.4.3
Keywords: Cc: Francesco Casella, Adrian Pop

Description

See comments

Attachments (1)

Output.zip (5.3 KB ) - added by Francesco Casella 17 years ago.
Zip file with Modelica package SimpleFluid

Download all attachments as: .zip

Change History (3)

by Francesco Casella, 17 years ago

Attachment: Output.zip added

Zip file with Modelica package SimpleFluid

comment:1 by Francesco Casella, 17 years ago

Created an attachment (id=23)
Zip file with Modelica package SimpleFluid

In general, start values are critical for the success of the initialization phase, in particular for variables such as pressures and temperatures, where a value of zero causes numerical problems. In the attached test case, start values are defined at two levels:

  1. Basic types (defined in package Type), with non-zero defaults
  2. Specific models, using parameters to specify the start values of variables

Try simulating SimpleFluid.Examples.Test_Closed_SS_Extra: in the init_txt files, pressure and temperatures have zero values, instead of the correctly propagated values. The simulation starts because the start values were set at the exact values corresponding to the solution of the initial equations, so the initialization algorithms finds zero residuals and does nothing. However, if you try, e.g., Test_Closed_SS_Extra_NonExact, where just one start value was changed, the initialization algorithm fails badly (unrealistic temperatures are found).

I suspect this is due to the zero values in the init_txt files (even though I'm not 100% sure, because I have no debug info from the initialization procedure, so I don't know what the first iteration values actually are).

I would anyway fix the code generation so that the values in the init_txt file correctly match the start values.

comment:2 by Martin Sjölund, 14 years ago

This is fixed in trunk (although the attached package had a syntax error)

Note: See TracTickets for help on using tickets.