- Index
- » Programming
- » Modelica Language
- » To do something every solver iteration
To do something every solver iteration
Re: To do something every solver iteration
Modelica has no concept of solver iteration and there is nothing like this you can do. No way to get the time and value of the previous step, and thus no way to for example write inline solvers in a nice way.
- sjoelund.se
- 1700 Posts
Re: To do something every solver iteration
Thank you sjoelund.se
I wonder if there is something similar to fmiEventUpdate(). This function appears in the automatically generated .mo file when doing FMI, and "is called after a time, state or step event occurred ... the function returns once a new consistent state has been found". This and other functions are located in SimulationRuntime/fmi/import/fmuWrapper.c.
Is there any trick that could fire a "when" under an algorithm section just before or after an iteration step has been successfully finished?
Re: To do something every solver iteration
Well, it is also confirmed in the paper "A Generic FMU Interface for Modelica" by Wuzhu Chen, Michaela Huhn and Peter Fritzson presented in EOOLT 2011 conference. Authors say:
"The FMI function fmiCompletedIntegratorStep cannot be defined and called properly in Modelica, since Modelica language does not provide the functionalities, through which the status of a integration step can be queried and when an integrator step is finished can be detected."
- Index
- » Programming
- » Modelica Language
- » To do something every solver iteration