Expected behavior for simulations with no solutions

3 posts / 0 new
Last post
Joined: 2015-02-06
Expected behavior for simulations with no solutions

I'm curious about the behavior of an FMU when the equations do not contain a solution.  I had expected this case to always be handled with a return value from fmiDoStep as "fmiError", however I think I've found an instance where this isn't the case.  I'm attaching two models (and their corresponding FMUs) and the Python script I used to test this.  The model "NoSolutionLinear.mo" seems to give the expected response that it returns fmiError from do_step and the updated version of PyFMI (see below) correctly catches this.  With the model "NoSolution1.mo" I get a different error.  In this case the do_step method doesn't return fmiError but instead I get an error at the call: result_handler.integration_point() within the "solve" module of fmi_algorithm_drivers.py, with the following traceback that shows the error on the last line:

Message File Name Line Position
<module> C:\Users\jbg\projects\support\working\repo\generic\CoSimTerminateTest\mdl_nosol_test.py 56
run_demo C:\Users\jbg\projects\support\working\repo\generic\CoSimTerminateTest\mdl_nosol_test.py 42
pyfmi.fmi.FMUModelCS1.simulate (src\pyfmi\fmi.c:21970) fmi.pyx 2246
pyfmi.fmi.ModelBase._exec_simulate_algorithm (src\pyfmi\fmi.c:4896) fmi.pyx 292
solve C:\programs\JModelica\r7321\install\Python\pyfmi\fmi_algorithm_drivers.py 929
integration_point C:\programs\JModelica\r7321\install\Python\pyfmi\common\io.py 1875
pyfmi.fmi.FMUModelBase.get_real (src\pyfmi\fmi.c:9630) fmi.pyx 808
FMUException: Failed to get the Real values.

It is obviously an error and the simulation is failing as expected (and at the expected time), however I was curious as to why it doesn't return fmiError from the do_step method.  Is this perhaps a Dymola issue in how the solver returns from this type of error?

Anyway, I'm using JModelica nightly build r7321 (I think? which reports the version as 1.15 in version.txt) with PyFMI 2.1b1 and the updated fmi_algorithm_drivers.py script to correctly catch fmiError return status (I know, nothing standard...) and and Dymola 2015 FD01 to compile the co-simulation FMUs with the CVODE solver.

Any thoughts?


Joined: 2009-07-29
Hi Jesse,   I had a look at

Hi Jesse,


I had a look at the problem and I get the same behavior as you are experiencing. I had a look through the code and I can't see anything wrong there (thought that maybe an error from the do step method was not propagated). So I would say that there is a problem in the FMU, the do step does not return a failure when it should, it returns that everything is OK, so we have no way of knowing that we should stop there.




Joined: 2015-02-06
Hi Christian, OK, thanks for

Hi Christian,

OK, thanks for checking on this.


Login or register to post comments