Euler’s Method in Numerical Solutions of Differential Equations | 欧拉法在微分方程数值解中的应用

📚 Euler’s Method in Numerical Solutions of Differential Equations | 欧拉法在微分方程数值解中的应用

Differential equations describe countless real-world processes, from population dynamics to cooling of objects. However, many equations cannot be solved exactly using elementary functions. Euler’s method is a fundamental numerical technique that approximates solutions by moving step by step along tangent lines. It is a key topic in IB Mathematics, especially in the Applications and Interpretation (AI) and Analysis and Approaches (AA) Higher Level courses.

微分方程描述了无数现实世界的过程,从种群动态到物体冷却。然而,许多方程无法用初等函数精确求解。欧拉法是一种基础数值方法,通过沿切线段逐步前进来逼近解。它是IB数学中的关键主题,尤其在数学应用与解释(AI)和数学分析与方法(AA)高级课程中。


1. Why Numerical Solutions Are Needed | 为什么需要数值解

Only a small class of differential equations can be solved analytically, such as separable, linear, or exact equations. For more complex equations, an explicit formula may not exist. Numerical methods allow us to approximate the value of the solution at chosen points, which is often enough for engineering, physics, and data science applications.

只有一小类微分方程可以解析求解,例如可分离变量方程、线性方程或恰当方程。对于更复杂的方程,显式公式可能不存在。数值方法允许我们在选定的点上逼近解的值,这通常足以满足工程学、物理学和数据科学的应用需求。

Euler’s method applies to first-order initial value problems of the form y′ = f(x, y), with y(x₀) = y₀. The aim is to find approximate values of y at successive x-values using a fixed step size h.

欧拉法适用于形如 y′ = f(x, y) 的一阶初值问题,且满足 y(x₀) = y₀。其目标是使用固定步长 h 在连续的 x 值处求出 y 的近似值。


2. The Core Idea Behind Euler’s Method | 欧拉法的核心思想

The derivative y′(x) gives the slope of the tangent to the solution curve at a point. If we know the value of y at xₙ, we can use the slope f(xₙ, yₙ) to estimate the next value y at xₙ₊₁ = xₙ + h. This is equivalent to following a short tangent segment instead of the true curve.

导数 y′(x) 给出了解曲线在某一点的切线斜率。如果我们知道 y 在 xₙ 处的值,就可以利用斜率 f(xₙ, yₙ) 来估计下一个点 xₙ₊₁ = xₙ + h 处的 y 值。这相当于沿着一个短的切线段而不是真实曲线前进。

The method is derived from the definition of the derivative, where the forward difference quotient is a simple approximation:

该方法的推导基于导数的定义,其中前向差商是一个简单的近似表达式:

y′(x) ≈ (y(x + h) – y(x)) / h

Rearranging this expression gives a prediction for the next y-value. This local linear approximation is the engine of Euler’s method.

重新整理该表达式即可得到下一个 y 值的预测。这种局部线性近似正是欧拉法的核心。


3. The Euler Formula | 欧拉公式

Given the initial value problem y′ = f(x, y), y(x₀) = y₀, and a step size h, the iterative formula is:

给定初值问题 y′ = f(x, y),y(x₀) = y₀ 以及步长 h,迭代公式为:

yₙ₊₁ = yₙ + h · f(xₙ, yₙ)

where xₙ₊₁ = xₙ + h, and n = 0, 1, 2, … . The term f(xₙ, yₙ) is the slope of the tangent at the point (xₙ, yₙ). The formula uses only information from the current point, so Euler’s method is called an explicit one-step method.

其中 xₙ₊₁ = xₙ + h,且 n = 0, 1, 2, … 。项 f(xₙ, yₙ) 是点 (xₙ, yₙ) 处切线的斜率。该公式仅使用当前点的信息,因此欧拉法被称为显式单步方法。

In practice, we create a table with columns for xₙ, yₙ, f(xₙ, yₙ), h · f(xₙ, yₙ), and yₙ₊₁. This systematic layout is recommended in IB exam answers.

在实践中,我们制作一个表格,包含 xₙ、yₙ、f(xₙ, yₙ)、h · f(xₙ, yₙ) 和 yₙ₊₁ 等列。这种系统化的布局在IB考试答案中非常推荐。


