📚 Numerical Methods for First Order Differential Equations | 一阶微分方程的数值解法
Many first order differential equations arise in A-level modelling, but only a small class can be solved exactly by methods such as separation of variables or integrating factors. When an analytic solution is impossible or impractical, numerical methods let us approximate the solution curve step by step from a given initial condition.
许多一阶微分方程出现在 A-level 建模中,但只有一小类能通过分离变量法或积分因子法精确求解。当解析解无法求得或计算不切实际时,数值方法可以从给定的初始条件出发,逐步近似解曲线。
1. First Order ODEs and the Need for Numerical Methods | 一阶微分方程与数值方法的必要性
A first order differential equation is usually written as dy/dx = f(x, y) with an initial condition y(x₀) = y₀. We seek values of y at later x-values. Numerical methods replace the continuous derivative with a finite difference over a small step h, so yₙ₊₁ is estimated from yₙ and the slope f(xₙ, yₙ).
一阶微分方程通常写成 dy/dx = f(x, y),并给出初始条件 y(x₀) = y₀。我们需要求后续 x 值处的 y 值。数值方法用小区间 h 上的有限差分代替连续导数,因此 yₙ₊₁ 由 yₙ 和斜率 f(xₙ, yₙ) 估计得到。
In the AQA A-Level course, numerical methods are tested mainly through Euler’s method, but related step-by-step methods such as the improved Euler method and the midpoint method are useful extensions and appear in further study.
在 AQA A-Level 课程中,数值方法主要考查欧拉法,但相关的逐步方法,如改进欧拉法和中点法,是有用的扩展,并在进一步学习中出现。
2. Euler’s Method: The Basic Stepping Formula | 欧拉法:基本递推公式
Euler’s method uses the tangent line at the current point (xₙ, yₙ) to estimate yₙ₊₁. If h = xₙ₊₁ − xₙ is the step size, the formula is:
欧拉法使用当前点 (xₙ, yₙ) 处的切线来估计 yₙ₊₁。若步长为 h = xₙ₊₁ − xₙ,则公式为:
yₙ₊₁ = yₙ + h f(xₙ, yₙ)
Here f(xₙ, yₙ) is the gradient given by the differential equation at the current point. The method advances x by h and updates y using this gradient. It is a first-order method because the global error after many steps is proportional to h.
其中 f(xₙ, yₙ) 是微分方程在当前点给出的斜率。该方法将 x 向前推进 h,并使用该斜率更新 y。它是一阶方法,因为经过多步后全局误差与 h 成正比。
3. Worked Example of Euler’s Method | 欧拉法示例
Consider dy/dx = x + y with y(0) = 1. Use Euler’s method with step size h = 0.1 to approximate y(0.2).
考虑 dy/dx = x + y,初始条件 y(0) = 1。用欧拉法,步长 h = 0.1,近似 y(0.2)。
| n | xₙ | yₙ | f(xₙ, yₙ) = xₙ + yₙ | yₙ₊₁ = yₙ + h f(xₙ, yₙ) |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 1.1 |
| 1 | 0.1 | 1.1 | 1.2 | 1.22 |
After two steps, the approximate value is y(0.2) ≈ 1.22. The exact solution is y = −x − 1 + 2eˣ, so y(0.2) = 1.2428055… The error is about 0.0228, which is expected with a relatively large step size.
两步后,近似值为 y(0.2) ≈ 1.22。精确解为 y = −x − 1 + 2eˣ,因此 y(0.2) = 1.2428055…。误差约为 0.0228,这对于较大的步长来说是预期内的。
4. Step Size and Local Error | 步长与局部误差
For Euler’s method, the error made in one step is called the local truncation error. It is approximately proportional to h², because the method uses only the first derivative and ignores higher-order terms in the Taylor expansion.
对于欧拉法,单步产生的误差称为局部截断误差。它近似与 h² 成正比,因为该方法只使用一阶导数,忽略了泰勒展开中的高阶项。
When many steps are taken, these local errors accumulate. The global error is roughly proportional to the number of steps times h², which gives an overall error proportional to h. Therefore, halving h approximately halves the global error for Euler’s method.
当进行多步计算时,这些局部误差会累积。全局误差大致与步数乘以 h² 成正比,因此整体误差与 h 成正比。所以对于欧拉法,步长减半大约使全局误差减半。
5. Improved Euler Method (Heun’s Method) | 改进欧拉法(休恩法)
The improved Euler method, also called Heun’s method, uses an average of two slopes: the slope at the current point and the slope at a predicted next point. It is a predictor-corrector method.
改进欧拉法,又称休恩法,使用两个斜率的平均值:当前点的斜率与预测下一点的斜率。它是一种预估-校正方法。
k₁ = f(xₙ, yₙ)
k₂ = f(xₙ + h, yₙ + h k₁)
yₙ₊₁ = yₙ + h/2 (k₁ + k₂)
This method has a local truncation error proportional to h³ and a global error proportional to h², so it is more accurate than Euler’s method for the same step size.
该方法的局部截断误差与 h³ 成正比,全局误差与 h² 成正比,因此在相同步长下比欧拉法更精确。
6. Midpoint Method (Modified Euler) | 中点法(修正欧拉法)
The midpoint method estimates the slope at the midpoint of the interval and then uses that slope to advance the solution. It is also a second-order method.
中点法估计区间中点处的斜率,然后用该斜率推进解。它也是一种二阶方法。
k₁ = f(xₙ, yₙ)
k₂ = f(xₙ + h/2, yₙ + h k₁/2)
yₙ₊₁ = yₙ + h k₂
The midpoint method and the improved Euler method have the same order of accuracy, but they use different slope evaluations. In practice, they often give very similar results.
中点法和改进欧拉法具有相同的精度阶数,但它们使用不同的斜率估计方式。在实际中,它们通常给出非常相似的结果。
7. Comparing Euler, Improved Euler and Midpoint Methods | 比较欧拉法、改进欧拉法与中点法
| Method | One-step formula | Local error order | Global error order |
|---|---|---|---|
| Euler | yₙ₊₁ = yₙ + h f(xₙ, yₙ) | O(h²) | O(h) |
| Improved Euler | yₙ₊₁ = yₙ + h/2 (k₁ + k₂) | O(h³) | O(h²) |
| Midpoint | yₙ₊₁ = yₙ + h k₂ | O(h³) | O(h²) |
Euler’s method is the simplest but least accurate for a given step size. The improved Euler and midpoint methods require two slope evaluations per step, but their global error decreases quadratically when h is reduced.
欧拉法最简单,但在给定步长下精度最低。改进欧拉法和中点法每步需要计算两次斜率,但当步长减小时,它们的全局误差以二次方速率下降。
8. Error Analysis: Local vs Global, Truncation vs Rounding | 误差分析:局部与全局、截断与舍入
Numerical errors come from two main sources. Truncation error occurs because the method replaces the true Taylor series with a finite approximation. Rounding error occurs because calculators and computers store only a limited number of digits.
数值误差主要来自两个来源。截断误差是因为方法用有限近似替代了真实的泰勒级数。舍入误差是因为计算器和计算机只能存储有限位数。
For Euler’s method, the global truncation error behaves like C h, while for the improved methods it behaves like D h². Using a smaller h reduces truncation error but increases the number of calculations, which can increase rounding error. In exams, you should keep several decimal places during working and round only the final answer.
对于欧拉法,全局截断误差表现为 C h;对于改进方法,全局截断误差表现为 D h²。减小 h 可以减少截断误差,但会增加计算次数,从而可能增加舍入误差。在考试中,计算过程应保留多位小数,最后再对答案进行舍入。
9. Step Size and Numerical Stability | 步长与数值稳定性
For equations such
Published by TutorHao | A-Level Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply