使用模板引擎作为计算机代数工具
Using a template engine as a computer algebra tool
摘要:
在研究涉及使用数值方法求解常微分方程(ODE)系统的问题时,通常需要为特定问题选择最有效的方法。为了求解常微分方程组的柯西问题,龙格-库塔法(显式或隐式,有或无步长控制等),被雇用。在这种情况下,需要搜索数值方法的许多实现,并选择其数值方案的系数或其它参数。本文提出了一个库和脚本的自动生成例程功能的Julia编程语言的一组数值格式的龙格-库塔法。对于符号操作,我们使用模板替换工具。所提出的自动生成程序代码的方法允许我们使用单个模板进行编辑,而不是修改要比较的每个单独的函数。一方面,这提供了在数值方案的实现中的通用性,另一方面,使得在修改数值方法的比较实现的过程中的错误数量最小化成为可能。我们考虑了无步长控制的龙格-库塔法、有步长控制的嵌入式方法和有步长控制的Rosenbrock方法。数值格式的程序代码,这是自动生成的使用建议的库,测试通过数值解的几个著名的问题。
英文摘要:
In research problems that involve the use of numerical methods for solving systems of ordinary differential equations (ODEs), it is often required to select the most efficient method for a particular problem. To solve a Cauchy problem for a system of ODEs, Runge-Kutta methods (explicit or implicit ones, with or without step-size control, etc.) are employed. In that case, it is required to search through many implementations of the numerical method and select coefficients or other parameters of its numerical scheme. This paper proposes a library and scripts for automated generation of routine functions in the Julia programming language for a set of numerical schemes of Runge-Kutta methods. For symbolic manipulations, we use a template substitution tool. The proposed approach to automated generation of program code allows us to use a single template for editing, instead of modifying each individual function to be compared. On the one hand, this provides universality in the implementation of a numerical scheme and, on the other hand, makes it possible to minimize the number of errors in the process of modifying the compared implementations of the numerical method. We consider Runge-Kutta methods without step-size control, embedded methods with step-size control, and Rosenbrock methods with step-size control. The program codes for the numerical schemes, which are generated automatically using the proposed library, are tested by numerical solution of several well-known problems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。