Getting good performance out of numerical equation solvers requires that the user has provided stable and efficient functions representing their model. However, users should not be trusted to write good code. In this manuscript we describe ModelingToolkit (MTK), a symbolic equation-based modeling system which allows for composable transformations to generate stable, efficient, and parallelized model implementations. MTK blurs the lines of traditional symbolic computing by acting directly on a user's numerical code. We show the ability to apply graph algorithms for automatically parallelizing and performing index reduction on code written for differential-algebraic equation (DAE) solvers, "fixing" the performance and stability of the model without requiring any changes to on the user's part. We demonstrate how composable model transformations can be combined with automated data-driven surrogate generation techniques, allowing machine learning methods to generate accelerated approximate models within an acausal modeling framework. These reduced models are shown to outperform the Dymola Modelica compiler on an HVAC model by 590x at 3\% error. Together, this demonstrates MTK as a system for bringing the latest research in graph transformations directly to modeling applications.
翻译:从数字方程式解析器中获取良好性能要求用户提供代表其模型的稳定有效功能。 但是, 用户不应该被信任于写入好代码。 在此手稿中, 我们描述模型Toolkit (MTK), 这是一种象征式方程建模系统, 能够使可折式变换产生稳定、 高效和平行的模型执行。 MTK 通过直接使用用户的数值代码, 模糊传统象征性计算线 。 我们展示了应用图形算法的能力, 以自动平行和进行指数减少, 用于为差异性格方程式( DAE) 解析器( DAE) 写入的代码, “ 固定” 模型的性能和稳定性, 而无需对用户部分作任何修改 。 我们演示了如何将可折式模型变换模型转换与自动数据驱动的代号生成技术相结合, 允许机器学习方法在一个剖面模型框架内生成加速的近似模型。 这些减缩式将超过为 590x 错误的HVAC 模型的 Dymola Modelica 编译器。 。 一起演示MTK 将直接转换系统, 用于将最新的图形研究程序。