Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#5210 closed defect (fixed)

The back-end drops vectorized function calls coming from NF-flattened models

Reported by: Francesco Casella Owned by: Per Östlund
Priority: high Milestone: 2.0.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Please check Modelica.Fluid.Examples.Explanatory.MeasuringTemperature. The flattened model is balanced, but when finally getting to matching, the back-end complains about an unbalanced system

Error: Too few equations, under-determined system. The model has 164 equation(s) and 170 variable(s).

I managed to reproduced the problem with a simplified model where I removed some of the components, please find it attached for reference.

The old FE outputs this flattened equation

  openTankHot3.portInDensities[1] = Modelica.Fluid.Vessels.OpenTank$openTankHot3.Medium.density(Modelica.Fluid.Vessels.OpenTank$openTankHot3.Medium.setState_phX(openTankHot3.vessel_ps_static[1], junctionIdeal.port_2.h_outflow, {}, 0, 0));

while the NF flattens it to

  openTankHot3.portInDensities[1] = MeasuringTemperature4.openTankHot3.Medium.density(MeasuringTemperature4.openTankHot3.Medium.setState_phX(openTankHot3.vessel_ps_static[1], junctionIdeal.port_2.h_outflow, {}, 0, 0));

The backend processes the equation flattened by the OF correctly, and in fact the original system simulates successfully and passess verification.

When confronted with the equation generated by the NF, the normalInlineFunction module of the backend instead turns it into

51/51 (1): openTankHot3.portInDensities[1] = {}   [dynamic |0|0|0|0|] 

which is obviously wrong, and eventually causes the backend to fail.

I guess there is something missing in the data structure output by the NF which is not immediately apparent from the textural output, but which causes the inlining to fail.

I only carried out the analysis for this model, but I suspect that there are many others affected in the Fluid library and in all libraries (e.g. Buildings) using it.

Attachments (1)

MeasuringTemperature4.mo (3.5 KB ) - added by Francesco Casella 6 years ago.

Download all attachments as: .zip

Change History (4)

by Francesco Casella, 6 years ago

Attachment: MeasuringTemperature4.mo added

comment:1 by Per Östlund, 6 years ago

Resolution: fixed
Status: newclosed

Fixed in a391a807.

comment:2 by Francesco Casella, 6 years ago

We got 418 improvements and only 6 regressions, possibly combined with the other one mentioned in this report.

A small step for a men, a giant leap for OpenModelica :)

Last edited 6 years ago by Francesco Casella (previous) (diff)

comment:3 by Francesco Casella, 6 years ago

With these two commits the coverage of ThermoPower also improved dramatically. We now have 55/103 models simulating, up from 17/103 before the commits. I'm not sure which of the two did it, but it doesn't matter much.

Note: See TracTickets for help on using tickets.