2

I try to export FMU of my model, but during the 0-30000s, the model is in the unsteady state, but I want export the FMU with steady-state, so I checked each option in the following screenshot, none of them could realize my idea.

My question is : How could I export FMU whit steady state?

 w

Jack
  • 1,094
  • 6
  • 16
  • In the FMI-Standard, the time is always the integration variable, so all FMUs are by definition transient. Exporting the steady state of a model does not fit into this picture. Does your system (in reality) reach the steady state very fast, and merely your means of solving it require long integration times? If this is the case, there are options to work around this. – mklingn Jul 09 '20 at 12:27
  • Yes, I build a model of a power plant, with the initialization condition I set, the model would take 50000s to reach a steady-state, so if I export FMU to Simulink to design a PID controller, the FMU would also take 50000s to get steady, then I could set step exciter to get the response. It would be easier if I could set the initialization state with a steady-state. – Jack Jul 09 '20 at 14:03

2 Answers2

1

According to the first table on page 19 in the document FMI Support in Dymola, canGetAndSetFMUState feature seems to be supported by Dymola.

Refer to chapter 2.1.8 Getting and Setting the Complete FMU State of the FMI Specification for background information, but in short this means you should be able to do the following:

  1. Export the FMU and do not worry about the steady state.
  2. In your calling tool (Simulink), integrate the FMU to the steady state you are interested in.
  3. Have the calling tool call function fmiGetFMUstate and store the complete state of the FMU.
  4. Now whenever you want to start from your steady state, have your calling tool use function fmiSetFMUstate to restore it.

This, of course, requires that your calling tool supports the above features.

mklingn
  • 151
  • 3
1

One option that may work - independent of FMI - is to tell Dymola to initialize the model in close to steady state by setting:

Advanced.DefaultSteadyStateInitialization = true;

However, it is default steady state so if your model has fixed start-values (as is common) they take precedence and this flag may have no effect.

Note that this was substantially improved in Dymola 2020.

Hans Olsson
  • 11,123
  • 15
  • 38