Asynchronous fmiDoStep is not supported

252 views
Skip to first unread message

Justin Shultz

unread,
Jun 3, 2019, 7:28:40 AM6/3/19
to energyplus-fmu
Hello EnergyPlus Co-Simulation Community,

I am attempting to co-simulate an FMU from Dymola within EnergyPlus. However, when I run the simulation, I receive an error related to an asynchronous fmiDoStep. 

I've set the EnergyPlus steps per hour to 6 and the FMU interval to 600 seconds. Both have a 10 minute step size but the error persists. Is there anything else I can check or change to resolve this error?

EnergyPlus error during simulation
Instantiating FunctionalMockupUnitImport interface
Initializing FunctionalMockupUnitImport interface
Number of inputs in instance "TACE_West" of FMU "TACE_0West.fmu" = "8".
Number of outputs in instance "TACE_West" of FMU "TACE_0West.fmu" = "6".
ok TACE_West (): fmiInstantiateModel completed
warning TACE_West (): fmiInstantiateSlave: Callback function stepFinished != NULL but asynchronous fmiDoStep is not supported
ok TACE_West (): fmiInstantiateSlave
ok TACE_West (): fmiInitializeSlave...
ok TACE_West (): fmiInitializeSlave cvode tolerance is 1e-05
ok TACE_West (): fmiSetTime to 0
ok TACE_West (): fmiInitialize
ok TACE_West (): fmiInitializeSlave completed

EnergyPlus IDF associated with timesteps
Building,
    Building 1,               !- Name
    ,                         !- North Axis
    ,                         !- Terrain
    ,                         !- Loads Convergence Tolerance Value
    ,                         !- Temperature Convergence Tolerance Value
    ,                         !- Solar Distribution
    10,                         !- Maximum Number of Warmup Days
    10;                         !- Minimum Number of Warmup Days

Timestep,
    6;                        !- Number of Timesteps per Hour

ConvergenceLimits,
    6;                        !- Minimum System Timestep


Dymola variables and settings

TimestepSettings.PNG

FMUExportSettings.PNG


I am completely stuck, any assistance you can provide would be much appreciated. 


Thank you,

Justin



Thierry Nouidui

unread,
Jun 3, 2019, 9:12:12 AM6/3/19
to Justin Shultz, energyplus-fmu
Hi Justin,

you may want to check in the Simulation Setup -> Output tab of Dymola whether it is set to Store Variables at Events. If it is checked, unchecked it as this, I believe, forces Dymola to do steps which may not match the simulation output interval you have specified leading to EnergyPlus trying to do steps at times which are different from the expected ones. 

Thanks!

--
You received this message because you are subscribed to the Google Groups "energyplus-fmu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to energyplus-fm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/energyplus-fmu/6445ae06-b42e-4a0d-aa47-7223b19d8091%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Justin Shultz

unread,
Jun 3, 2019, 9:30:05 PM6/3/19
to energyplus-fmu
Hi Thierry,

Thank you for your response. Unfortunately, my asynchronous problem still persists. Please see below several more screenshots of my settings in Dymola. For reference, I am using EnergyPlus 8.7.0 (32 and 64 bit) and Dymola 2017 FD01 (64-bit).

OutputSettings.PNG

FMUExportSettings.PNG

TranslationSettings.PNG





Best,
Justin
To unsubscribe from this group and stop receiving emails from it, send an email to energyp...@googlegroups.com.

Thierry Nouidui

unread,
Jun 4, 2019, 2:30:08 AM6/4/19
to Justin Shultz, energyplus-fmu
Hi Justin,

Two things:
  • Could you double-click on the FMU imported block and see in the FMI tab whether the communication step-size of the FMU (fmi_CommunicationStepSize) matches the IDF time step?
  • I will generally suggest to use a newest version of Dymola. I recalled that older versions of Dymola needed to have a Sampler (with a sampling time being equal to the EnergyPlus time step) to work. The sampler was added between the input and FMU block to make sure that communications happen at the desired times.

