📚 Improved Euler Formula | 改进欧拉公式
When solving first-order differential equations numerically, the Euler method is often introduced first because of its simplicity. However, its accuracy is limited, and the improved Euler formula — also known as Heun's method or the second-order Runge-Kutta method — provides a significant gain in precision with only a modest amount of extra work.
在求解一阶微分方程的数值解时,欧拉法因简单而常常被首先介绍。但其精度有限,而改进欧拉公式——也称为亨氏方法(Heun's method)或二阶龙格-库塔方法——只需增加少量计算就能显著提高精度。
1. The Euler Method Revisited | 回顾欧拉法
that for a differential equation dy/dx = f(x, y) with initial condition y(x₀) = y₀, Euler's method approximates the next value by stepping along the tangent line:
回忆对于微分方程 dy/dx = f(x, y) 及初值条件 y(x₀) = y₀,欧拉法通过沿切线方向迈出一步来近似下一个值:
yn+1 = yn + h f(xn, yn)
Here h is the step size, and f(xn, yn) is the slope at the starting point.
其中 h 是步长,f(xn, yn) 是起点处的斜率。
This method uses only the slope at the left-hand endpoint of the interval [xn, xn+1], which makes it a first-order method. The global error is proportional to h, so halving the step size only halves the error.
该方法只使用区间 [xn, xn+1] 左端点的斜率,因此是一阶方法。全局误差与 h 成正比,所以步长减半仅使误差减半。
2. The Idea Behind the Improvement | 改进的思路
A better approximation can be obtained if we average the slope at the starting point and the slope at the predicted endpoint. This gives a more representative slope for the whole interval, especially when the true slope varies quickly.
如果我们对起点处的斜率和预测终点处的斜率取平均,就能得到更好的近似。这样得到的斜率更能代表整个区间,特别是当真斜率变化较快时。
The improved Euler formula therefore uses a predictor-corrector process: first predict yn+1 using Euler's method, then correct that prediction using the average of the two slopes.
因此,改进欧拉公式采用了预测-校正过程:先用欧拉法预测 yn+1,再使用两个斜率的平均值对该预测进行校正。
3. Derivation of the Improved Euler Formula | 推导改进欧拉公式
We begin with the integral form of the differential equation:
我们从微分方程的积分形式出发:
yn+1 = yn + ∫xₙxₙ₊₁ f(x, y(x)) dx
Using the trapezoidal rule to approximate this integral gives:
使用梯形法则来近似这个积分,得到:
yn+1 ≈ yn + h/2 [ f(xn, yn) + f(xn+1, yn+1) ]
Since yn+1 appears on both sides, we replace it on the right with the Euler prediction y*n+1 = yn + h f(xn, yn). This yields the explicit formula:
由于 yn+1 出现在等号两边,我们用欧拉预测值 y*n+1 = yn + h f(xn, yn) 替换右侧的 yn+1,从而得到显式公式:
yn+1 = yn + h/2 [ f(xn, yn) + f(xn+1, yn + h f(xn, yn)) ]
4. The Formula Step by Step | 分步公式
In practice, the improved Euler method is carried out in two steps.
在实际操作中,改进欧拉法分两步完成。
Step 1: Predict. Compute the Euler prediction y*n+1.
第一步:预测。计算欧拉预测值 y*n+1。
y*n+1 = yn + h f(xn, yn)
Step 2: Correct. Evaluate the slope at the predicted point and average it with the original slope.
第二步:校正。在预测点处计算斜率,并将其与原始斜率取平均。
yn+1 = yn + h/2 [ f(xn, yn) + f(xn+1, y*n+1) ]
Equivalently, in Runge-Kutta notation:
等价地,使用龙格-库塔记号:
k₁ = h f(xn, yn)
k₂ = h f(xn + h, yn + k₁)
yn+1 = yn + (k₁ + k₂) / 2
5. A Worked Example | 实例演示
) = 1. Use the improved Euler method with step size h = 0.1 to estimate y(0.1) and y(0.2).
考虑微分方程 dy/dx = x + y,初值 y(0) = 1。用改进欧拉法,取步长 h = 0.1,估计 y(0.1) 和 y(0.2)。
At the start, x₀ = 0, y₀ = 1. First compute f(0, 1) = 0 + 1 = 1.
在起点处,x₀ = 0,y₀ = 1。先计算 f(0, 1) = 0 + 1 = 1。
Predict: y* = 1 + 0.1 × 1 = 1.1.
预测:y* = 1 + 0.1 × 1 = 1.1。
Evaluate the slope at the predicted point: f(0.1, 1.1) = 0.1 + 1.1 = 1.2.
在预测点处计算斜率:f(0.1, 1.1) = 0.1 + 1.1 = 1.2。
Correct: y₁ = 1 + 0.1/2 × (1 + 1.2) = 1 + 0.05 × 2.2 = 1.11.
校正:y₁ = 1 + 0.1/2 × (1 + 1.2) = 1 + 0.05 × 2.2 = 1.11。
For the second step, x₁ = 0.1, y₁ = 1.11. Then f(0.1, 1.11) = 1.21.
第二步时,x₁ = 0.1,y₁ = 1.11。于是 f(0.1, 1.11) = 1.21。
Predict: y* = 1.11 + 0.1 × 1.21 = 1.231.
预测:y* = 1.11 + 0.1 × 1.21 = 1.231。
Slope at predicted point: f(0.2, 1.231) = 0.2 + 1.231 = 1.431.
预测点处的斜率:f(0.2, 1.231) = 0.2 + 1.231 = 1.431。
Correct: y₂ = 1.11 + 0.1/2 × (1.21 + 1.431) = 1.11 + 0.05 × 2.641 = 1.24205.
校正:y₂ = 1.11 + 0.1/2 × (1.21 + 1.431) = 1.11 + 0.05 × 2.641 = 1.24205。
For comparison, the exact solution is y = 2eˣ 1, giving y(0.1) ≈ 1.11034 and y(0.2) ≈ 1.24281. Our approximations are remarkably close.
作为对比,精确解为 y = 2eˣ - x - 1,因此 y(0.1) ≈ 1.11034,y(0.2) ≈ 1.24281。我们的近似值非常接近。
6. Error Analysis | 误差分析
Euler's method has a local truncation error of O(h²) and a global error of O(h). The improved Euler method improves this to a local error of O(h³) and a global error of O(h²).
欧拉法的局部截断误差为 O(h²),全局误差为 O(h)。改进欧拉法将局部误差提高到 O(h³),全局误差提高到 O(h²)。
This means that if you halve the step size, the global error of Euler's method is halved, whereas the improved Euler error is divided by four. This makes the improved method far more efficient for the same accuracy.
这意味着若将步长减半,欧拉法的全局误差减半,而改进欧拉法的误差则变为原来的四分之一。因此,在同样的精度要求下,改进方法效率要高得多。
The improvement is achieved by using the trapezoidal rule for the integral, which has a higher-order error than the left rectangle rule used in Euler's method.
这种改进源于对积分使用了梯形法则,其误差阶数高于欧拉法所使用的左矩形法则。
7. Comparison with Euler's Method | 与欧拉法比较
| Aspect | Euler | Improved Euler |
| Slope used | Left endpoint | Average of two slopes |
| Global error | O(h) | O(h²) |
| Function evaluations per step | 1 | 2 |
| Accuracy at h=0.1 for example | 1.11? Wait note below | 1.11034 |
Note: In the example above, Euler' n error of about 0.0103, while the improved Euler gives 1.11 with an error of about 0.0003 — roughly 30 times smaller.
注意:上述例子中,对于 y(0.1),欧拉法得到 y₁ = 1 + 0.1 × 1 = 1.1,误差约为 0.0103,而改进欧拉法得到 1.11,误差约为 0.0003——小了约 30 倍。
Although the improved Euler method requires twice as many function evaluations per step, the dramatically reduced error often allows a much larger step size, saving overall computation.
虽然改进欧拉法每步需要两次函数求值,但误差大幅降低,往往允许使用大得多的步长,从而在整体上节省计算量。
8. Stability Considerations | 稳定性考量
Like all explicit methods, the improved Euler method can become unstable for large step sizes, particularly for stiff differential equations. In general, the stability region for improved Euler is larger than that of the basic Euler method, but still limited.
与所有显式方法一样,对于大步长,特别是刚性微分方程,改进欧拉法也可能变得不稳定。一般来说,改进欧拉的稳定区域比基本欧拉法更大,但仍然有限。
For the linear test equation y' = λy with λ negative, the step size condition for stability becomes |1 + hλ + (hλ)²/2| < 1. This is a more generous constraint than Euler's |1 + hλ| < 1.
对于线性测试方程 y' = λy(λ 为负),稳定性条件变为 |1 + hλ + (hλ)²/2| < 1。这比欧拉法的约束 |1 + hλ| < 1 更宽松。
In A-Level problems, step sizes are usually small enough that stability is not the main concern; accuracy is.
在 A-Level 问题中,步长通常足够小,稳定性不是主要关注点,精度才是。
9. Applying Improved Euler in A-Level | 在 A-Level 中的应用
AQA A-Level Mathematics frequently asks you to apply the improved Euler formula to approximate values of a solution over a given interval. You are typically provided with the formula or expected to recall it.
AQA A-Level 数学经常要求你在给定区间上应用改进欧拉公式来近似解的值。通常题目会提供公式,或要求你记住它。
You should be able to:
你应当能够:
- Set up a table of values for x, y, f(x, y), predicted y, and corrected y.
- 列出一张包含 x、y、f(x,y)、预测 y 和校正 y 的表格。
- Use the formula systematically to avoid arithmetic errors.
- 系统地使用公式,避免算术错误。
- Explain the meaning of each step in the context of the problem.
- 解释题目情境中每一步的含义。
Always write down the intermediate prediction, because examiners award method marks for the predictor step even if the final answer is wrong.
务必写下中间的预测值,因为考官会为预测步骤给方法分,即使最终答案错误。
10. Common Pitfalls | 常见错误
Here are some typical mistakes students make.
以下是学生常犯的一些典型错误。
- Using the corrected value as the prediction in the same step. The prediction must use the original yn only.
- 在同一
Published by TutorHao | A-Level Mathematics Revision Series | aleveler.com
广告 / SponsoredALevel国际高中数学课程 剑桥牛津培生 CAIE Edexcel AQA国际考试局 课本练习册复习指南 英文教材进…数学 备考教辅 · 正版现货 · 与本文内容相关查看详情 / View on Taobao参考价 ¥69.8更多咨询请联系16621398022(同微信)
备考资讯每日更新,关注不错过考纲变化 · 科目分析 · 学习方法
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图公众号:tutorhao