Numerical Methods and Applications | 数值计算方法及其应用

📚 Numerical Methods and Applications | 数值计算方法及其应用

Numerical methods are techniques used to obtain approximate solutions to mathematical problems that are difficult or impossible to solve exactly. They form the backbone of modern scientific computing, enabling us to model physical systems, optimise engineering designs, and analyse financial data.

数值计算方法是用于获得难以或无法精确求解的数学问题的近似解的技术。它们是现代科学计算的基石,使我们能够对物理系统建模、优化工程设计并分析金融数据。


1. Approximation and Errors | 近似与误差

Every numerical method introduces errors. The two main types are truncation error, caused by stopping an infinite process after finitely many steps, and round-off error, caused by representing numbers with limited decimal precision. Understanding these errors is essential for judging the reliability of a computed answer.

每种数值方法都会引入误差。两种主要类型是截断误差(由有限步终止无限过程引起)和舍入误差(由用有限小数精度表示数字引起)。理解这些误差对于判断计算结果的可信度至关重要。

Absolute error is defined as the difference between the approximate value and the true value: |xₐ − x|. Relative error divides this difference by the magnitude of the true value, |xₐ − x| / |x|. In practice, we often use these to decide whether an approximation is ‘good enough’ for the required purpose.

绝对误差定义为近似值与真实值之差:|xₐ − x|。相对误差将此差值除以真实值的大小,即 |xₐ − x| / |x|。在实际中,我们常利用它们来判断近似值是否达到所需目的的“足够好”标准。


2. Taylor Series and Linearisation | 泰勒级数与线性化

The Taylor series expands a function f(x) about a point a as an infinite sum of derivative terms. For a smooth function, the first few terms often provide a powerful approximation: f(x) ≈ f(a) + f′(a)(x − a) + f″(a)(x − a)² / 2! + …

泰勒级数将函数 f(x) 在点 a 附近展开为无穷多项导数和的形式。对于光滑函数,前几项往往就能提供很强的近似:f(x) ≈ f(a) + f′(a)(x − a) + f″(a)(x − a)² / 2! + …

Linearisation keeps only the constant and first-order terms. This is widely used in physics and economics to simplify complex relationships near an operating point. For example, the pendulum equation sin θ ≈ θ for small angles is a classic linearisation.

线性化仅保留常数项和一阶项。这在物理学和经济学中广泛用于在运行点附近简化复杂关系。例如,小角度下单摆方程 sin θ ≈ θ 就是经典的线性化。

f(x) = eˣ ≈ 1 + x + x²/2 + x³/6 + … (near x = 0)

When x is close to 0, even a third-order Taylor polynomial gives very accurate values for eˣ. This demonstrates how numerical approximations can replace complicated function evaluations in manual calculations.

当 x 接近 0 时,即使三阶泰勒多项式也能给出 eˣ 非常精确的值。这表明数值近似如何在手动计算中替代复杂的函数求值。


3. The Bisection Method | 二分法

The bisection method is a root-finding algorithm based on the Intermediate Value Theorem. If a continuous function f(x) changes sign on an interval [a, b], then there is at least one root in that interval. The method repeatedly halves the interval while keeping the root inside.

二分法是基于介值定理的求根算法。如果连续函数 f(x) 在区间 [a, b] 两端符号相反,则区间内至少存在一个根。该方法不断将区间减半,同时使根保持在其中。

Algorithm steps: compute the midpoint m = (a + b)/2; if f(m) = 0, we are done; otherwise replace either a or b with m depending on the sign change. The interval width halves each step, so the error after n steps is (b − a)/2ⁿ.

算法步骤:计算中点 m = (a + b)/2;若 f(m) = 0,则结束;否则根据符号变化用 m 替换 a 或 b。每步区间宽度减半,因此 n 步后的误差为 (b − a)/2ⁿ。

xₙ → r as n → ∞, with error ≤ (b − a)/2ⁿ

For example, to solve x³ − 2x − 5 = 0, start with [2, 3]. The function values are f(2) = −1 and f(3) = 16, so a root lies between. After 10 iterations the interval is approximately 0.001 wide, giving a highly accurate root.