Thanks!

To unsubscribe from this group and stop receiving emails from it, send an email to energyplus-fm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/energyplus-fmu/b648c1d6-4bcc-41cf-9a51-020cdebdeb83%40googlegroups.com.

Justin Shultz

unread,
Jun 8, 2019, 9:18:17 AM6/8/19
to energyplus-fmu
Hi Thierry,

Thank you for your response. 

I have updated to Dymola 2020 but I am still having issues. I imported the FMU into Dymola and found that your assumption about the step-size is correct. Despite setting the stepsize to 600 seconds or 52,560 steps, the FMU created has "fmi_NumberOfSteps" equal to 500. See below image for reference. 

FMISettings.png


Is this something you can help me with or should I reach out to Dassault at this point? This behavior is quite expected considering that I'm setting the variable. 

Best,
Justin

Thierry Nouidui

unread,
Jun 8, 2019, 3:34:47 PM6/8/19
to Justin Shultz, energyplus-fmu
Hi Justin,

I don't have the 2020 version of Dymola so I am not sure whether they did some major changes which I am not aware of.

However, I don't understand this sentence:

"Despite setting the stepsize to 600 seconds or 52,560 steps, the FMU created has "fmi_NumberOfSteps" equal to 500. See below image for reference."

What do you mean by the FMU created?

Do you mean that setting the fmi_NumberOfSteps to be 52,560 or setting the fmi_CommunicationStepSize to 600 will be reset by Dymola to the default values? If so then I will suggest to create a simple FMU 1.0 for co-simulation and see if the settings can be changed, if not then this should be sent to Dassault Systemes

Thanks!

To unsubscribe from this group and stop receiving emails from it, send an email to energyplus-fm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/energyplus-fmu/9857033d-ace3-4404-8cdd-2f3f9393e196%40googlegroups.com.

Justin Shultz

unread,
Jun 11, 2019, 5:47:02 PM6/11/19
to energyplus-fmu
Hi Thierry,

I reached out to Dassault but was told that the FMI Controller (in this case EnergyPlus) will be the program that should handle the FMU's timestep. My error "fmiInstantiateSlave: Callback function stepFinished != NULL but asynchronous fmiDoStep is not supported". May not be because of the FMU. Are there any other EnergyPlus cmd lines that send a red flag for you?

To clarify my sentence, in Dymola my model has the start time as 0 and the stop time as 8760 hours. My intention is to run a building system as an FMU imported into EnergyPlus for co-simulation. I have also set the interval length to be 10 minutes, to align with EnergyPlus's 6 timesteps per hour. 

The problem I saw, which Dassault cleared up in my support question, is that the "fmi_NumberOfSteps" set to 500 is just a default value. EnergyPlus should be setting this value during the simulation. However, that does not seem to be happening. 

Can you think of any other reasons why I would be receiving a crash related to an asynchronous fmiDoStep?

Thank you for all your assistance. I had this process working about 2 years ago but cannot seem to get it to work again. I'm at a loss. 

Best,
Justin


Justin Shultz

unread,
Jun 11, 2019, 5:55:27 PM6/11/19
to energyplus-fmu
Hi Thierry,

I upgraded my EnergyPlus model from 8.7 to 8.9 and received additional errors. Do these make sense to you?

Instantiating FunctionalMockupUnitImport interface
Initializing FunctionalMockupUnitImport interface
warning TACE_West (): fmiInstantiateSlave: Callback function stepFinished != NULL but asynchronous fmiDoStep is not supported
warning TACE_West (): fmiInstantiateSlave: timeout != 0 is not supported
error TACE_West (): fmiGetDerivatives: dsblock_ failed, QiErr = 1
error TACE_West (): fmiGetDerivatives: dsblock_ failed, QiErr = 1
error TACE_West (): fmiGetDerivatives: dsblock_ failed, QiErr = 1
error TACE_West (): fmiGetDerivatives: dsblock_ failed, QiErr = 1
error TACE_West (): fmiGetDerivatives: dsblock_ failed, QiErr = 1
error TACE_West (): fmiGetDerivatives: dsblock_ failed, QiErr = 1
error TACE_West (): fmiGetDerivatives: dsblock_ failed, QiErr = 1
error TACE_West (): fmiGetEventIndicators: dsblock_ failed, QiErr = 1
warning TACE_West (): CVODE: cvRcheck3 failed with CV_RTFUNC_FAIL:
 At t = 638.793, the rootfinding routine failed in an unrecoverable manner.
