Modern modeling languages for general physical systems, such as Modelica, Amesim, or Simscape, rely on Differential Algebraic Equations (DAE), i.e., constraints of the form f(dot{x},x,u)=0. This drastically facilitates modeling from first principles of the physics and the reuse of models. In this paper we develop the mathematical theory needed to establish the development of compilers and tools for DAE based physical modeling languages on solid mathematical bases. Unlike Ordinary Differential Equations, DAE exhibit subtle issues because of the notion of differentiation index and related latent equations -- ODE are DAE of index zero for which no latent equation needs to be considered. Prior to generating execution code and calling solvers, the compilation of such languages requires a nontrivial \emph{structural analysis} step that reduces the differentiation index to a level acceptable by DAE solvers. The models supported by tools of the Modelica class involve multiple modes with mode-dependent DAE based dynamics and state-dependent mode switching. Multimode DAE are much more difficult than DAE. The main difficulty is the handling of the events of mode change. Unfortunately, the large literature devoted to the mathematical analysis of DAEs does not cover the multimode case, typically saying nothing about mode changes. This lack of foundations causes numerous difficulties to the existing modeling tools. Some models are well handled, others are not, with no clear boundary between the two classes. In this paper, we develop a comprehensive mathematical approach supporting compilation and code generation for this class of languages. Its core is the structural analysis of multimode DAE systems. As a byproduct of this structural analysis, we propose well sound criteria for accepting or rejecting models. For our mathematical development, we rely on nonstandard analysis, which allows us to cast hybrid systems dynamics to discrete time dynamics with infinitesimal step size, thus providing a uniform framework for handling both continuous dynamics and mode change events.
翻译:用于普通物理系统(如Modelica, Amesim, 或Simscape)的现代模拟语言, 依赖于差异代数方程式(DAE), 即 f(dot{x}, x, u) = 0 的制约。 这极大地便利了从物理的最初原则建模和再利用模型的模型。 在本文中, 我们开发了数学理论, 以建立基于稳定数学基础的 DAE 物理模拟语言的编纂器和工具。 不同于普通差异方程式, DAE 表现出微妙的问题, 因为差异指数和相关的隐性方程式的概念 -- DEODE 是综合数学零级的DAE, 不需要考虑隐性方程式。 在生成执行代码代码和调制解算器之前, 此类语言的汇编需要非三维的模型, 将差异指数降低到DAE 解算器的级别。 由模型支持的多种模式, 使用基于模式的DAE 的动态和状态调换模式的模型, 与DAE 的解算法的模型相比, 通常的解算方法的解算, 。