English
Scientific computing uses numerical algorithms to investigate mathematical models arising in science and engineering. A useful account separates the physical question, the model, the discretization, the algorithm, and the computed result. Each step can introduce error or an assumption. A heat simulation can solve its equations accurately while using the wrong boundary temperature.
Numerical analysis studies how approximations and finite arithmetic affect a calculation. Domain science supplies the quantities, mechanisms, and observations against which the model is assessed. Software and high-performance computing (§4.11) make the calculation executable at the required scale. Plausible output alone is insufficient evidence of correctness, in scientific software as in other applications.
Two questions organize the work: are we solving the chosen equations correctly, and are those equations adequate for the intended use? The first concerns verification; the second concerns validation. Neither a finer mesh nor a faster computer automatically answers both. Machine learning can approximate components of this process, while adding training-data and generalization questions.
Prerequisites: Linear algebra (§2.3), calculus (§2.4), and probability (§2.5). Simple root finding, integration, and differential equations provide an entry; advanced eigenvalue algorithms are not required before beginning.
From Ballistic Tables to AlphaFold
Large calculations preceded electronic computers. Human computers, tables, and mechanical calculators required organized task division and independent checks. The American Mathematical Tables Project began in New York in 1938 under the WPA, as documented by NIST; it was neither a British project nor the beginning of all large-scale numerical work.
ENIAC was designed for ballistic calculations and also became a platform for other scientific problems. Haigh and Ceruzzi describe its use for Monte Carlo calculations and numerical weather work. Sampling and discretization made problems computable by replacing an enormous physical or mathematical process with specified operations. The choice of model and approximation remained part of the scientific work.
Early analyses by von Neumann, Goldstine, Wilkinson, and others made finite-arithmetic behavior an explicit subject. Sensitivity of a problem and error introduced by an algorithm had to be distinguished. A formula that is correct in exact arithmetic can be a poor numerical procedure, while an ill-conditioned problem may remain sensitive even with a carefully designed algorithm.
Numerical linear algebra developed reusable factorizations, eigenvalue methods, and software libraries. Householder transformations, QR algorithms, and later LINPACK and EISPACK made reliable computation available beyond individual research programs. Moler’s original MATLAB provided interactive access to such routines before its commercial development in 1984. Open-source array and scientific libraries extended this style of work to further languages and communities.
Finite difference, finite element, finite volume, and spectral methods offered different ways to approximate continuous models. Their usefulness depended on geometry, conservation, regularity, and the required error control. Better algorithms and preconditioners could reduce computational cost as substantially as faster hardware. The history therefore concerns how problems were reformulated, not only how machines accelerated unchanged calculations.
Weather, climate, molecular dynamics, and structural simulation also exposed different kinds of uncertainty. Input measurements may be uncertain, unresolved scales require modeling, and nonlinear dynamics can limit prediction horizons. Comparing a simulation with observations requires attention to what was measured, what was calibrated, and which predictions were genuinely held out.
AlphaFold2’s results around CASP14 in 2020 and its 2021 publication showed the value of learned protein-structure prediction. Predicted structures are not trajectories of molecular motion or direct measurements of every biological function. Physics-informed networks and learned surrogate models pursue other combinations of data and equations. Penalizing an equation residual during training encourages agreement at evaluated points; it does not enforce every physical law exactly or guarantee accuracy away from those points.
Numerical Analysis, Differential Equations, and Scientific Machine Learning
Floating-Point Arithmetic and Algorithmic Stability
Scientific programs may combine integers, exact or symbolic calculations, and floating-point arithmetic. For normal binary64 values, 52 stored fraction bits plus an implicit leading bit provide 53 bits of significand precision. Round-to-nearest arithmetic usually introduces small local errors, but underflow, overflow, cancellation, and accumulated operations need separate attention. More precision reduces rounding error; it does not fix a wrong model or discretization.
Algebraically equivalent formulas can behave differently. For small positive x, evaluating sqrt(1+x)−1 subtracts nearly equal values. At x=10⁻¹⁶, ordinary binary64 evaluation can return zero because 1+x rounds to 1. The equivalent form x/(sqrt(1+x)+1) gives approximately 5×10⁻¹⁷. The reformulation avoids losing the information before the final subtraction.
Conditioning describes sensitivity of the mathematical problem. For a nonsingular matrix, κ₂(A)=σ_max/σ_min bounds relative solution sensitivity in the corresponding norm. Let A=diag(1,10⁻⁸) and b=(1,10⁻⁸). The solution is (1,1). The approximate solution (1,0) has a small relative residual, about 10⁻⁸, but a substantial relative solution error, about 0.71. A small residual alone does not establish accuracy for an ill-conditioned system.
Backward error asks how much the input would need to change to make the computed answer exact. A backward-stable algorithm keeps this perturbation appropriately small; forward accuracy then also depends on conditioning. Householder QR gives a useful stable route to least squares, while forming normal equations squares the 2-norm condition number of a full-column-rank matrix. Pivot growth and loss of orthogonality require attention in other methods; a named factorization alone does not specify its floating-point behavior.
Report norms, units, scaling, tolerances, and any condition estimate with the result. Test against known solutions or higher-precision references when feasible. Distinguish mathematical sensitivity, algorithmic rounding behavior, and implementation errors before deciding whether to change the method or the precision.
Numerical Methods for Differential Equations
A discretization replaces continuous variables or derivatives with finitely many unknowns and operations. Its error depends on the equation, solution regularity, boundary treatment, and step sizes. Halving a step does not guarantee improvement if stability, roundoff, or another error source dominates.
For the test equation y′=−10y, explicit Euler gives yₙ₊₁=(1−10h)yₙ. The exact solution decays, but at h=0.3 the numerical multiplier is −2 and the approximation grows in magnitude. At h=0.1 the multiplier is zero: the method is stable for this step yet gives a poor one-step approximation to e⁻¹. Stability and accuracy are different requirements.
Backward Euler gives yₙ₊₁=yₙ/(1+10h) for this example. Its A-stability helps with decaying stiff modes, but a large step can still erase dynamics that matter. Implicit methods also require solving equations at each step. Adaptive Runge–Kutta, BDF, and other methods estimate error and choose steps under their assumptions; stiffness concerns restrictions on numerical steps relative to the behavior of interest, not simply a large derivative.
For the one-dimensional heat equation u_t=αu_xx with α>0, centered spatial differences and forward Euler give uᵢⁿ⁺¹=uᵢⁿ+r(uᵢ₋₁ⁿ−2uᵢⁿ+uᵢ₊₁ⁿ), where r=αΔt/Δx². On a uniform grid with standard boundary treatment, the usual stability requirement is r≤1/2. Halving the spacing therefore requires roughly a quarter of the time step for this explicit scheme. More spatial resolution can increase both unknown count and the number of time steps.
Finite elements approximate a weak formulation in a chosen function space; finite volumes account for fluxes across cell boundaries; spectral methods use global basis functions. Exponential spectral convergence needs stronger regularity than mere smooth-looking plots, and discontinuities alter convergence. Linear systems may use direct solvers, conjugate gradients under positive-definite symmetry, or methods such as GMRES. Preconditioning and multigrid exploit structure; their cost and convergence depend on the problem and implementation.
Check mesh and time-step convergence separately, along with residuals, boundary conditions, and conservation where applicable. A manufactured solution can provide a known reference by choosing a solution and deriving its forcing. Validation then compares predictions with independent observations for the intended use; convergence to a numerical answer alone does not validate the physical model.
Monte Carlo and Uncertainty Quantification
Monte Carlo estimates an expectation by averaging sampled outcomes. For independent samples with finite variance, the mean has variance σ²/N and standard error σ/√N. The exponent does not grow with dimension, but the variance and cost of one sample can. High dimension therefore does not become free, and deterministic quadrature may be better for suitable low-dimensional smooth problems.
Importance sampling changes the sampling distribution and compensates with weights. The proposal must cover the contributing region, and poorly chosen weights can greatly increase variance. Control variates use a correlated quantity with known expectation. Quasi-Monte Carlo uses structured low-discrepancy points, with guarantees depending on function regularity and the construction; it is not simply another collection of independent random samples.
MCMC produces dependent samples from a target distribution under appropriate conditions. Metropolis–Hastings uses both target-density and proposal terms in its acceptance ratio; only special proposals allow those terms to cancel. Burn-in, multiple chains, effective sample size, and convergence diagnostics help investigate behavior. Passing diagnostics does not prove that all separated modes were explored.
Uncertainty quantification propagates specified input uncertainty and can infer parameters from observations. Distinguish measurement uncertainty, numerical error, uncertain parameters, and model discrepancy. A narrow posterior under a wrong model can still support poor predictions. Calibrating parameters and checking predictions on independent data serve different purposes.
For a learned surrogate or physics-informed model, measure errors on relevant held-out conditions and against a suitable numerical baseline. Include training cost, inference cost, coverage, and failure outside the training range. A small training residual or a fast prediction is one measurement, not a certificate that the scientific conclusion is reliable.
What Studying This Changes
You should be able to identify which error a proposed change can reduce. Increasing arithmetic precision, refining a mesh, improving measurements, and changing a physical model address different parts of the calculation.
Implement the decaying ODE with explicit and backward Euler, compare with the exact solution, and vary the step size. Then solve a small linear system with a known solution and compare residual with actual error. These experiments make stability and conditioning observable before introducing large simulations.
Preserve equations, units, input data, boundary conditions, code versions, solver settings, and error evidence with a result. Reproducing the same output is useful, but a reproducible mistake remains a mistake. Reliable scientific computing connects reproducibility with numerical checks and independent evidence about the model.
Resources
Books and Texts
Heath’s Scientific Computing: An Introductory Survey provides a broad route through numerical problems; its SIAM edition is the revised second edition. Numerical Linear Algebra and Higham’s Accuracy and Stability of Numerical Algorithms deepen the distinction between conditioning and computation. Use the ODE, PDE, optimization, and Monte Carlo references for the problem you are solving. Read the assumptions with the algorithm, not after a failure.
| Book | Role | Type |
|---|---|---|
| Trefethen & Bau, Numerical Linear Algebra | Numerical LA canonical text | Depth |
| Higham, Accuracy and Stability of Numerical Algorithms (2nd ed.) | Error analysis reference | Reference |
| Heath, Scientific Computing: An Introductory Survey (revised 2nd ed.) | Broad numerical-methods introduction | Entry |
| Hairer and coauthors, Solving Ordinary Differential Equations (2 vols.) | Nonstiff and stiff ODE methods | Reference |
| LeVeque, Finite Difference Methods for ODEs and PDEs | PDE finite difference | Depth |
| Strang & Fix, An Analysis of the Finite Element Method (2nd ed.) | FEM mathematical foundation | Depth |
| Nocedal & Wright, Numerical Optimization (2nd ed.) | Optimization canonical reference | Reference |
| Boyd & Vandenberghe, Convex Optimization (free) | Convex optimization | Depth |
| Robert & Casella, Monte Carlo Statistical Methods (2nd ed.) | Monte Carlo foundation | Depth |
| Brunton & Kutz, Data-Driven Science and Engineering | Scientific machine learning | Depth |
| Golub & Van Loan, Matrix Computations (4th ed.) | Matrix computation reference | Reference |
Courses and Lectures
MIT 18.335 combines numerical methods with analysis, and 18.085/18.086 connects mathematics to engineering models. Scientific Python Lectures and Software Carpentry support implementation and reproducible workflows. Pair a numerical method with an exact solution or a manufactured reference problem, then measure error as resolution or tolerance changes.
| Course | Platform | Type |
|---|---|---|
| MIT 18.335 Introduction to Numerical Methods (free) | MIT / GitHub | Entry |
| MIT 18.085/18.086 Mathematical Methods for Engineers (free) | MIT OCW | Entry |
| Software Carpentry (free lessons) | software-carpentry.org | Entry |
| Scientific Python Lectures (free) | lectures.scientific-python.org | Entry |
Practice, Tools, and Current Sources
Use NumPy/SciPy or Julia/SciML to compare solver choices on the same specified problem. Inspect stopping criteria and returned diagnostic information. FEniCSx offers a route from weak formulations to finite-element computation. For a PINN or surrogate, retain a conventional solver baseline and count training as well as inference cost. Fast execution or a small training loss does not replace convergence and validation checks.
| Resource | Platform | Type |
|---|---|---|
| NumPy / SciPy documentation (free) | numpy.org / scipy.org | Practice |
| Julia + DifferentialEquations.jl (free) | julialang.org | Practice |
| SciML documentation (free) | docs.sciml.ai | Reference |
| FEniCS (free) | fenicsproject.org | Practice |
| FEniCSx tutorial (free) | jsdokken.com/dolfinx-tutorial | Practice |
| Raissi, Perdikaris & Karniadakis PINN papers (free) | arXiv | Depth |
| MIT Julia computing course (18.S191, free) | computationalthinking.mit.edu | Entry |
| Software Carpentry Python tutorials (free) | software-carpentry.org | Entry |
Traps
| Trap | Why it misleads | Better response |
|---|---|---|
| Trusting plausible numerical output | Wrong units, boundary conditions, or discretizations can still produce smooth results. | Check known solutions, units, and independent observations. |
| Equating conditioning with algorithmic stability | One concerns problem sensitivity; the other concerns the computation. | Inspect both backward error and sensitivity before interpreting forward error. |
| Assuming a smaller step always fixes the answer | Stability, roundoff, boundary treatment, and model error have different effects. | Vary one resolution at a time and compare against expected convergence. |
| Treating a small residual as a universal accuracy guarantee | Ill-conditioning and incomplete residual checks can hide substantial error. | Relate the residual to the problem and compare with a known or trusted reference. |
| Calling a learned physics penalty exact enforcement | Training checks selected points and can leave boundary or generalization errors. | Test independent conditions and compare against established numerical methods. |
| Reporting uncertainty from only one source | A sampling interval can omit model discrepancy or uncertain inputs. | State which uncertainties were included and assess the omitted ones separately. |
中文
科学计算使用数值算法研究科学与工程中的数学模型。应区分物理问题、模型、离散化、算法和计算结果;每一步都可能引入误差或假设。热传导模拟可以准确求解方程,同时使用错误的边界温度。
数值分析研究近似与有限精度运算如何影响计算。领域科学提供物理量、机制,以及用来评价模型的观测。软件与高性能计算(§4.11)使计算能在所需规模上执行。与其他应用一样,看起来合理的输出并不足以证明科学软件正确。
可以用两个问题组织工作:是否正确求解了选定方程,方程是否适合预期用途?前者关心求解验证,后者关心模型有效性验证。更细的网格或更快的计算机,都不会自动同时回答这两个问题。机器学习可以近似其中部分过程,但也增加训练数据与泛化问题。
前置知识:线性代数(§2.3)、微积分(§2.4)和概率(§2.5)。可以从简单求根、积分和微分方程入门,不必先掌握高级特征值算法。
从弹道表到 AlphaFold
大规模计算早于电子计算机。人工计算、数表与机械计算器需要有组织的任务分工和独立检查。NIST 记载,美国 Mathematical Tables Project 于 1938 年在纽约、WPA 项目下开始;它不是英国项目,也不是所有大规模数值工作的起点。
ENIAC 为弹道计算设计,也成为处理其他科学问题的平台。Haigh 与 Ceruzzi 描述了它在蒙特卡洛计算和数值天气研究中的用途。采样与离散化通过明确的操作,替代规模巨大的物理或数学过程,使问题可以计算。模型和近似的选择仍属于科学工作。
von Neumann、Goldstine、Wilkinson 等人的早期分析,将有限精度运算的行为变成明确的研究对象。问题本身的敏感性与算法引入的误差,需要分开。精确算术中正确的公式,可能是很差的数值过程;设计精良的算法,也未必能消除病态问题本身的敏感性。
数值线性代数发展出可复用的分解、特征值方法与软件库。Householder 变换、QR 算法,以及后来的 LINPACK、EISPACK,让可靠计算不再局限于个别研究程序。Moler 的最初 MATLAB 在 1984 年商业化发展之前,就提供了对这类例程的交互访问。开源数组与科学计算库,又把这种工作方式扩展到更多语言和社区。
有限差分、有限元、有限体积与谱方法,提供了近似连续模型的不同途径。适用性取决于几何、守恒、正则性和所需误差控制。更好的算法与预条件器,可能像更快的硬件一样显著降低计算成本。因此这段历史也关心问题怎样被重新表达,而不只是机器怎样加速不变的计算。
天气、气候、分子动力学和结构模拟,也暴露了不同的不确定性。输入测量可能不确定,未解析尺度需要建模,非线性动力学可能限制预测时长。将模拟与观测比较,需要注意测量了什么、哪些内容用于校准,以及哪些预测真正保留用于检验。
AlphaFold2 在 2020 年 CASP14 前后的结果及其 2021 年论文,展示了学习式蛋白质结构预测的价值。预测结构不等于分子运动轨迹,也不直接测量所有生物功能。物理信息神经网络和学习式替代模型,则研究数据与方程的其他组合。训练时惩罚方程残差,鼓励模型在检查点满足方程,但不会精确强制所有物理规律,也不保证其他位置准确。
数值分析、微分方程与科学机器学习
浮点运算与算法稳定性
科学程序可能结合整数、精确或符号计算,以及浮点运算。对于正常范围内的 binary64 值,52 个存储的小数位加上隐含的首位,提供 53 位有效数精度。舍入到最近值的运算通常引入较小的局部误差,但下溢、上溢、消去及大量操作的累积影响需要分别分析。更高精度减少舍入误差,不能修复错误模型或离散化。
代数等价的公式可能表现不同。对于很小的正数 x,计算 sqrt(1+x)−1 会相减两个接近的值。当 x=10⁻¹⁶ 时,普通 binary64 计算可能返回零,因为 1+x 被舍入为 1。等价形式 x/(sqrt(1+x)+1) 则约为 5×10⁻¹⁷。改写避免了在最后相减之前丢失信息。
条件性描述数学问题的敏感程度。对于非奇异矩阵,κ₂(A)=σ_max/σ_min 在对应范数下约束解的相对敏感性。设 A=diag(1,10⁻⁸)、b=(1,10⁻⁸),解为 (1,1)。近似解 (1,0) 的相对残差很小,约为 10⁻⁸,但相对解误差相当大,约为 0.71。对于病态系统,仅有小残差不能证明准确。
后向误差考察输入需要改变多少,才能使计算答案成为精确解。后向稳定算法使这种扰动保持足够小,前向准确性还取决于问题条件性。Householder QR 为最小二乘提供了有用的稳定求解途径,而构造正规方程会使满列秩矩阵的 2-范数条件数平方。其他方法还需注意主元增长或正交性丧失;仅说出分解名称,并没有说明其浮点行为。
报告结果时,应给出范数、单位、缩放、容差及可用的条件数估计。可行时与已知解或高精度参考结果比较。先区分数学敏感性、算法舍入行为和实现错误,再决定更换方法还是提高精度。
微分方程的数值方法
离散化用有限个未知量和操作替代连续变量或导数。误差取决于方程、解的正则性、边界处理和步长。如果稳定性、舍入或另一种误差已经主导,把步长减半也不保证改善。
对于测试方程 y′=−10y,显式 Euler 给出 yₙ₊₁=(1−10h)yₙ。精确解衰减,但当 h=0.3 时,数值乘数为 −2,近似解的幅度反而增长。当 h=0.1 时乘数为零:方法在这个步长下稳定,但相对于 e⁻¹ 的一步精确衰减,近似仍然很差。稳定性与准确性是不同要求。
对于这个例子,后向 Euler 给出 yₙ₊₁=yₙ/(1+10h)。其 A-稳定性有助于处理衰减的刚性模态,但大步长仍可能抹去关心的动态。隐式方法还需要在每一步求解方程。自适应 Runge–Kutta、BDF 等方法在各自假设下估计误差并选择步长;刚性关心相对于目标行为的数值步长限制,不只是导数很大。
对于 α>0 的一维热方程 u_t=αu_xx,空间中心差分加前向 Euler 得到 uᵢⁿ⁺¹=uᵢⁿ+r(uᵢ₋₁ⁿ−2uᵢⁿ+uᵢ₊₁ⁿ),其中 r=αΔt/Δx²。在均匀网格及标准边界处理下,通常的稳定性要求为 r≤1/2。因此,对于这个显式格式,网格间距减半,时间步长也大约需要降到四分之一。空间分辨率提高,可能同时增加未知量数量与时间步数。
有限元在选定函数空间中近似弱形式,有限体积核算穿过单元边界的通量,谱方法使用全局基函数。谱方法的指数收敛需要比“图像看起来平滑”更强的正则性,间断也会改变收敛。线性系统可以使用直接求解器、满足对称正定条件的共轭梯度,或 GMRES 等方法。预条件和多重网格利用结构,其成本与收敛仍取决于问题及实现。
分别检查网格与时间步长收敛,同时核对残差、边界条件和适用的守恒量。制造解方法先选定一个解,再推导所需源项,从而提供已知参考。随后,模型有效性验证将预测与预期用途下的独立观测比较;收敛到一个数值答案,本身不证明物理模型有效。
蒙特卡洛与不确定性量化
蒙特卡洛通过平均采样结果估计期望。对于方差有限的独立样本,均值方差为 σ²/N,标准误为 σ/√N。收敛指数不会随维度增加,但方差及单次采样成本可能增加。因此高维并不是没有代价,对于合适的低维光滑问题,确定性求积可能更好。
重要性采样改变采样分布,再用权重补偿。提议分布必须覆盖有贡献的区域,选择不当的权重可能大幅增加方差。控制变量使用期望已知的相关量。准蒙特卡洛使用结构化的低差异点,其保证取决于函数正则性和具体构造,不能直接当作另一组独立随机样本。
MCMC 在适当条件下产生目标分布的相关样本。Metropolis–Hastings 的接受比同时包含目标密度和提议项,只有特殊提议才使后者抵消。预热、多条链、有效样本量和收敛诊断,有助于调查运行行为。通过诊断并不证明所有相互分离的模态都已探索。
不确定性量化传播指定的输入不确定性,也可以根据观测推断参数。应区分测量不确定性、数值误差、参数不确定性和模型偏差。错误模型下很窄的后验分布,仍可能给出不良预测。参数校准与使用独立数据检查预测,有不同作用。
对于学习式替代模型或物理信息模型,应在相关的保留条件下测量误差,并与合适的数值基线比较。计入训练成本、推断成本、覆盖范围和训练范围之外的失败。训练残差小或预测快,只是一项测量,不是科学结论可靠的证明。
学习这一部分会改变什么
学完后,应能判断一项改动能减少哪种误差。提高运算精度、细化网格、改进测量和更换物理模型,作用于计算的不同部分。
用显式与后向 Euler 实现衰减微分方程,与精确解比较并改变步长。再求解一个有已知解的小线性系统,比较残差与真实误差。这些实验使稳定性和条件性在大型模拟之前就成为可观察的现象。
保存结果时,也保存方程、单位、输入数据、边界条件、代码版本、求解设置和误差证据。复现相同输出有用,但可复现的错误仍是错误。可靠的科学计算需要把可复现性、数值检查及模型的独立证据结合起来。
资源
书籍与文本
Heath 的 Scientific Computing: An Introductory Survey 提供广泛的数值问题入门,其 SIAM 版本是修订第二版。Numerical Linear Algebra 与 Higham 的 Accuracy and Stability of Numerical Algorithms 深入区分条件性与计算过程。根据当前问题查阅 ODE、PDE、优化和蒙特卡洛参考书。学习算法时就阅读假设,而不是失败后再补查。
| 书籍 | 作用 | 类型 |
|---|---|---|
| Trefethen & Bau, Numerical Linear Algebra | 数值线性代数经典文本 | 深入 |
| Higham, Accuracy and Stability of Numerical Algorithms(第 2 版) | 误差分析参考 | 参考 |
| Heath, Scientific Computing: An Introductory Survey(修订第 2 版) | 数值方法综合入门 | 入门 |
| Hairer 等,Solving Ordinary Differential Equations(两卷) | 非刚性与刚性 ODE 方法 | 参考 |
| LeVeque, Finite Difference Methods for ODEs and PDEs | PDE 有限差分 | 深入 |
| Strang & Fix, An Analysis of the Finite Element Method(第 2 版) | FEM 数学基础 | 深入 |
| Nocedal & Wright, Numerical Optimization(第 2 版) | 优化经典参考 | 参考 |
| Boyd & Vandenberghe, Convex Optimization(免费) | 凸优化 | 深入 |
| Robert & Casella, Monte Carlo Statistical Methods(第 2 版) | 蒙特卡洛基础 | 深入 |
| Brunton & Kutz, Data-Driven Science and Engineering | 科学机器学习 | 深入 |
| Golub & Van Loan, Matrix Computations(第 4 版) | 矩阵计算参考 | 参考 |
课程与讲座
MIT 18.335 将数值方法与分析结合,18.085/18.086 将数学与工程模型联系起来。Scientific Python Lectures 和 Software Carpentry 支持实现及可复现工作流程。学习一种数值方法时,配合精确解或制造的参考问题,再测量分辨率、容差变化时的误差。
| 课程 | 平台 | 类型 |
|---|---|---|
| MIT 18.335 Introduction to Numerical Methods(免费) | MIT / GitHub | 入门 |
| MIT 18.085/18.086 Mathematical Methods for Engineers(免费) | MIT OCW | 入门 |
| Software Carpentry(免费材料) | software-carpentry.org | 入门 |
| Scientific Python Lectures(免费) | lectures.scientific-python.org | 入门 |
实践、工具与当前资料
用 NumPy/SciPy 或 Julia/SciML,在同一个明确问题上比较求解器,检查停止条件与返回的诊断信息。FEniCSx 提供从弱形式到有限元计算的路线。研究 PINN 或替代模型时,保留传统求解器基线,并同时计算训练与推断成本。执行快或训练损失小,不能代替收敛与有效性检查。
| 资源 | 平台 | 类型 |
|---|---|---|
| NumPy / SciPy documentation(免费) | numpy.org / scipy.org | 实践 |
| Julia + DifferentialEquations.jl(免费) | julialang.org | 实践 |
| SciML documentation(免费) | docs.sciml.ai | 参考 |
| FEniCS(免费) | fenicsproject.org | 实践 |
| FEniCSx tutorial(免费) | jsdokken.com/dolfinx-tutorial | 实践 |
| Raissi, Perdikaris & Karniadakis PINN papers(免费) | arXiv | 深入 |
| MIT Julia computing course(18.S191,免费) | computationalthinking.mit.edu | 入门 |
| Software Carpentry Python tutorials(免费) | software-carpentry.org | 入门 |
陷阱
| 误区 | 为什么会误导 | 更好的做法 |
|---|---|---|
| 相信看似合理的数值输出 | 错误单位、边界条件或离散化仍可能产生平滑结果。 | 检查已知解、单位与独立观测。 |
| 混淆条件性与算法稳定性 | 前者关心问题敏感性,后者关心计算过程。 | 解释前向误差前,同时检查后向误差与敏感性。 |
| 认为更小步长总能修复答案 | 稳定性、舍入、边界处理与模型误差的影响不同。 | 一次改变一种分辨率,与预期收敛比较。 |
| 把小残差当作通用准确性保证 | 病态性和不完整残差检查可能隐藏较大误差。 | 结合问题解释残差,并与已知或可信参考比较。 |
| 把学习中的物理惩罚项叫作精确强制 | 训练检查选定点,可能仍有边界或泛化误差。 | 测试独立条件,与已有数值方法比较。 |
| 只报告一个来源的不确定性 | 采样区间可能遗漏模型偏差或输入不确定性。 | 说明包含哪些不确定性,并分别评估遗漏项。 |