error TACE_West (): SUNDIALS_ERROR: CVode() failed with flag = CV_RTFUNC_FAIL
error TACE_West (): fmiDoStep: integration_step failed
Error: failed to do Step in fmiEPlusDoStep.
Program terminated: EnergyPlus Terminated--Error(s) Detected.

Best,
Justin

Thierry Nouidui

unread,
Jun 12, 2019, 2:05:09 AM6/12/19
to Justin Shultz, energyplus-fmu
Hi Justin,

1. When you import an FMU in Dymola, you should be able to manually overwrite the number of steps from the fmi tab (Unless they have changed the way things work). So I don't understand the comments from Dassault Systems.

2. The fact that you are getting a quite different error when changing the version of EnergyPlus is puzzling to me. Maybe, Dymola is currently failing to solve the initialization problem of the system model you have?

I suggest to simplify debugging to download the latest version of EnergyPlusToFMU and test the schedule example (Examples/Schedule/_fmu-export-schedule.idf). 

The exported FMU will one input and one output. Import the model in Dymola, connect the input and output to some other simple block and try to run it to see if this one works first. 

Please note that that FMU is set-up to work with EnergyPlus 9.0.xx 

Thanks!

To unsubscribe from this group and stop receiving emails from it, send an email to energyplus-fm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/energyplus-fmu/e42b9e18-ece5-4037-abca-287178fd90ee%40googlegroups.com.

Justin Shultz

unread,
Jun 14, 2019, 8:01:45 AM6/14/19
to energyplus-fmu
Hi Thierry, 

I believe I have begun to identify the problem. When checking additional debugging and translation options messages I receive an error related to "cannot create Jacobian for the ODE". 

From my understanding, the Dymola solver is able to provide a solution to my model but the CVode is not. So when generating the FMU using CVode, the FMU crashes on startup. 

If I were to acquire the license to generate a Co-Simulation FMU using the Dymola Solver, can this FMU be imported and run in EnergyPlus? Or can EnergyPlus only import FMUs that have CVode solvers?

Best,
Justin

Thierry Nouidui

unread,
Jun 14, 2019, 8:49:42 AM6/14/19
to Justin Shultz, energyplus-fmu
Hi Justin,

I need some clarifications:

I thought that you were importing an E+ FMU in Dymola and were connecting it with an HVAC system model written in native Modelica language. In this case, I was assuming that you were running your system model using the default Dymola solver (Dassl). 

Are you rather co-simulating two FMUs (one which is an E+ FMU and another one which is presumably an  HVAC system exported as an FMU as well) 

or are you importing an HVAC system model exported as an FMU from Dymola into EnergyPlus?

If the latter then the answer is Yes, EnergyPlus can import any co-simulation FMU. The import doesn't depend on the solver and Yes, you should try to use a different solver when exporting the HVAC system if CVode is making troubles.

P.S. I didn't know that you needed a special license to export one which uses other Dymola's solvers but I am not longer on top of all that.

Thanks!

To unsubscribe from this group and stop receiving emails from it, send an email to energyplus-fm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/energyplus-fmu/77473ee2-3777-4425-9465-da5cb037b2a8%40googlegroups.com.

Carolyn

unread,
Jun 3, 2020, 1:28:37 PM6/3/20
to energyplus-fmu
Hi Dr Nouidui,

I'm having a similar issue as Justin. We are not getting any errors with the solver, only an issue with the asynchronous fmiDoStep. Running EnergyPlus version 9.2 and exporting the FMU from Dymola 2021 version 1.0 FMI. 

