# 龙格–库塔–费尔伯格方法

龙格–库塔–费尔伯格（Runge–Kutta–Fehlberg，RKF）方法是一种用于求解常微分方程的自适应步长数值方法：它用一对阶数不同但共享相同级计算的嵌入式龙格–库塔公式推进解，因此两个结果之差可以在不额外付出函数求值代价的情况下估计局部误差。<sup>[1](https://digitalcommons.odu.edu/cgi/viewcontent.cgi?article=1138&context=mathstat_fac_pubs)</sup><sup> • </sup><sup>[2](https://jonshiach.github.io/ODEs-book/_pages/2.5_Adaptive_step_size_control.html)</sup> 该估计驱动自动步长控制，使用户无需自行选择固定步长。<sup>[3](https://www.cambridge.org/core/journals/anziam-journal/article/comparison-of-explicit-rungekutta-methods/323422936943F471AC1F1E77401F87C9)</sup> 其中最著名的实例将四阶与五阶公式结合在一起，称为 RKF45，<sup>[4](https://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/14IVPs/rkf45/theory.html)</sup> 而同一类型的其他嵌入式公式对（系数不同，如博加茨基–尚派恩和 多曼德–普林斯）则构成了 MATLAB 的 ode23 与 ode45 函数以及 SciPy 的 RK23 与 RK45 求解器的基础。<sup>[2](https://jonshiach.github.io/ODEs-book/_pages/2.5_Adaptive_step_size_control.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 输出 | 常微分方程初值问题的数值解，其步长在每一步根据局部误差估计自动调整。<sup>[3](https://www.cambridge.org/core/journals/anziam-journal/article/comparison-of-explicit-rungekutta-methods/323422936943F471AC1F1E77401F87C9)</sup> |
| 误差估计 | 两个嵌入式解之差 \( \mathbf{e} = \mathbf{y}^{(p+1)} - \mathbf{y}^{(p)} \)，由共享的级计算得出。<sup>[2](https://jonshiach.github.io/ODEs-book/_pages/2.5_Adaptive_step_size_control.html)</sup> |
| RKF45 公式对 | 六个级产生一个四阶解和一个五阶解；五阶公式至少需要六个级，而嵌入方法无需额外级即可达到这一要求。<sup>[2](https://jonshiach.github.io/ODEs-book/_pages/2.5_Adaptive_step_size_control.html)</sup><sup> • </sup><sup>[1](https://digitalcommons.odu.edu/cgi/viewcontent.cgi?article=1138&context=mathstat_fac_pubs)</sup> |
| 步长规则 | 当均方根缩放误差范数满足 \( \Delta \le 1 \) 时接受该步；步长比限制为 \( r = \min(5, \max(0.1, 0.8 \cdot \Delta^{-1/(p+1)})) \)。<sup>[2](https://jonshiach.github.io/ODEs-book/_pages/2.5_Adaptive_step_size_control.html)</sup> |
| 主要失效模式 | 刚性方程：步长受快速瞬态过程的稳定性而非精度限制，并且变得与容差无关。<sup>[5](https://www.math.ntnu.no/emner/TMA4215/2009h/notater/lecture4.pdf)</sup> |
| 经典软件 | 由 H. A. 瓦茨（H. A. Watts）和 L. F. 尚派恩（L. F. Shampine）在桑迪亚国家实验室（Sandia Laboratories）编写的 Netlib RKF45 子程序实现了 (4,5) 公式对，适用于非刚性和轻度刚性问题。<sup>[6](https://netlib.sandia.gov/ode/srkf45.f)</sup> |
| 精度范围 | RKF45 面向中等精度设计；其文档建议不要使用小于约 1.e-8 的相对误差控制。<sup>[6](https://netlib.sandia.gov/ode/srkf45.f)</sup> |

## 工作原理

嵌入式龙格–库塔公式对是两个龙格–库塔公式，一个为 \( p \) 阶，另一个为 \( p+1 \) 阶，由相同的级值构建。在标准记号中，权重向量 \( \mathbf{b} \) 定义 \( p \) 阶方法，\( \hat{\mathbf{b}} \) 定义 \( p+1 \) 阶方法（有时角色互换；要求只是两个方法阶数不同）。<sup>[5](https://www.math.ntnu.no/emner/TMA4215/2009h/notater/lecture4.pdf)</sup><sup> • </sup><sup>[7](https://www.math.umd.edu/~mariakc/AMSC661/LectureNotes/ODEsolvers.pdf)</sup> 由于级是共享的，第二个解只需对已计算量做加权求和。局部截断误差估计即为二者之差，<sup>[2](https://jonshiach.github.io/ODEs-book/_pages/2.5_Adaptive_step_size_control.html)</sup>

\[ \mathbf{e} = \mathbf{y}^{(p+1)} - \mathbf{y}^{(p)}. \]

在费尔伯格发表于 NASA TR R-315 的表述中，第一个公式为四阶，第二个为五阶，二者之差近似四阶公式的首项五阶截断误差项，报告指出该差值可用于可靠的步长控制过程。<sup>[8](https://ntrs.nasa.gov/api/citations/19690021375/downloads/19690021375.pdf)</sup> 实践中，公式对以局部外推模式运行：高阶解作为接受的输出，低阶解仅用于提供误差估计。<sup>[7](https://www.math.umd.edu/~mariakc/AMSC661/LectureNotes/ODEsolvers.pdf)</sup><sup> • </sup><sup>[9](https://link.springer.com/article/10.1007/s44207-024-00001-0)</sup> 用高阶结果推进可在不增加额外代价的情况下获得更精确的积分。<sup>[1](https://digitalcommons.odu.edu/cgi/viewcontent.cgi?article=1138&context=mathstat_fac_pubs)</sup>

嵌入而非一味提高阶数，是通向精度的有效途径，原因在于布切尔屏障（Butcher Barrier）：在不超过四个级时，收敛阶等于级数，但超过此数后，所需级数的增长快于可达到的阶数。<sup>[10](https://par.nsf.gov/servlets/purl/10161150)</sup>

经典的费尔伯格 4(5) 表使用六个级，节点系数包括 1932/2197、−7200/2197 和 7296/2197；五阶权重为 16/135、6656/12825、28561/56430、−9/50 和 2/55，四阶权重为 25/216、1408/2565、2197/4104 和 −1/5。<sup>[2](https://jonshiach.github.io/ODEs-book/_pages/2.5_Adaptive_step_size_control.html)</sup>

## 具体做法

一个自适应步的过程如下：

1. 由当前状态 \( \mathbf{y}^{(n)} \) 和步长 \( h \)，计算费尔伯格 4(5) 表的六个级，并构造四阶解与五阶解。<sup>[2](https://jonshiach.github.io/ODEs-book/_pages/2.5_Adaptive_step_size_control.html)</sup>
2. 计算误差估计 \( \mathbf{e} \)，并用均方根范数归一化 \( \Delta = \sqrt{(1/N) \sum_{i=1}^{N} (e_i / s_i)^2} \)，其中 \( s_i = \mathrm{atol} + \mathrm{rtol} \cdot \max(|y_i^{(n)}|, |y_i^{(p+1)}|) \) 混合了绝对容差与相对容差。<sup>[2](https://jonshiach.github.io/ODEs-book/_pages/2.5_Adaptive_step_size_control.html)</sup>
3. 若 \( \Delta \le 1 \) 则接受该步；否则拒绝并以更小步长重试。<sup>[5](https://www.math.ntnu.no/emner/TMA4215/2009h/notater/lecture4.pdf)</sup> 在接受步中，输出高阶解。<sup>[7](https://www.math.umd.edu/~mariakc/AMSC661/LectureNotes/ODEsolvers.pdf)</sup>
4. 按 \( h_{\mathrm{new}} = r \cdot h \) 更新步长，其中 \( r = \min(5, \max(0.1, 0.8 \cdot \Delta^{-1/(p+1)})) \)；因子 0.8 为安全裕度，上限 5 和下限 0.1 限制步长增长或收缩的速度。<sup>[2](https://jonshiach.github.io/ODEs-book/_pages/2.5_Adaptive_step_size_control.html)</sup>
5. 选择初始步长，例如 \( h = 0.8 \cdot \mathrm{rtol}^{1/(p+1)} \)。<sup>[2](https://jonshiach.github.io/ODEs-book/_pages/2.5_Adaptive_step_size_control.html)</sup>

较旧的 Netlib RKF45 代码则采用逐分量检验，当 \( \mathrm{abs}(\mathrm{local\ error}) \le \mathrm{relerr} \cdot \mathrm{abs}(y) + \mathrm{abserr} \) 时接受，并返回标志值以指示诸如需要超过 3000 次导数求值或在最小允许步长下失败等结果。<sup>[6](https://netlib.sandia.gov/ode/srkf45.f)</sup>

## 起源

该方法由 E. 费尔伯格（E. Fehlberg）于 1968 年提出，载于 NASA 技术报告服务器上的报告《带步长控制的经典五阶、六阶、七阶和八阶龙格–库塔公式》；其配套的 TR R-315 报告推导了 4(5) 系数对及其步长控制过程。<sup>[8](https://ntrs.nasa.gov/api/citations/19690021375/downloads/19690021375.pdf)</sup> 布切尔关于龙格–库塔方法的历史记载指出，将两个不同阶数的方法组合进单一表的想法最早在一个五级方案中提出，其前四个级给出四阶方法，其差值近似局部截断误差；布切尔指出默森（Merson）的估计仅适用于近似线性的问题，而费尔伯格的贡献在于使这一想法变得通用且可靠。<sup>[11](https://people.cs.vt.edu/~asandu/Public/Qual2011/DiffEqn/Butcher_1996_RK-history.pdf)</sup> 费尔伯格 1968 年的报告将龙格–库塔公式对的搜索推进到七阶，其明确动机是避免理查森外推——后者为步长控制的利益而大致使计算量翻倍。<sup>[11](https://people.cs.vt.edu/~asandu/Public/Qual2011/DiffEqn/Butcher_1996_RK-history.pdf)</sup>

## 变体

**维尔纳公式对。** J. H. 维尔纳（J. H. Verner）1978 年发表于《SIAM 数值分析杂志》的论文《带局部截断误差估计的显式龙格–库塔方法》推导了 5(6)、6(7)、7(8) 和 8(9) 阶的显式嵌入式公式对，旨在修正下文讨论的费尔伯格方法的缺陷。<sup>[12](https://doi.org/10.1137/0715051)</sup>

**多曼德–普林斯。** J. R. 多曼德（J. R. Dormand）和 P. J. 普林斯（P. J. Prince）1980 年发表于《计算与应用数学杂志》的论文《一族嵌入式龙格–库塔公式》推导了一族嵌入式 RK5(4) 公式，其五阶主截断项较小，且具有扩展的绝对稳定区域。<sup>[13](https://www.sciencedirect.com/science/article/pii/0771050X80900133)</sup> DOPRI5(4) 被广泛视为嵌入式实现的典范，其表的最后一行在 \( t_n \) 处求值。<sup>[7](https://www.math.umd.edu/~mariakc/AMSC661/LectureNotes/ODEsolvers.pdf)</sup>

**博加茨基–尚派恩。** P. 博加茨基（P. Bogacki）和 L. F. 尚派恩的 BS(4,5) 公式对发表于 1996 年《计算机与数学应用》杂志，题为《一种高效的龙格–库塔 (4,5) 公式对》，作者称其效率显著高于费尔伯格和 多曼德–普林斯公式对。<sup>[1](https://digitalcommons.odu.edu/cgi/viewcontent.cgi?article=1138&context=mathstat_fac_pubs)</sup>

**稠密输出。** 插值多项式可以廉价地添加：对于 RKF45 中使用的五阶公式，获得具有 \( O(h^5) \) 局部截断误差的插值多项式无需额外函数求值，<sup>[14](https://dl.acm.org/doi/10.1145/7921.7923)</sup> 而对于费尔伯格 4(5)、多曼德–普林斯 5(4) 和维尔纳 5(6) 方法的五阶解，已推导出无需额外代价的 \( O(h^6) \) 插值多项式。<sup>[15](https://link.springer.com/article/10.1007/BF02242920)</sup>

## 应用

RKF 方法适用于任何需要求解中等精度、非刚性初值问题而无需调节步长的场合。由 H. A. 瓦茨和 L. F. 尚派恩在桑迪亚国家实验室编写的 Netlib RKF45 子程序实现了费尔伯格 NASA TR R-315 中的 (4,5) 方法，主要面向导数求值代价低廉的非刚性和轻度刚性方程。<sup>[6](https://netlib.sandia.gov/ode/srkf45.f)</sup> 采用其他系数的嵌入式公式对构成了 MATLAB 的 ode23 与 ode45 以及 SciPy 的 RK23 与 RK45 的基础（23 系列求解器使用博加茨基–尚派恩，45 系列求解器使用多曼德–普林斯）。<sup>[2](https://jonshiach.github.io/ODEs-book/_pages/2.5_Adaptive_step_size_control.html)</sup> 在 Julia 中，OrdinaryDiffEq.jl 实现了 DP5（多曼德–普林斯 5/4，带无需额外计算代价的四阶插值多项式）和 DP8（海雷尔的 8/5/3 改编版，带七阶插值多项式）。<sup>[16](https://docs.sciml.ai/OrdinaryDiffEq/v6.29/nonstiff/explicitrk/)</sup>

## 局限与替代方案

**刚性问题。** 显式自适应方案在刚性方程上失效：步长受快速瞬态过程的稳定性而非精度限制，因而变得不合理地小且与所选容差无关；一个典型迹象是步长对容差放宽没有响应。后向欧拉等隐式方法是标准的补救措施。<sup>[5](https://www.math.ntnu.no/emner/TMA4215/2009h/notater/lecture4.pdf)</sup> 对于刚性问题（模型标量方程中 \( \lambda \ll 0 \)），稳定性引起的约束可能迫使 \( h \) 远低于精度要求，使显式时间步进效率低下。<sup>[17](https://people.math.ethz.ch/~grsam/NUMPDEFL/Parts/NPDEFL_handout_chapter_7.pdf)</sup>

**求积型问题。** 维尔纳指出一个结构性缺陷：对于可化为求积计算的问题，费尔伯格方法给出的误差估计恒为零，因此对于至少部分属于该类型的问题，这些估计不可靠；他推导替代公式对正是为了克服这一点。<sup>[12](https://doi.org/10.1137/0715051)</sup>

**精度与代价。** RKF45 文档指出，当要求高精度时一般不应使用该代码。<sup>[6](https://netlib.sandia.gov/ode/srkf45.f)</sup> 与固定步长四阶龙格–库塔相比，RKF45 每步约多出 50% 的工作量，但第二个方法无需新的函数求值，只需六个数的线性组合，而额外的工作换来了指导步长的误差估计。<sup>[18](https://www.johndcook.com/blog/2020/02/19/fehlberg/)</sup> 与步长加倍法（分别以步长 \( h \) 和 \( h/2 \) 求解问题两次）相比，嵌入式方法必须让函数经过相同的求值点来估计误差，但已发表的比较发现嵌入式龙格–库塔算法在实践中更高效。<sup>[10](https://par.nsf.gov/servlets/purl/10161150)</sup> 一个理论上的缺点是，基于嵌入式公式对误差的步长控制无法提供严格的误差上界。<sup>[9](https://link.springer.com/article/10.1007/s44207-024-00001-0)</sup> 经典的基于误差的步长选择是一个 I 控制器，它将当前步长乘以由误差估计导出的因子；而博加茨基–尚派恩和多曼德–普林斯等现代方案则改用 PI/PID 控制器。<sup>[9](https://link.springer.com/article/10.1007/s44207-024-00001-0)</sup>

## References

1. [An Efficient Runge-Kutta (4,5) pair (Bogacki & Shampine)](https://digitalcommons.odu.edu/cgi/viewcontent.cgi?article=1138&context=mathstat_fac_pubs)
2. [Adaptive step size control, Runge-Kutta Methods (Shiach)](https://jonshiach.github.io/ODEs-book/_pages/2.5_Adaptive_step_size_control.html)
3. [A comparison of explicit Runge–Kutta methods (ANZIAM Journal)](https://www.cambridge.org/core/journals/anziam-journal/article/comparison-of-explicit-rungekutta-methods/323422936943F471AC1F1E77401F87C9)
4. [Topic 14.5: Runge Kutta Fehlberg (Theory), University of Waterloo](https://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/14IVPs/rkf45/theory.html)
5. [TMA4215 lecture notes: Error control and stepsize selection (NTNU)](https://www.math.ntnu.no/emner/TMA4215/2009h/notater/lecture4.pdf)
6. [Netlib RKF45 Fortran source (Watts & Shampine, Sandia)](https://netlib.sandia.gov/ode/srkf45.f)
7. [Numerical Methods for Solving Ordinary Differential Equations (AMSC661 lecture notes)](https://www.math.umd.edu/~mariakc/AMSC661/LectureNotes/ODEsolvers.pdf)
8. [Low-Order Classical Runge-Kutta Formulas with Stepsize Control and Their Application to Some Heat Transfer Problems (NASA TR R-315)](https://ntrs.nasa.gov/api/citations/19690021375/downloads/19690021375.pdf)
9. [Stability of step size control based on a posteriori error estimates (Springer, 2024)](https://link.springer.com/article/10.1007/s44207-024-00001-0)
10. [Journal of Advances in Mathematics vol 16 (2019), Runge–Kutta methods review](https://par.nsf.gov/servlets/purl/10161150)
11. [The History of Runge-Kutta Methods (J. C. Butcher, Applied Numerical Mathematics)](https://people.cs.vt.edu/~asandu/Public/Qual2011/DiffEqn/Butcher_1996_RK-history.pdf)
12. [J. H. Verner (1978). Explicit Runge–Kutta Methods with Estimates of the Local Truncation Error. SIAM Journal on Numerical Analysis.](https://doi.org/10.1137/0715051)
13. [A family of embedded Runge-Kutta formulae (Dormand & Prince)](https://www.sciencedirect.com/science/article/pii/0771050X80900133)
14. [Interpolants for Runge-Kutta formulas (ACM TOMS)](https://dl.acm.org/doi/10.1145/7921.7923)
15. [Runge-Kutta interpolants based on values from two successive integration steps (Computing, Springer)](https://link.springer.com/article/10.1007/BF02242920)
16. [Explicit Runge-Kutta Methods · OrdinaryDiffEq.jl](https://docs.sciml.ai/OrdinaryDiffEq/v6.29/nonstiff/explicitrk/)
17. [Numerical Methods for Partial Differential Equations, Chapter 7 (stiff ODEs), ETH Zurich](https://people.math.ethz.ch/~grsam/NUMPDEFL/Parts/NPDEFL_handout_chapter_7.pdf)
18. [RKF45: Adaptive error estimate Runge Kutta Fehlberg (John D. Cook)](https://www.johndcook.com/blog/2020/02/19/fehlberg/)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数学分析与数学模型 › Numerical analysis and computation › Time integration methods

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/runge-kutta-fehlberg-method

English original: https://www.edgepedia.org/runge-kutta-fehlberg-method
