Opened 5 years ago

Last modified 4 years ago

#5581 new defect

FMU - ME accuracy

Reported by: massimo ceraolo Owned by: Lennart Ochel
Priority: blocker Milestone: 2.0.0
Component: FMI Version: v1.14.0-dev-nightly
Keywords: Cc: Andreas Heuermann

Description (last modified by massimo ceraolo)

I'm not aware of possible reasons for which a simulation containing a FMU-ME created form a Modelica source should behave differently from a full-modelica simulation. Indeed I expect, at least in the simplest cases, perfect matching.

Consider the enclosed package fbSystemTest.mo. It contains:

  • fbSystem, a simple modelica model of a system to regulate the speed of the rotating inertia inertia1
  • fbSybSysDX, a part of fbSystem, with is used to create the enclosed fbSystemPkg.fbSubSysDX.fmu
  • fbSystemFMU, which corresponds to fbSystem, but contains the created fmu.

In principle the rotational speed of inertia1 should be the same when simulating fbSystem and fbSystemFMU. However, when everything is done with OpenModelica, significant differences are shown.
Note that if I use the same package fbSystemTest.mo to compare the two simulations, but do everything (including the fmu creation) with Dymola, no difference between the two simulations is shown. The values appear to be exactly the same, up to the last digit shown with numerical cursor.
These two behaviours can be checked looking at the enclosed "FMU issue.pdf", which compares plots from Dymola and from OM.

So I suppose there is a bug that causes the OM simulations not to have exactly the same values.

Attachments (3)

FMU issue.pdf (121.5 KB ) - added by massimo ceraolo 5 years ago.
fbSystemTest.mo (7.1 KB ) - added by massimo ceraolo 5 years ago.
fbSystemPkg.fbSubSysDX.fmu (592.6 KB ) - added by massimo ceraolo 5 years ago.

Download all attachments as: .zip

Change History (8)

by massimo ceraolo, 5 years ago

Attachment: FMU issue.pdf added

by massimo ceraolo, 5 years ago

Attachment: fbSystemTest.mo added

by massimo ceraolo, 5 years ago

Attachment: fbSystemPkg.fbSubSysDX.fmu added

comment:1 by Francesco Casella, 5 years ago

Priority: highblocker

comment:2 by massimo ceraolo, 5 years ago

Description: modified (diff)

comment:3 by massimo ceraolo, 5 years ago

The problem seems to be not in the FMU, but in the way the FMU is used when embedded in a Modelica model.
In fact, if the FMU created by OM is imported in Dymola and used in fbSystemFMU, no accuracy issue is evidenced.

comment:4 by Martin Sjölund, 5 years ago

The importFMU stuff indeed does not work nearly as well as OMSimulator

comment:5 by Andreas Heuermann, 4 years ago

Cc: Andreas Heuermann added
Note: See TracTickets for help on using tickets.