The Functional Mock-up Interface (FMI) 3.0 standard for Model Exchange is restricted to hybrid ordinary differential equations, requiring any internal algebraic equations to be solved inside the Functional Mock-up Unit (FMU) before derivatives are returned to the importer. For models originating from, e.g. Modelica, this means that nonlinear algebraic equations must be solved through internal Newton iterations, which can reduce accuracy, increase computational cost, introduce hidden solver states, and cause robustness issues in downstream simulation and optimization workflows. In this article, we present a proposal for a layered standard, fmi-ls-dae, that exposes algebraic equations and their associated algebraic variables as part of a semi-explicit index-1 differential-algebraic equation. We describe the proposed extensions to the FMI XML schema and demonstrate the approach through prototype implementations: Dymola and CasADi generate FMUs that expose this semi-explicit index-1 formulation, while CasADi, FMIOPT, Simcenter Twin Activate, and MOO (the dynamic optimization tool of OpenModelica) import them for simulation and dynamic optimization. On an industrially relevant multilink suspension corner model, the proposed DAE-FMU formulation enables the optimization routine to converge on an optimal control problem on which the equivalent ODE-FMU fails to converge. We outline ongoing work towards supporting higher-index DAEs, consistent initialization, and event handling,
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
We present an approach for the efficient implementation of self-adjusting multi-rate Runge-Kutta methods and we introduce a novel stability analysis, that covers the multi-rate extensions of all standard Runge-Kutta methods and allows to assess the impact of different interpolation methods for the latent variables and of the use of an arbitrary number of sub-steps for the active variables. The stability analysis applies successfully to the model problem typically used in the literature for multi-rate methods. Furthermore, we also propose a physically motivated model problem that can be used to assess stability to problems with purely imaginary eigenvalues and in situations closer to those arising in applications. Finally, we present an efficient implementation of multi-rate Runge-Kutta methods in the framework of the OpenModelica open-source modelling and simulation software. Results of several numerical experiments, performed with this implementation of the proposed methods, demonstrate the efficiency gains deriving from the use of the proposed multi-rate approach for physical modelling problems with multiple time scales.
We present an approach for the efficient implementation of self-adjusting multi-rate Runge-Kutta methods and we introduce a novel stability analysis, that covers the multi-rate extensions of all standard Runge-Kutta methods and allows to assess the impact of different interpolation methods for the latent variables and of the use of an arbitrary number of sub-steps for the active variables. The stability analysis applies successfully to the model problem typically used in the literature for multi-rate methods. Furthermore,} we also propose a physically motivated model problem that can be used to assess stability to problems with purely imaginary eigenvalues and in situations closer to those arising in applications. Finally, we present an efficient implementation of multi-rate Runge-Kutta methods in the framework of the OpenModelica open-source modelling and simulation software. Results of several numerical experiments, performed with this implementation of the proposed methods, demonstrate the efficiency gains deriving from the use of the proposed multi-rate approach for physical modelling problems with multiple time scales.
In the current state-of-the-art modeling tools for simulation, it is common to describe system behavior symbolically using mixed continuous and discrete differential-algebraic equations, so called hybrid DAEs. To correctly resolve higher index problems, hybrid systems and to efficiently use ODE solvers, a matching and sorting problem has to be solved, commonly referred to as causalization. Typically multidimensional equations and variables are scalarized, which leads to excessive build time and generated code size in the case of large systems. An algorithm will be presented, that preserves array structures as much as possible while still solving the problem of causalization in scalar fashion. Test results carried out in the OpenModelica tool show a reduction in build time of one/two orders of magnitude and of a factor two/three in the simulation run time for models of the ScalableTestSuite library.
When simulating a Modelica model, non-linear algebraic loops may be present, which involves solving multiple equations simultaneously. The classical Newton-Raphson method is commonly employed for solving a non-linear equation system (NLS). However, the computational burden of using this method during simulation can be significant. To tackle this issue, utilizing artificial neural networks (ANNs) to approximate the solution of algebraic loops is a promising approach. While ANN surrogates offer fast performance, ensuring the correctness of the computed solution or quantifying reliability can be challenging. This publication presents a prototype, based on the OpenModelica compiler (OMC), that automates the extraction of time-consuming algebraic loops. It generates training data, trains ANNs using machine learning (ML) methods, and replaces the algebraic loops with ANN surrogates in the simulation code. A hybrid approach, combining the trained surrogate with the nonlinear Newton solver, is then used to compute the solution with a desired level of accuracy.
The initialization of equation-based differential-algebraic system models, and more in general the solution of many engineering and scientific problems, require the solution of systems of nonlinear equations. Newton-Raphson's method is widely used for this purpose; it is very efficient in the computation of the solution if the initial guess is close enough to it, but it can fail otherwise. In this paper, several criteria are introduced to analyze the influence of the initial guess on the evolution of Newton-Raphson's algorithm and to identify which initial guesses need to be improved in case of convergence failure. In particular, indicators based on first and second derivatives of the residual function are introduced, whose values allow to assess how much the initial guess of each variable can be responsible for the convergence failure. The use of such criteria, which are based on rigorously proven results, is successfully demonstrated in three exemplary test cases. (C) 2021 Elsevier Inc. All rights reserved.
OpenModelica is a unique large-scale integrated open-source Modelica-and FMI-based modeling, simulation, optimization, model-based analysis and development environment.Moreover, the OpenModelica environment provides a number of facilities such as debugging; optimization; visualization and 3D animation; web-based model editing and simulation; scripting from Modelica, Python, Julia, and Matlab; efficient simulation and co-simulation of FMI-based models; compilation for embedded systems; Modelica-UML integration; requirement verification; and generation of parallel code for multi-core architectures.The environment is based on the equation-based object-oriented Modelica language and currently uses the MetaModelica extended version of Modelica for its model compiler implementation.This overview paper gives an up-to-date description of the capabilities of the system, short overviews of used open source symbolic and numeric algorithms with pointers to published literature, tool integration aspects, some lessons learned, and the main vision behind its development.
Many algorithms related to Modelica-based simulations heavily rely on the efficient provision of Jacobian matrices.Besides the accuracy of the derivative information, the performance of the derivative evaluation is also of great interest, since it can have a large share in the total simulation time.In this paper, we propose two complementary approaches basing on identification of constant parts and parallelization to accelerate Jacobian evaluation.Furthermore, the implementations of these techniques in the open-source Modelica tool OpenModelica are discussed.The gained speedup in Jacobian evaluation is demonstrated on benchmark models of the Scal-ableTestSuite.
OpenModelica is currently the most complete opensource Modelica-and FMI-based modeling, simulation, optimization, and model-based development environment.Moreover, the OpenModelica environment provides a number of facilities such as debugging; optimization; visualization and 3D animation; web-based model editing and simulation; scripting from Modelica, Python, Julia, and Matlab; efficient simulation and co-simulation of FMI-based models; compilation for embedded systems; Modelica-UML integration; requirement verification; and generation of parallel code for multi-ore architectures.The environment is based on Modelica and uses an extended version of Modelica for its implementation.This overview paper intends to give an up-to-date brief description of the capabilities of the system, and the main vision behind its development.
High index differential algebraic equations (DAEs) are ordinary differential equations (ODEs) with constraints and arise frequently from many mathematical models of physical phenomenons and engineering fields. In this paper, we generalize the idea of differential elimination with Dixon resultant to polynomially nonlinear DAEs. We propose a new algorithm for index reduction of DAEs and establish the notion of differential Dixon resultant, which can provide the differential resultant of the enlarged system of original equations. To make use of structure of DAEs, variable pencil technique is given to determine the termination of differentiation. Moreover, we also provide a heuristic method for removing the extraneous factors from differential resultant. The experimentation shows that the proposed algorithm outperforms existing ones for many examples taken from the literature.
This paper introduces a new algorithm to increase the simulation performance of algebraic equation systems by encapsulating function calls.This avoids unnecessary evaluations of function calls and leads to positive structural effects, such as code motion.To enable the reader to reconstruct the algorithm, all four phases of the algorithm are described in detail and the complexity of them is analyzed.The overall complexity for practical models is O(n), where n is the number of equations.It is shown that the algorithm significantly decreases the simulation time for a wide range of physical based models.
Algorithmic differentiation has proven to be an efficient method for evaluating derivative information for implementations of mathematical functions. In the context of the Functional Mockup Interface (FMI) the reverse mode of algorithmic differentiation shows immense promise.
Modelica-based modeling and simulation is becoming increasingly important for the development of high quality engineering products.Therefore, the system size of interest in a Modelica-based simulation is continuously increasing and the traditional way of generating simulation code, e.g.involving symbolic transformations like matching, sorting, and tearing, must be adapted to this situation.This paper describes recently implemented sparse solver techniques in OpenModelica in order to efficiently compile and simulate large-scale Modelica models.A proof of concept is given by evaluating the performance of selected benchmark problems.
In many mathematical models of physical phenomenons and engineering fields, such as electrical circuits or mechanical multibody systems, which generate the differential algebraic equations (DAEs) systems naturally. In general, the feature of DAEs is a sparse large scale system of fully nonlinear and high index. To make use of its sparsity, this paper provides a simple and efficient algorithm for index reduction of large scale DAEs system. We exploit the shortest augmenting path algorithm for finding maximum value transversal (MVT) as well as block triangular forms (BTFs). We also present the extended signature matrix method with the block fixed point iteration and its complexity results. Furthermore, a range of nontrivial problems are demonstrated by our algorithm.
Common tearing methods try to find static tearing variables. This means that selected tearing variables are used for the entire simulation, which also means that all inner equations are used for the entire simulation. Hence, the tearing method sets up the tearing system in a way, that there are no restrictions on the domain of the inner equations. In general, this leads to bigger tearing sets. This paper presents an extension of common tearing methods that generates another tearing set in addition. The additional set has fewer tearing variables, which means that it should be more efficient in general. However, the additional set has some restrictions on its domain of definition. That is why common approaches would not even create it and why it may not be used for the entire simulation. Hence, its domain needs to be analysed during simulation to validate if the smaller set is defined on the current domain. If that is the case the smaller set is used for the calculation, otherwise the original set is used. This paper shows how this additional tearing set can be generated. It is also demonstrated how the domain can be monitored during runtime in order to make the switching process efficient. Results using a prototype implementation in OpenModelica are analysed to show the benefits of this method.
Recent innovations introduced in the electric power system, especially the significant usage of unpredictable renewable energy sources, are making to perform the needed matching of generated and absorbed electricity more difficult than in the past. To facilitate this matching, market regulation can provide economical drivers that stimulate cost-effective energy shifting by the so-called “prosumers” or the owners of energy storage devices. Price arbitrage, for instance, means to absorb energy when its price is low, and delivering it when is higher. To enhance the revenues achieved with this kind of operation, proper control techniques based on solving a Dynamical Optimisation problem can be considered. This paper will study price arbitrage techniques taking advantage of Modelica language description of the system, that allows easy and fast approach in modelling and also in using dynamical optimisation algorithms. The arbitrage opportunities and the optimal operational strategies will be studied considering different storage sizes and price patterns. Comparison of several strategies will be analysed, discussed and validated using an ad-hoc mixed-integer optimization program whose validity has already been widely checked in previous studies.
Peter Fritzon合作论文数3