marco-compiler / marco

Modelica Advanced Research COmpiler
GNU Lesser General Public License v3.0
20 stars 5 forks source link

High-efficiency implicit Euler for real time / embedded applications #7

Closed casella closed 2 months ago

casella commented 1 year ago

Explicit Euler is the algorithm of choice for real-time simulation, because of the low computational cost and predictable computational load to carry out one simulation step. However, stiff system force the choice of a very small time step to avoid stability problems, which may lead to excessive simulation time. One way to deal with this problem is to use implicit Euler's method, which is pretty stable.

Special heuristics should be introduce to ensure soft real-time performance, e.g., limiting the number of Newton iterations within a single simulation step, etc.

mscuttari commented 2 months ago

marco-compiler/marco#27 introduces the whole family of Runge-Kutta methods, thus including implicit Euler. It's not clear which are the requirements for the soft real-time performance though. Given that the main concern of this issue is the implicit Euler algorithm, I would close it and prefer separate ones for the specific enhancements, so to better organize, delegate, and track the development.