# 偏微分方程的数值方法

偏微分方程（PDE）的数值方法，是把一个精确解通常无法以闭式给出的连续偏微分方程，替换为有限个代数方程或常微分方程组成的系统、使其计算解逼近真解的计算程序。主要的方法族系有有限差分、有限元、有限体积和谱方法，其设计受三条相互关联的要求支配：离散格式与偏微分方程的相容性、格式的稳定性，以及当离散不断加密时计算解的收敛性。<sup>[1](https://math.mit.edu/~stevenj/18.336/)</sup>

| 关键事实 | 说明 |
|---|---|
| 方法族系 | 有限差分、有限元、有限体积、谱（配点）和边界元方法，可施用于均匀、非均匀、结构化和非结构化网格<sup>[1](https://math.mit.edu/~stevenj/18.336/)</sup> |
| Lax等价定理 | 对于适定的线性初值型偏微分方程，相容的有限差分格式收敛当且仅当它稳定<sup>[2](https://math.mit.edu/research/highschool/rsi/documents/2017Lee.pdf)</sup> |
| 有限体积更新式 | \( Q_j^{n+1} = Q_j^n - \frac{\Delta t_n}{\Delta x_j} (F_{j+1/2}^n - F_{j-1/2}^n) \)，其中数值通量与真实通量相容<sup>[3](https://www.clawpack.org/riemann_book/html/Approximate_solvers.html)</sup> |
| Courant数 | \( \mathrm{Co} = \Delta_t \cdot \tau \)，其中 \( \tau = \frac{1}{2V} \sum_{faces} \lvert \phi_i \rvert \) 在单元各面上求和；它衡量每个时间步信息传播的距离，并限制显式格式<sup>[4](https://doc.openfoam.com/2312/tools/post-processing/function-objects/field/CourantNo/)</sup> |
| 有限元变分形式 | 对于Poisson方程：求 \( u \in V \)，使 \( a(u,v) = \int_{\Omega} \nabla u \cdot \nabla v \, dx \)，且 \( L(v) = \int_{\Omega} f v \, dx + \int_{\Gamma_N} g v \, ds \)<sup>[5](https://olddocs.fenicsproject.org/dolfin/1.3.0/python/demo/documented/poisson/python/documentation.html)</sup> |
| 谱配点 | 由 \( n \) 个节点（含两个端点）构成的Chebyshev–Lobatto网格；各阶导数取自 \( n-1 \) 次插值多项式的导数，借助FFT后端在每个方向上以 \( O(n \log n) \) 的代价施加<sup>[6](https://docs.sciml.ai/MethodOfLines/dev/api/discretization/)</sup> |
| 典型软件 | FEniCS（有限元）、OpenFOAM（有限体积）、Clawpack（双曲守恒律的有限体积）、MethodOfLines.jl和SciPy的solve_bvp（直线法与配点）<sup>[5](https://olddocs.fenicsproject.org/dolfin/1.3.0/python/demo/documented/poisson/python/documentation.html)</sup><sup> • </sup><sup>[7](https://www.clawpack.org/master/)</sup><sup> • </sup><sup>[8](https://docs.sciml.ai/MethodOfLines/stable/tutorials/brusselator/)</sup> |

## 为什么需要离散化

大多数偏微分方程和大多数常微分方程一样，没有闭式解，因此近似才是实际可行的路径。<sup>[9](https://ocw.mit.edu/courses/18-s096-topics-in-mathematics-with-applications-in-finance-fall-2013/a671d0d2abe626c371fd5850ad670397_MIT18_S096F13_lecnote21.pdf)</sup> 数值方法首先用有限个数来表示未知函数，例如网格点 \( x_i \) 处的值 \( f_i = f(x_i) \)，然后把连续的微分方程转化为一组确定这些数的有限代数方程。基本策略有两种：网格点方法（有限差分和有限体积）与级数展开方法（谱方法、有限元及相关方法）。<sup>[10](https://ocw.mit.edu/courses/12-950-atmospheric-and-oceanic-modeling-spring-2004/507424ba4dc53db72128cae0d5231e80_lec1.pdf)</sup>

偏微分方程的类型决定方法的选取。椭圆型方程如Poisson（Poisson）方程和Laplace（Laplace）方程会导出大型稀疏线性方程组；抛物型方程如热方程，以及双曲型方程如波方程和对流方程，则是随时间推进的初值问题。<sup>[1](https://math.mit.edu/~stevenj/18.336/)</sup><sup> • </sup><sup>[11](https://ocw.mit.edu/courses/18-336-numerical-methods-for-partial-differential-equations-spring-2009/pages/lecture-notes/)</sup> 描述波传播与输运的非线性双曲守恒律自成一类，其方法围绕Riemann（Riemann）问题构建。<sup>[12](https://www.clawpack.org/fvmhp_materials/)</sup>

## 相容性、稳定性与收敛性

**Lax等价定理**是联系这些概念的核心结果：对于适定的线性初值型偏微分方程，相容的有限差分格式收敛当且仅当它稳定。因此稳定性分析是证明收敛性的实用工具，而von Neumann（von Neumann）的Fourier（Fourier）分析和特征值分析则是稳定性分析的标准技术。<sup>[2](https://math.mit.edu/research/highschool/rsi/documents/2017Lee.pdf)</sup> 与常微分方程不同，偏微分方程的格式可以是条件收敛的：Courant–Friedrichs–Lewy（CFL）条件等准则给出了双曲型偏微分方程的显式有限差分格式何时收敛。<sup>[2](https://math.mit.edu/research/highschool/rsi/documents/2017Lee.pdf)</sup>

稳定性约束时间步长。对显式方法而言，时间步长过大会使数值解过冲并失控振荡，因此稳定性条件对允许的 \( \Delta t \) 施加了硬性上限。隐式方法则不受此限：隐式Euler是A稳定的，即对所有 \( \mathrm{Re}(z) < 0 \) 稳定，并且是L稳定的，即当 \( z \to \infty \) 时稳定，这使它能在刚性问题上采取相当大的步长，代价是每一步都要解一个非线性方程组。<sup>[13](https://docs.sciml.ai/ModelingToolkitCourse/dev/lectures/lecture4/)</sup>

实践中，程序会监测Courant数，它衡量通量场输运信息的速率。OpenFOAM对每个单元按 \( \mathrm{Co} = \Delta_t \cdot \tau \) 计算，其中 \( \tau = \frac{1}{2V} \sum_{faces} \lvert \phi_i \rvert \)，\( V \) 是单元体积，\( \phi \) 是面上的体积通量；瞬态模拟可以自动调整时间步长，使最大Courant数保持在设定值以下。<sup>[4](https://doc.openfoam.com/2312/tools/post-processing/function-objects/field/CourantNo/)</sup><sup> • </sup><sup>[14](https://www.openfoam.com/documentation/user-guide/6-solving/6.1-time-and-data-inputoutput-control)</sup>

## 有限差分与有限体积方法

有限差分方法用相邻网格值的差商来近似导数，如向前、向后和中心差分，在均匀网格上具有一阶或二阶精度。<sup>[1](https://math.mit.edu/~stevenj/18.336/)</sup> 对于一维椭圆问题，例如带Dirichlet（Dirichlet）边界条件的 \( -u'' = f \)，二阶导数被替换为差商 \( (-u(x_{j+1}) - 2u(x_j) + u(x_{j-1}))/h^2 \)，得到一个线性方程组 \( KU = F \)，其局部截断误差为 \( O(h^2) \)；实际误差为 \( e = K^{-1}\tau \)，因此 \( K \) 的条件性决定了截断误差被放大的程度。<sup>[15](https://math.mit.edu/icg/resources/teaching/18.330/18.330-Apr-2014.pdf)</sup>

有限体积方法则是在控制体上对偏微分方程积分，并演化单元的均值。对于守恒律 \( q_t + f(q)_x = 0 \)，更新式为

\[ Q_j^{n+1} = Q_j^n - \frac{\Delta t_n}{\Delta x_j} (F_{j+1/2}^n - F_{j-1/2}^n), \]

其中 \( F \) 是数值通量，通常由相邻单元值 \( Q_{j-1}^n \) 和 \( Q_j^n \) 构造，并要求当所有输入都等于 \( \bar q \) 时退化为 \( f(\bar q) \)。守恒形式的一个关键优势在于方法本身是守恒的：求和 \( \sum \Delta x_j Q_j^n \) 近似 \( \int q \, dx \)，而且只通过边界通量改变，这一性质与真解相同。<sup>[3](https://www.clawpack.org/riemann_book/html/Approximate_solvers.html)</sup>

对于非线性双曲系统，数值通量通常由Riemann求解器给出，后者把每个单元界面上的跳跃间断分解为向相邻单元传播的波。在每个时间步的每条单元边上精确求解Riemann问题代价过高，因此近似Riemann求解器被用作有限体积方法的构件，例如Godunov（Godunov）方法及其带限制器的高分辨率扩展。<sup>[3](https://www.clawpack.org/riemann_book/html/Approximate_solvers.html)</sup><sup> • </sup><sup>[7](https://www.clawpack.org/master/)</sup> Clawpack，即守恒律程序包（Conservation Laws Package），最初由华盛顿大学（University of Washington）应用数学教授兰德尔·J·勒维克（Randall J. LeVeque）于1994年围绕这一设计开发，包含自适应网格加密和并行求解器。<sup>[7](https://www.clawpack.org/master/)</sup>

## 有限元方法

有限元方法（FEM）从偏微分方程的变分形式，或称弱形式出发。对于区域 \( \Omega \) 上、带Dirichlet边界 \( \Gamma_D \) 和Neumann（Neumann）边界 \( \Gamma_N \) 的Poisson方程 \( -\nabla^2 u = f \)，标准变分形式是求 \( u \in V \)，使对所有检验函数 \( v \) 有 \( a(u,v) = L(v) \)，其中

\[ a(u,v) = \int_{\Omega} \nabla u \cdot \nabla v \, dx, \qquad L(v) = \int_{\Omega} f v \, dx + \int_{\Gamma_N} g v \, ds. \]

随后把未知函数限制在网格上分片多项式函数构成的有限维空间中，变分问题便化为代数方程组。<sup>[5](https://olddocs.fenicsproject.org/dolfin/1.3.0/python/demo/documented/poisson/python/documentation.html)</sup> 有限元方法非常适合复杂几何：通过在区域上生成网格，把区域描述为若干子区域的集合，将单元方程组装成整体系统，再用线性求解器求解；对于含时问题则用数值积分。<sup>[16](https://www.mathworks.com/help/pde/ug/basics-of-the-finite-element-method.html)</sup>

单元的选择很重要。把Poisson方程写成关于 \( \sigma \in H(\mathrm{div}) \) 和 \( u \in L^2 \) 的一对一阶方程的混合形式，对 \( \sigma \) 采用 \( k \) 阶Brezzi–Douglas–Marini元、对 \( u \) 采用 \( k-1 \) 阶间断元时是稳定的。<sup>[17](https://docs.fenicsproject.org/ufl/2024.1.0/manual/examples.html)</sup><sup> • </sup><sup>[18](https://olddocs.fenicsproject.org/dolfin/1.4.0/python/demo/documented/mixed-poisson/python/documentation.html)</sup> 自适应扩展了基本方法：目标导向的误差控制从计算解导出后验误差估计，利用对偶问题按目标泛函 \( \mathcal{M} \) 对局部残差加权，并在对所关心的量重要的地方加密网格。<sup>[19](https://olddocs.fenicsproject.org/dolfin/1.5.0/python/demo/documented/auto-adaptive-poisson/python/documentation.html)</sup>

## 谱方法与直线法

谱方法用全局支撑的基函数近似解，例如周期问题用三角多项式，其他问题用Chebyshev（Chebyshev）多项式，并在配点上施加偏微分方程。在含两个端点、共 \( n \) 个节点 \( x_k = a + (b-a)/2 \cdot (1 - \cos(\pi(k-1)/(n-1))) \) 的Chebyshev–Lobatto离散中，每个空间导数都是 \( n-1 \) 次插值多项式的导数，因此一个节点上的导数涉及该方向的所有节点，而不是固定模板。借助FFT后端，每个方向的导数以 \( O(n \log n) \) 的代价施加，而不是稠密矩阵 \( O(n^2) \) 的代价；等距的自定义节点则要避免，因为它们会出现Runge（Runge）现象。<sup>[6](https://docs.sciml.ai/MethodOfLines/dev/api/discretization/)</sup><sup> • </sup><sup>[20](https://docs.sciml.ai/MethodOfLines/dev/pseudospectral/)</sup>

直线法是一种混合策略：只离散空间而让时间保持连续，从而把偏微分方程转化为大型常微分方程组或微分代数方程组，由标准的ODE/DAE求解器处理。MethodOfLines.jl从`PDESystem`出发以符号方式完成这一转换，识别边界条件并将每个方程与其因变量匹配，返回`DAEProblem`或`ODEProblem`供`Tsit5()`或隐式`TRBDF2()`等求解器使用。<sup>[8](https://docs.sciml.ai/MethodOfLines/stable/tutorials/brusselator/)</sup><sup> • </sup><sup>[21](https://docs.sciml.ai/MethodOfLines/stable/howitworks/)</sup> 对于边值问题，配点法也可直接用于空间：SciPy的`solve_bvp`实现带残差控制的四阶配点算法，用阻尼Newton法求解配点系统，并自适应调整网格，直到相对残差满足要求的容差。<sup>[22](https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_bvp.html)</sup>

## 求解所得系统与选择方法

离散化留下的是一个大型稀疏线性或非线性系统，而本领域相当一部分工作就在于如何高效求解它。标准工具包括多重网格方法、Krylov子空间方法（如预处理共轭梯度），以及FFT等快速变换；算子分裂和分步方法处理含多个物理过程的问题。<sup>[1](https://math.mit.edu/~stevenj/18.336/)</sup><sup> • </sup><sup>[11](https://ocw.mit.edu/courses/18-336-numerical-methods-for-partial-differential-equations-spring-2009/pages/lecture-notes/)</sup>

各方法族系之间的选择取决于问题。谱方法在规则区域上精确高效，广泛用于气象学，但在不规则区域上难以使用，在海洋学中极少采用；海洋学中占主导的是有限差分方法，以及日益增多的有限体积方法。<sup>[10](https://ocw.mit.edu/courses/12-950-atmospheric-and-oceanic-modeling-spring-2004/507424ba4dc53db72128cae0d5231e80_lec1.pdf)</sup> FEniCS等有限元程序使程序贴近数学变分形式，并能处理非结构几何；OpenFOAM等有限体积框架面向非结构网格，为流体力学提供守恒输运，配合同位变量布置可达二阶精度。<sup>[23](https://doc.openfoam.com/2606/tools/processing/numerics/schemes/)</sup><sup> • </sup><sup>[24](https://pub.fenicsproject.org/tutorial/pdf/fenics-tutorial-vol1.pdf)</sup> 网格质量本身就影响精度：在足够光滑的映射网格上，中心差分近似在非均匀和非正交网格上仍保持二次收敛，但常数因子会有所损失。<sup>[1](https://math.mit.edu/~stevenj/18.336/)</sup>

## References

1. [18.336 Spring 2006, Numerical Methods for Partial Differential Equations, Steven G. Johnson, MIT](https://math.mit.edu/~stevenj/18.336/)
2. [Stability of Finite Difference Schemes on the Diffusion Equation (MIT RSI 2017)](https://math.mit.edu/research/highschool/rsi/documents/2017Lee.pdf)
3. [Approximate Solvers, Clawpack Riemann Book](https://www.clawpack.org/riemann_book/html/Approximate_solvers.html)
4. [OpenFOAM CourantNo function object documentation](https://doc.openfoam.com/2312/tools/post-processing/function-objects/field/CourantNo/)
5. [Poisson equation demo, DOLFIN/FEniCS documentation](https://olddocs.fenicsproject.org/dolfin/1.3.0/python/demo/documented/poisson/python/documentation.html)
6. [Discretization API, MethodOfLines.jl documentation](https://docs.sciml.ai/MethodOfLines/dev/api/discretization/)
7. [Clawpack documentation](https://www.clawpack.org/master/)
8. [Getting Started with the Brusselator PDE, MethodOfLines.jl](https://docs.sciml.ai/MethodOfLines/stable/tutorials/brusselator/)
9. [Stochastic Differential Equations, MIT 18.S096 lecture notes](https://ocw.mit.edu/courses/18-s096-topics-in-mathematics-with-applications-in-finance-fall-2013/a671d0d2abe626c371fd5850ad670397_MIT18_S096F13_lecnote21.pdf)
10. [Atmospheric and Oceanic Modeling, MIT 12.950 Lecture 1](https://ocw.mit.edu/courses/12-950-atmospheric-and-oceanic-modeling-spring-2004/507424ba4dc53db72128cae0d5231e80_lec1.pdf)
11. [Lecture Notes, 18.336 Numerical Methods for PDEs, MIT OpenCourseWare](https://ocw.mit.edu/courses/18-336-numerical-methods-for-partial-differential-equations-spring-2009/pages/lecture-notes/)
12. [Finite Volume Methods for Hyperbolic Problems, R. J. LeVeque (book page)](https://www.clawpack.org/fvmhp_materials/)
13. [Numerical Methods for Stiff ODEs and DAEs, ModelingToolkit Course](https://docs.sciml.ai/ModelingToolkitCourse/dev/lectures/lecture4/)
14. [OpenFOAM User Guide, time and data input/output control](https://www.openfoam.com/documentation/user-guide/6-solving/6.1-time-and-data-inputoutput-control)
15. [18.330 Introduction to Numerical Methods, MIT course notes](https://math.mit.edu/icg/resources/teaching/18.330/18.330-Apr-2014.pdf)
16. [Finite Element Method Basics, MATLAB PDE Toolbox documentation](https://www.mathworks.com/help/pde/ug/basics-of-the-finite-element-method.html)
17. [Example forms, Unified Form Language (UFL) documentation](https://docs.fenicsproject.org/ufl/2024.1.0/manual/examples.html)
18. [Mixed formulation for Poisson equation, FEniCS demo](https://olddocs.fenicsproject.org/dolfin/1.4.0/python/demo/documented/mixed-poisson/python/documentation.html)
19. [Auto adaptive Poisson equation, FEniCS demo](https://olddocs.fenicsproject.org/dolfin/1.5.0/python/demo/documented/auto-adaptive-poisson/python/documentation.html)
20. [PseudospectralDiscretization, MethodOfLines.jl documentation](https://docs.sciml.ai/MethodOfLines/dev/pseudospectral/)
21. [How it Works, MethodOfLines.jl documentation](https://docs.sciml.ai/MethodOfLines/stable/howitworks/)
22. [scipy.integrate.solve_bvp, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_bvp.html)
23. [Numerical Schemes, OpenFOAM documentation](https://doc.openfoam.com/2606/tools/processing/numerics/schemes/)
24. [The FEniCS Tutorial Volume I](https://pub.fenicsproject.org/tutorial/pdf/fenics-tutorial-vol1.pdf)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 物理学 › 物理学方法、实践与学术共同体 › Applied and interdisciplinary physics › Computational and simulation physics › Numerical methods in physics › Field and continuum simulation methods › Field and continuum simulation overview

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/numerical-methods-for-partial-differential-equations

English original: https://www.edgepedia.org/numerical-methods-for-partial-differential-equations