例如,求解 x³ − 2x − 5 = 0,可从区间 [2, 3] 开始。函数值为 f(2) = −1,f(3) = 16,因此根位于其间。经过 10 次迭代后区间宽度约为 0.001,从而得到非常精确的根。


4. The Newton–Raphson Method | 牛顿-拉弗森方法

The Newton–Raphson method uses tangents to approximate a root of f(x) = 0. Starting from an initial guess x₀, the next approximation is obtained by drawing the tangent at x₀ and finding where it crosses the x-axis.

牛顿-拉弗森方法利用切线来近似求解 f(x) = 0 的根。从初始猜测 x₀ 出发,通过作 x₀ 处的切线并求其与 x 轴的交点来获得下一个近似值。

xₙ₊₁ = xₙ − f(xₙ) / f′(xₙ)

This formula is derived from the equation of the tangent line. Under suitable conditions, the method converges quadratically, meaning that the number of accurate digits roughly doubles at each step. However, it requires a good initial guess and a non-zero derivative.

该公式由切线方程推导而来。在适当条件下,该方法具有二次收敛性,即每步有效数字大致翻倍。然而,它需要良好的初始猜测且导数不为零。

To solve x³ − 2x − 5 = 0 using Newton’s method, choose x₀ = 2. Then f(2) = −1 and f′(2) = 10, so x₁ = 2 − (−1)/10 = 2.1. Continuing gives x₂ ≈ 2.09457, already very close to the true root ≈ 2.09455.

使用牛顿法求解 x³ − 2x − 5 = 0,取 x₀ = 2。则 f(2) = −1,f′(2) = 10,所以 x₁ = 2 − (−1)/10 = 2.1。继续计算得 x₂ ≈ 2.09457,已经非常接近真实根 ≈ 2.09455。


5. Fixed-Point Iteration | 不动点迭代

A fixed point of a function g(x) is a number x such that g(x) = x. To solve an equation f(x) = 0, we can rewrite it as x = g(x) and iterate xₙ₊₁ = g(xₙ). If the sequence converges, its limit is a root of the original equation.

函数 g(x) 的不动点是满足 g(x) = x 的数。为了求解 f(x) = 0,我们可以将其改写为 x = g(x),然后迭代 xₙ₊₁ = g(xₙ)。如果序列收敛,其极限就是原方程的根。

The convergence condition is that |g′(x)| < 1 near the fixed point. When this holds, the iteration contracts distances and drives the sequence toward the solution. If |g′(x)| > 1, the iteration diverges.

收敛条件是在不动点附近 |g′(x)| < 1。当该条件成立时,迭代会压缩距离并使序列逼近解。若 |g′(x)| > 1,则迭代发散。

For example, to solve x³ = 4, rewrite as x = ⁴√x or x = (x³ + 4)/3? Actually a simple form is x = 4/x², but that may not converge. Choosing g(x) = (x + 4/x)/2 gives convergence. Careful reformulation is the key.

例如,求解 x³ = 4,可改写为 x = ⁴√x 或 x = (x³ + 4)/x²? 实际上简单的形式是 x = 4/x²,但未必收敛。选择 g(x) = (x + 4/x)/2 则可收敛。谨慎改写是关键。


6. Numerical Integration: Trapezoidal Rule | 数值积分:梯形法则

Many integrals cannot be evaluated in closed form. The trapezoidal rule approximates the area under a curve by dividing the interval [a, b] into n subintervals of equal width h = (b − a)/n and joining consecutive points by straight lines.

许多积分无法求出闭式解。梯形法则将区间 [a, b] 分成 n 个等宽子区间,宽度 h = (b − a)/n,并用直线连接相邻点,从而近似曲线下的面积。

∫ₐᵇ f(x) dx ≈ (h/2) [f(x₀) + 2f(x₁) + 2f(x₂) + … + 2f(xₙ₋₁) + f(xₙ)]

The error of the trapezoidal rule is proportional to h², so doubling the number of intervals reduces the error by a factor of about 4. It works best for smooth functions with small second derivatives.

梯形法则的误差与 h² 成正比,因此将区间数加倍可使误差大约减小为原来的 1/4。它最适合二阶导数较小的光滑函数。

As an example, approximate ∫₀¹ x² dx with n = 4. The step h = 0.25, and the trapezoidal sum gives 0.34375, while the exact value is 1/3 ≈ 0.3333. The error is about 0.0104.

例如,用 n = 4 近似 ∫₀¹ x² dx。步长 h = 0.25,梯形求和得 0.34375,而精确值为 1/3 ≈ 0.3333。误差约为 0.0104。


7. Numerical Integration: Simpson’s Rule | 数值积分:辛普森法则

Simpson’s rule improves on the trapezoidal rule by using parabolic arcs instead of straight lines. It requires an even number of subintervals n and groups points in sets of three. The formula is:

辛普森法则通过使用抛物线弧而非线段来改进梯形法则。它要求 n 为偶数,并将点按三个一组。公式为:

∫ₐᵇ f(x) dx ≈ (h/3) [f(x₀) + 4f(x₁) + 2f(x₂) + 4f(x₃) + … + 2f(xₙ₋₂) + 4f(xₙ₋₁) + f(xₙ)]

The pattern of coefficients is 1, 4, 2, 4, 2, …, 2, 4, 1. The error is proportional to h⁴, which is much smaller than the trapezoidal rule for the same number of intervals. Simpson’s rule is exact for polynomials of degree up to 3.

系数模式为 1, 4, 2, 4, 2, …, 2, 4, 1。误差与 h⁴ 成正比,在相同区间数下远小于梯形法则。辛普森法则对次数不超过 3 的多项式是精确的。

Using the same integral ∫₀¹ x² dx with n = 4, Simpson’s rule gives exactly 1/3, because x² is degree 2. Thus it beats the trapezoidal rule in both accuracy and efficiency for smooth functions.

对同一积分 ∫₀¹ x² dx 取 n = 4,辛普森法则精确给出 1/3,因为 x² 是二次函数。因此对于光滑函数,它在精度和效率上都优于梯形法则。


8. Euler’s Method for Differential Equations | 欧拉法求解微分方程

Euler’s method is the simplest numerical technique for solving initial value problems of the form dy/dx = f(x, y), y(x₀) = y₀. It approximates the solution curve by a series of short line segments using the slope at each known point.

欧拉法是求解形如 dy/dx = f(x, y),y(x₀) = y₀ 的初值问题的最简单数值方法。它利用每个已知点处的斜率,用一系列短线段逼近解曲线。

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

Here h is the step size. The local error is proportional to h², but the global error over a fixed interval is proportional to h, so making h smaller improves accuracy linearly. Euler’s method is easy to implement but often requires very small steps for acceptable precision.

其中 h 是步长。局部误差与 h² 成正比,但固定区间上的全局误差与 h 成正比,因此减小 h 会线性地提高精度。欧拉法易于实现,但要达到可接受的精度通常需要非常小的步长。

For example, solve dy/dx = y, y(0) = 1, with h = 0.1. Then y₁ = 1 + 0.1 × 1 = 1.1, y₂ = 1.1 + 0.1 × 1.1 = 1.21, and so on. The exact solution is y = eˣ, so y(1) ≈ 2.718, while Euler’s method with 10 steps gives about 2.5937.

例如,求解 dy/dx = y,y(0) = 1,取 h = 0.1。则 y₁ = 1 + 0.1 × 1 = 1.1,y₂ = 1.1 + 0.1 × 1.1 = 1.21,依此类推。精确解为 y = eˣ,所以 y(1) ≈ 2.718,而欧拉法用 10 步给出约 2.5937。


9. Applications in Real-World Problems | 实际应用

Numerical methods are essential whenever exact formulas are unavailable. In engineering, Newton–Raphson solves nonlinear circuit equations; in physics, Euler’s method simulates planetary motion; in finance, numerical integration prices options under complex models.

每当没有精确公式时,数值方法都是必不可少的。在工程中,牛顿-拉弗森法求解非线性电路方程;在物理中,欧拉法模拟行星运动;在金融中,数值积分为复杂模型下的期权定价。

Table: Common numerical methods and their typical uses

Method Application
Bisection Finding roots of continuous functions
Newton–Raphson Fast root finding when derivative is available
Trapezoidal / Simpson Approximating definite integrals
Euler Solving differential equations

Each method trades off speed, accuracy, and implementation effort. A good numerical analyst understands these trade-offs and chooses appropriately for the problem at hand.

每种方法都在速度、精度和实现成本之间进行权衡。优秀的数值分析者能够理解这些权衡,并根据手头的问题做出适当选择。


10. Choosing the Right Method | 如何选择合适的方法

The choice of a numerical method depends on several factors: whether the function is differentiable, how smooth it is, whether accuracy is critical, and how much computation is allowed. There is no single ‘best’ method for all problems.

数值方法的选择取决于多个因素:函数是否可微、光滑程度如何、精度是否关键,以及允许的计算量有多大。不存在对所有问题都“最好”的单一方法。

For root finding, bisection is robust but slow, while Newton–Raphson is fast but may fail without a good initial guess. For integration, Simpson’s rule gives high accuracy for smooth functions, but the trapezoidal rule is easier when data values are equally spaced and noisy.

对于求根,二分法稳健但较慢,而牛顿-拉弗森法快速但在没有良好初始猜测时可能失败。对于积分,辛普森法则对光滑函数精度高,但当数据等距且含噪时梯形法则更简单。

For differential equations, Euler’s method is a good starting point, but more advanced methods like Runge–Kutta are preferred in practice. Examinations often require you to apply a given method rather than choose the best one.

对于微分方程,欧拉法是一个很好的起点,但实践中更偏好如龙格-库塔等更高级的方法。考试中通常要求你应用给定方法,而不是选择最佳方法。


11. Error Control and Convergence | 误差控制与收敛性

Convergence describes how quickly a numerical approximation approaches the exact answer as the step size tends to zero or as the iteration count increases. Linear convergence means error shrinks by a constant factor; quadratic convergence means error squares at each step.

收敛性描述了当步长趋于零或迭代次数增加时,数值近似逼近精确答案的速度。线性收敛意味着误差按常数因子缩小;二次收敛意味着每步误差平方。

To control errors, one can use adaptive methods that refine the step size where the function changes rapidly. For example, Simpson’s rule with an error estimate can halve h automatically until the estimated error is below a tolerance.

为了控制误差,可以使用自适应方法,在函数变化剧烈的地方细化步长。例如,带误差估计的辛普森法则可以自动减半 h,直到估计误差低于容差。

In exam settings, you may be asked to compare errors: doubling n in the trapezoidal rule roughly quarters the error, while doubling n in Simpson’s rule reduces the error by a factor of 16. This reflects the orders of convergence.

在考试场景中,你可能会被要求比较误差:梯形法则中 n 加倍误差大约减为 1/4,而辛普森法则中 n 加倍误差减为 1/16。这反映了收敛阶的不同。


12. Conclusion | 总结

Numerical methods transform complex mathematical problems into computable algorithms. From root finding to integration and differential equations, these techniques give us practical answers when exact solutions are out of reach. Understanding their strengths, weaknesses, and error behaviour is a core examination requirement.

数值计算方法将复杂的数学问题转化为可计算的算法。从求根到积分再到微分方程,当精确解遥不可及时,这些技术为我们提供了实用的答案。理解它们的优缺点和误差行为是核心考试要求。

Accuracy ↔ Efficiency ↔ Robustness: the eternal triangle of numerical analysis

精度 ↔ 效率 ↔ 稳健性:数值分析永恒的三角

Mastering these methods gives you a powerful toolkit for mathematics, science, and engineering. Practice applying them to simple problems before tackling more complex ones.

掌握这些方法将为你提供数学、科学和工程领域的强大工具。在解决更复杂的问题之前,先练习将它们应用于简单问题。

Published by TutorHao | Mathematics Revision Series | aleveler.com

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

Comments

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

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