4. Geometric Interpretation | 几何意义

Imagine a smooth solution curve passing through the initial point. At this point, the tangent line matches the direction of the curve. Euler’s method follows this straight line for a short distance h, arriving at a new point. Then the tangent is recalculated at the new point, and the process repeats.

想象一条光滑的解曲线经过初始点。在该点,切线的方向与曲线一致。欧拉法沿着这条直线前进一小段距离 h,到达一个新的点。然后在新点处重新计算切线,并重复该过程。

Thus the approximate solution is a polygonal path consisting of small straight segments. As h decreases, the polygonal path becomes closer to the true curve. This geometric view helps explain why Euler’s method is also known as the tangent line method.

因此,近似解是由许多小直线段组成的折线路径。随着 h 减小,折线路径越来越接近真实曲线。这种几何视角解释了为什么欧拉法也被称为切线法。


5. Worked Example | 计算示例

Consider the simple initial value problem y′ = y, y(0) = 1. The exact solution is y = eˣ. We will approximate y(0.2) using Euler’s method with step size h = 0.1.

考虑简单的初值问题 y′ = y,y(0) = 1。精确解为 y = eˣ。我们使用步长 h = 0.1 的欧拉法来近似 y(0.2)。

Start with n = 0: x₀ = 0, y₀ = 1. Since f(x, y) = y, we have f(0, 1) = 1. Then:

从 n = 0 开始:x₀ = 0,y₀ = 1。由于 f(x, y) = y,我们有 f(0, 1) = 1。于是:

y₁ = 1 + 0.1 × 1 = 1.1

For the second step, n = 1: x₁ = 0.1, y₁ = 1.1, and f(0.1, 1.1) = 1.1. Therefore:

第二步,n = 1:x₁ = 0.1,y₁ = 1.1,且 f(0.1, 1.1) = 1.1。因此:

y₂ = 1.1 + 0.1 × 1.1 = 1.21

The Euler approximation gives y(0.2) ≈ 1.21, while the exact value is e⁰·² ≈ 1.22140. The error is about 0.011, which is relatively small for two steps. Reducing h would improve the accuracy.

欧拉法得到的近似值为 y(0.2) ≈ 1.21,而精确值 e⁰·² ≈ 1.22140。误差约为 0.011,对于两步来说相对较小。减小 h 可以提高精度。


6. Choosing the Step Size | 步长的选择

The step size h determines both the accuracy and the computational cost of Euler’s method. A smaller h generally gives a more accurate result because the tangent line is used over a shorter interval, but it also requires more iterations. A larger h runs faster but may produce a poor approximation.

步长 h 同时决定欧拉法的精度和计算成本。较小的 h 通常会得到更精确的结果,因为切线在更短的区间内使用,但也需要更多迭代。较大的 h 运行更快,但可能产生较差的近似值。

In IB problems, the step size is often given. However, students should understand that halving h roughly doubles the number of calculations, while the global error is expected to decrease by a factor of about one-half. This linear relationship between h and global error is a distinctive feature of Euler’s method.

在IB题目中,步长通常是给定的。然而,学生应理解,将 h 减半大约会使计算次数翻倍,而全局误差预计会减小到原来的一半左右。h 与全局误差之间的这种线性关系是欧拉法的一个显著特征。

When choosing h manually, it is wise to compare approximations at different step sizes to detect convergence. For example, compute y(0.2) with h = 0.1 and h = 0.05; if the results are close, the approximation is likely reliable.

当手动选择 h 时,比较不同步长下的近似值是明智的,以观察收敛性。例如,分别用 h = 0.1 和 h = 0.05 计算 y(0.2);如果结果接近,则近似值很可能可靠。


7. Local and Global Truncation Errors | 局部与全局截断误差

The error introduced in a single step of Euler’s method is called the local truncation error. Using Taylor expansion, one can show that this local error is proportional to h², written as O(h²). Over a fixed interval, the number of steps is proportional to 1/h, so the accumulated global error is proportional to h, written as O(h).

欧拉法单步引入的误差称为局部截断误差。通过泰勒展开式可以证明,该局部误差与 h² 成正比,记为 O(h²)。在固定区间上,步数与 1/h 成正比,因此累积的全局误差与 h 成正比,记为 O(h)。

This distinction is important. A smaller step size reduces the local error quadratically, but because there are more steps, the global improvement is only linear. In practice, this means that to reduce the global error by a factor of 10, the step size must be divided by 10, requiring 10 times more work.

这种区别非常重要。较小的步长可以二次方地减小局部误差,但由于步数增多,全局改进只是线性的。在实践中,这意味着要将全局误差减小10倍,必须将步长除以10,这需要10倍的计算量。

Students should also remember that Euler’s method is first-order accurate, which is why it is rarely used in professional software. Nevertheless, it provides a conceptual foundation for more advanced methods.

学生还应记住,欧拉法是一阶精度的方法,这就是为什么它在专业软件中很少使用。尽管如此,它为更高级的方法提供了概念基础。


8. Euler’s Method in IB Examinations | IB考试中的欧拉法

Euler’s method appears in both IB Mathematics AI HL and AA HL syllabi. Common exam questions ask students to perform a fixed number of iterations, complete a table, or estimate a value at a given x. The method may be presented in a “calculator-free” or “calculator-allowed” section, depending on the arithmetic involved.

欧拉法出现在IB数学AI HL和AA HL的课程大纲中。常见的考题要求学生执行固定次数的迭代、完善表格,或在给定x处估计数值。根据涉及的计算复杂程度,该方法可能出现在“不允许使用计算器”或“允许使用计算器”的部分。

To score full marks on exam questions, follow these steps:

为了在考题中拿到满分,请遵循以下步骤:

  • Identify the differential equation, the initial condition, the step size h, and the target x-value.

    识别微分方程、初始条件、步长 h 和目标 x 值。

  • Set up a table with x₀, y₀, f(x₀, y₀), h·f(x₀, y₀), and the next y value.

    建立表格,包含 x₀、y₀、f(x₀, y₀)、h·f(x₀, y₀) 以及下一个 y 值。

  • Repeat until the desired x is reached, writing down intermediate values clearly.

    重复迭代直到达到目标 x 值,并清晰地写下中间值。

  • Give the final approximation with an appropriate number of significant figures, often four or five.

    给出最终的近似值,使用适当位数的有效数字,通常为四位或五位。

Marks are usually awarded for correct recurrence calculations, not just for the final answer, so showing the table is essential.

分数通常根据正确的递推计算过程来评定,而不仅仅是最终答案,因此展示表格是必不可少的。


9. Using a GDC for Euler’s Method | 使用图形计算器实现欧拉法

Modern graphing calculators can automate Euler’s method, which saves time and reduces arithmetic errors. On the TI-Nspire, for instance, users can define a function f(x, y), use a spreadsheet or a loop, and generate successive y-values. The exact commands depend on the model, but the underlying process is always the same.

现代图形计算器可以自动执行欧拉法,节省时间并减少算术错误。例如,在TI-Nspire上,用户可以定义函数 f(x, y),使用电子表格或循环来生成连续的 y 值。具体命令因型号而异,但底层过程始终相同。

A simple manual GDC method involves using the recurrence via the “previous answer” feature. Store y₀ in a variable, then repeatedly enter y + h·f(x, y) and update x accordingly. This is especially useful when h is not too small.

一种简单的手动计算器方法是通过“上一步答案”功能实现递推。将 y₀ 存储在一个变量中,然后反复输入 y + h·f(x, y),并相应更新 x。当 h 不太小时,这一方法尤为有用。

However, students should not rely blindly on the GDC. In non-calculator exams, they must be able to perform the iteration by hand. In calculator-allowed exams, the GDC can be used to check answers, but the written steps are still required for full marks.

然而,学生不应盲目依赖图形计算器。在不允许使用计算器的考试中,他们必须能够手动执行迭代。在允许使用计算器的考试中,可以用计算器检查答案,但书面步骤仍然对满分至关重要。


10. Limitations of Euler’s Method | 欧拉法的局限性

