Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

To do something every solver iteration

To do something every solver iteration

Hello!

How is it possible to do something once every solver iteration?

The expressions:
-  when change(time)
- when time > pre(time)

are not permitted.

Best regards
Koldo

Edited by: Koldo - Feb-06-14 11:27:42

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.

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."

There are 0 guests and 0 other users also viewing this topic
You are here: