Residual-Informed Learning of Solutions to Algebraic Loops
Felix Brandt, Andreas Heuermann, Philip Hannebohm, Bernhard Bachmann
TL;DR
The paper tackles the computational bottleneck of solving algebraic loops in Modelica by introducing a residual-informed neural surrogate trained on the loop residual $L(\hat{y}) = \tfrac{1}{2} f(x,\hat{y})^T f(x,\hat{y})$, eliminating the need for labeled data and mitigating solution-ambiguity. The method yields gradients via $grad L(\hat{y}) = J_f(x,\hat{y})^T f(x,\hat{y})$ and supports batched training; a semi-supervised extension mixes residual and supervised terms to steer toward a preferred branch. Empirically, it outperforms supervised surrogates and reduces Newton iterations to fewer than five, delivering about 60% faster simulations on the IEEE 14-bus system while maintaining accuracy; it also demonstrates data-generation efficiency and effective handling of branching through multi-model and clustering strategies. The work promises significant speedups for optimization and control tasks in large-scale hybrid models, with opportunities for adaptive sampling, domain decomposition, and trajectory-guided data collection to further enhance robustness and generalization.
Abstract
This paper presents a residual-informed machine learning approach for replacing algebraic loops in equation-based Modelica models with neural network surrogates. A feedforward neural network is trained using the residual (error) of the algebraic loop directly in its loss function, eliminating the need for a supervised dataset. This training strategy also resolves the issue of ambiguous solutions, allowing the surrogate to converge to a consistent solution rather than averaging multiple valid ones. Applied to the large-scale IEEE 14-Bus system, our method achieves a 60% reduction in simulation time compared to conventional simulations, while maintaining the same level of accuracy through error control mechanisms.