Euler’s method is simple to understand and implement, but it has serious limitations. The linear error behaviour means that very small step sizes are needed to achieve high accuracy, which can be computationally expensive. For some equations, particularly stiff differential equations, Euler’s method may require impractically small h values to avoid instability.

欧拉法易于理解和实现,但有严重的局限性。线性误差行为意味着需要非常小的步长才能实现高精度,这可能导致计算成本高昂。对于某些方程,尤其是刚性微分方程,欧拉法可能需要小到不切实际的 h 值以避免不稳定性。

Another limitation is that the method is not self-correcting: small errors can accumulate and even grow over many steps. This makes Euler’s method unsuitable for long-time simulations of chaotic systems or orbits. In such contexts, higher-order methods are preferred.

另一个限制是该方法不具备自我修正能力:小误差可能在多个步骤中积累甚至增长。这使得欧拉法不适用于混沌系统或轨道问题的长期模拟。在这种情况下,高阶方法更受青睐。

Understanding these limitations helps IB students appreciate why numerical analysis is a sophisticated field and why more advanced methods were developed.

理解这些局限性有助于IB学生认识到数值分析为何是一个深奥的领域,以及为何要发展更高级的方法。


11. Beyond Euler: Improved Euler and Runge-Kutta | 超越欧拉:改进欧拉法与龙格-库塔

To improve accuracy, the improved Euler method, also known as Heun’s method, uses a predictor-corrector idea. First, a preliminary value yₙ₊₁* is computed using the basic Euler step. Then the slope at this predicted point is averaged with the original slope:

为了提高精度,改进欧拉法(也称为Heun法)采用预估-校正思想。首先,使用基础欧拉步长计算初步值 yₙ₊₁*。然后将该预测点处的斜率与原斜率取平均:

yₙ₊₁* = yₙ + h · f(xₙ, yₙ)

yₙ₊₁ = yₙ + (h/2) · [f(xₙ, yₙ) + f(xₙ₊₁, yₙ₊₁*)]

Heun’s method has a global error of O(h²), which is a significant improvement over Euler’s O(h). In many IB textbooks, Heun’s method is presented as an optional extension or for enrichment.

Heun法的全局误差为 O(h²),相比欧拉法的 O(h) 是显著改进。在许多IB教材中,Heun法作为可选扩展或加深内容呈现。

For even greater accuracy, fourth-order Runge-Kutta methods (RK4) are often used in real applications. RK4 evaluates f at four carefully chosen points within each step, achieving a global error of O(h⁴). Although the formulas are more involved, modern calculators make them easy to apply.

为了获得更高的精度,实际应用中常使用四阶龙格-库塔方法(RK4)。RK4在每一步内选择四个精心设计的点来评估 f,其全局误差达到 O(h⁴)。尽管公式较为复杂,但现代计算器使它们易于应用。


12. Summary | 小结

Euler’s method is the simplest numerical technique for solving first-order initial value problems. It uses tangent lines to approximate the solution curve, with the recurrence relation yₙ₊₁ = yₙ + h·f(xₙ, yₙ). The method is easy to implement by hand or with a GDC, and it demonstrates important ideas such as discretisation, step size, and truncation error.

欧拉法是求解一阶初值问题最简单的数值方法。它利用切线来近似解曲线,递推关系为 yₙ₊₁ = yₙ + h·f(xₙ, yₙ)。该方法易于手动或使用图形计算器实现,并展示了离散化、步长和截断误差等重要概念。

In IB examinations, students should be comfortable with creating tables of values, estimating solutions at specific x-coordinates, and understanding how the step size affects accuracy. They should also be aware of the method’s limitations and the existence of more advanced methods such as Heun’s method and Runge-Kutta.

在IB考试中,学生应熟练掌握创建数值表格、估计特定x坐标处解的值,并理解步长如何影响精度。他们还应当了解该方法的局限性,以及更高级方法如Heun法和龙格-库塔法的存在。

Mastering Euler’s method not only earns marks in exams but also builds intuition for numerical mathematics that is valuable in university-level study and real-world modelling.

掌握欧拉法不仅能在考试中得分,还能为大学阶段的学习和现实世界建模积累宝贵的数值数学直觉。

Published by TutorHao | IB Mathematics Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version