Opened 5 years ago

Last modified 5 years ago

#5552 new defect

OpenModelica FMUs seem to not report exact continuous states

Reported by: dafred4991@… Owned by: Lennart Ochel
Priority: high Milestone: 2.0.0
Component: FMI Version: v1.14.0-dev-nightly
Keywords: FMU, fmpy Cc:

Description

When compiling a simple model to a CoSimulation (cs) FMU using "OpenModelica v1.14.0-dev-26515-g3e60c14bfc (64-bit)", the solution to the continuous states after the next fmi2doStep seems to depend on whether or not the continuous states have been set to what fmi2getReal reports for the individual states using fmi2setReal.

So, it makes a difference for the next continuous state if you extract the current continous state, save it, and then set it to what was just saved.

I'm attaching a Python 3 script to demonstrate this issue using the model "Modelica.Blocks.Examples.PID_Controller". The script assumes the corresponding .fmu file to be in the current working directory (see line 26).

Attachments (3)

bug_demo.py (3.2 KB ) - added by dafred4991@… 5 years ago.
Python 3 script to demonstrate the issue explained in the ticket
bug_demo.2.py (3.1 KB ) - added by dafred4991@… 5 years ago.
a programming error was fixed in the previous file (line 95) and another model was chosen (a version of Modelica.Mechanics.MultiBody.Examples.Rotational3DEffects.GyroscopicEffects)
Gyro3d.mo (169 bytes ) - added by dafred4991@… 5 years ago.
an example model still showing the described bug with bug_report.2.py

Download all attachments as: .zip

Change History (4)

by dafred4991@…, 5 years ago

Attachment: bug_demo.py added

Python 3 script to demonstrate the issue explained in the ticket

comment:1 by Francesco Casella, 5 years ago

Milestone: Future2.0.0

by dafred4991@…, 5 years ago

Attachment: bug_demo.2.py added

a programming error was fixed in the previous file (line 95) and another model was chosen (a version of Modelica.Mechanics.MultiBody.Examples.Rotational3DEffects.GyroscopicEffects)

by dafred4991@…, 5 years ago

Attachment: Gyro3d.mo added

an example model still showing the described bug with bug_report.2.py

Note: See TracTickets for help on using tickets.