We have no issues running co-simulation with the Moist-Air example FMU. I imported the example FMU into Dymola to compare it with our new exported FMU model and don't see any differences except the stop time. Wondering if there is an issue with our methods of exporting as an FMU. 

Moist Air Example FMU settings


Our model FMU settings



Any help would be much appreciated. Thank you.

Carolyn

Thierry Nouidui

unread,
Jun 4, 2020, 1:31:54 AM6/4/20
to Carolyn, energyplus-fmu
Did you try to export your FMU with a different solver [ I am not sure whether this solution ended up working with Justin though. ]
Also, it will be great if you could test your FMU using a different master algorithm (e.g. PyFMI, BCVTB), just to see if the problem 
is with the FMU or the master.

Thanks!

On Wed, Jun 3, 2020 at 8:28 PM Carolyn <cdgoo...@gmail.com> wrote:
Hi Dr Nouidui,

I'm having a similar issue as Justin. We are not getting any errors with the solver, only an issue with the asynchronous fmiDoStep. Running EnergyPlus version 9.2 and exporting the FMU from Dymola 2021 version 1.0 FMI. 

We have no issues running co-simulation with the Moist-Air example FMU. I imported the example FMU into Dymola to compare it with our new exported FMU model and don't see any differences except the stop time. Wondering if there is an issue with our methods of exporting as an FMU. 

Moist Air Example FMU settings
image.png


Our model FMU settings
image.png
image.png


Is this something you can help me with or should I reach out to Dassault at this point? This behavior is quite expected considering that I'm setting the variable. 

Best,
Justin

On Tuesday, June 4, 2019 at 2:30:08 AM UTC-4, Thierry Nouidui wrote:
Hi Justin,

Two things:
  • Could you double-click on the FMU imported block and see in the FMI tab whether the communication step-size of the FMU (fmi_CommunicationStepSize) matches the IDF time step?
  • I will generally suggest to use a newest version of Dymola. I recalled that older versions of Dymola needed to have a Sampler (with a sampling time being equal to the EnergyPlus time step) to work. The sampler was added between the input and FMU block to make sure that communications happen at the desired times.

Thanks!

On Tue, Jun 4, 2019 at 4:30 AM Justin Shultz <justin...@gmail.com> wrote:
Hi Thierry,

Thank you for your response. Unfortunately, my asynchronous problem still persists. Please see below several more screenshots of my settings in Dymola. For reference, I am using EnergyPlus 8.7.0 (32 and 64 bit) and Dymola 2017 FD01 (64-bit).

image.png

image.png

image.png





Best,
Justin
image.png

image.png
To unsubscribe from this group and stop receiving emails from it, send an email to energyplus-fm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/energyplus-fmu/037663d7-9eb4-414d-8377-5a0df0e659b1%40googlegroups.com.


--
Prof. Thierry Nouidui
Nouidui Consulting Group
https://nouidui.com/index.php/consulting/

Carolyn

unread,
Jun 8, 2020, 6:39:49 PM6/8/20
to energyplus-fmu
Thanks Thierry. When we export the FMU using Dymola solvers it doesn't produce a .fmu file so we have only been using the Cvode solver. 

Here is a list of the following troubleshooting steps we've done:

1. Imported the FMU we created into Dymola and it runs as expected - no issues with the FMU itself.
2. Ran MoistAir FMU with the example idf - co-simulation runs without errors.
3. Ran MoistAir FMU with our modified idf to ensure our settings weren't the issue - co-simulation runs without errors.
4. Exported an FMU from the example moist air Modelica from the Buildings library and ran with the example moist air idf in EnergyPlus - co-simulation does not run. Same asynchronous error.

It seems like the issue is in the export of the FMU from Dymola. Any idea what settings you choose upon export of an FMU in Dymola?

Thank you,
Carolyn

Reply all
Reply to author
Forward
0 new messages