Module 29
Scientific Simulation and Mathematical Modeling
How can we represent real phenomena with mathematical models, simulate their evolution, and compare predictions with observations?
- lessons
- 27
- duration
- 48 h 10 min
- concepts
- 169
- available in English
- 27 / 27
- completed by you
0 of 27
Where it fits
Overview
Follow the full computational science cycle: formulate deterministic or stochastic models; discretize them with finite differences, finite volumes, finite elements or spectral methods; verify code; propagate parameter uncertainty with advanced Monte Carlo, quasi-Monte Carlo, multilevel Monte Carlo and polynomial chaos; and close the loop with observations using inverse problems, Bayesian inference in function spaces and data assimilation. Finish with reduced-order models and the frontier of scientific machine learning: PINNs, neural operators, differentiable simulation and equation discovery. Everything is implemented from scratch before using SciPy, scikit-fem or PyTorch.
Why it matters
This is the bridge between mathematics and the physical world: the same tools price derivatives using PDEs and Monte Carlo (m28), train agents in simulators (m22, m24), and underpin learned weather and climate models that now compete with classical numerical prediction. For a researcher, knowing when a simulator is reliable, what reducing its error costs and how to calibrate it against data separates a convincing prediction from a beautiful curve. PINNs and neural operators also form an active frontier where deep-learning specialists with strong numerical foundations can contribute.
Lessons 27
- 01Mathematical modeling: from phenomenon to equationBefore discretizing, decide which equation to simulate. Explore the modeling cycle, conservation and constitutive laws, nondimensionalization, deterministic and stochastic models, and a hierarchy of model fidelity.
- 02Operational review: simulating ODEs with judgmentA practical review of m09 integrators for real models: choose methods and tolerances with work–precision diagrams, detect events with dense output and handle differential-algebraic equations with constraints.
- 03Nonlinear dynamical systems: chaos and predictabilityQuantify the loss of trajectory predictability in chaotic systems with Lyapunov exponents, and examine strange attractors, Poincaré sections, shadowing and ensemble prediction.
- 04Nonlinear systems: numerical continuation and boundary value problemsFollow nonlinear equilibrium branches with pseudo-arclength continuation, detect bifurcations, and solve boundary-value and periodic-orbit problems.
- 05Exact and approximate stochastic simulation: Gillespie, tau-leaping and agentsModel intrinsic fluctuations in small populations with the chemical master equation, Gillespie simulation, tau-leaping, chemical Langevin dynamics and agent-based models.
- 06Physical modeling with particles: N-body and molecular dynamicsSimulate interacting particles for gravity and molecular dynamics: build Lennard-Jones forces, periodic boundaries, neighbor lists and a thermostat, and study Barnes–Hut acceleration and numerical validation.
- 07Finite differences I: elliptic and parabolic problems and the Lax theoremDiscretize Poisson and heat equations with finite differences, sparse matrices and the method of lines, then study consistency, stability and convergence.
- 08Finite differences II: hyperbolic equations, CFL and finite volumesStudy transport and nonlinear conservation laws through characteristics, CFL, numerical diffusion and dispersion, conservative finite volumes and TVD-limited Godunov methods.
- 09Finite elements I: weak form, Galerkin and assemblyDerive the finite-element weak form, establish well-posedness with Lax–Milgram and Galerkin quasi-optimality with Céa's lemma, and build a complete 2D P1 solver with triangular elements, sparse assembly and boundary conditions.
- 10Finite elements II: error estimates, adaptivity, nonlinearity and mixed problemsStudy a priori and duality error estimates, high-order elements, residual estimators and adaptive refinement, then extend FEM to evolution, nonlinear Newton solves and mixed Stokes problems.
- 11Advanced numerical methods: multigrid and spectral methodsMultigrid combines smoothing and coarse-grid corrections to solve discretized PDE systems efficiently. Spectral methods use Chebyshev polynomials or Fourier modes to exploit smoothness. This lesson builds both approaches and examines when to choose them.
- 12Verification and validation: solving the right equation rightDistinguish code verification, solution verification and validation; use manufactured solutions, Richardson extrapolation and grid convergence indices, then compare predictions with observations and uncertainty.
- 13Advanced Monte Carlo I: variance reductionMonte Carlo error is σ/√N, so reducing it tenfold requires a hundredfold increase in computation unless σ is reduced. Build classical variance-reduction methods and apply them to rare-event simulation, accounting for their assumptions, bias and cost.
- 14Advanced Monte Carlo II: quasi-Monte CarloStudy low-discrepancy sequences and randomized quasi-Monte Carlo, from Koksma-Hlawka and digital nets to effective dimension and Brownian bridges.
- 15Advanced Monte Carlo III: multilevel and multifidelity Monte CarloReduce simulation cost by combining coupled grid-level corrections in multilevel Monte Carlo, then extend the idea to control variates of different fidelity.
- 16Parametric uncertainty propagation: polynomial chaos and stochastic collocationPropagate uncertain inputs using Karhunen-Loève fields, polynomial chaos, stochastic Galerkin and Smolyak sparse-grid collocation.
- 17Local and global sensitivity analysisExplore parameter importance through local sensitivities, Morris screening, Sobol variance decomposition, polynomial chaos and active subspaces.
- 18Inverse problems I: ill-posedness and regularizationReconstruct causes from noisy observations in inverse problems such as deblurring and source recovery. Use the forward operator’s SVD and the Picard condition to explain noise amplification, then develop truncated SVD, Tikhonov and total variation regularization and learn how to choose their parameters.
- 19Inverse problems II: model calibration, adjoints and inverse optimizationReal inverse problems often require nonlinear calibration, such as estimating ODE rates from time series or a conductivity field from temperatures. Use nonlinear least squares and multiple shooting, assess parameter identifiability with profile likelihood, derive adjoint gradients for PDE-constrained problems and infer an objective from observed optimal decisions.
- 20Bayesian inverse problems: inference in function spacesBayesian inverse problems describe a distribution over reconstructions. Relate Tikhonov regularization to the Gaussian posterior MAP, build Matérn-type Gaussian field priors with differential operators, approximate posteriors with Laplace and low-rank Hessians, and sample with mesh-robust pCN. Finish with Kennedy–O’Hagan calibration and model discrepancy.
- 21Data assimilation I: variational methods (3D-Var and 4D-Var)Combine an imperfect dynamical model with sparse noisy observations. Formulate 3D-Var as a Bayesian analysis and 4D-Var as a windowed inverse problem with a discrete adjoint, then implement a Lorenz-96 assimilation cycle.
- 22Data assimilation II: ensemble Kalman filter and particle methodsApproximate Kalman filtering with ensembles, understand stochastic and square-root updates, localization and inflation, apply ensemble Kalman inversion, and examine particle-filter degeneracy in high dimension.
- 23Reduced-order models: POD, reduced Galerkin and DMDCalibration, uncertainty quantification and data assimilation require many simulations; reduced-order models approximate a large system with a smaller one. Build POD bases from snapshots, project equations with Galerkin, address nonlinear evaluation with DEIM and study data-driven DMD and its connection to the Koopman operator.
- 24Physics-informed neural networks I: formulation, forward and inverse problemsA physics-informed neural network represents the solution of a PDE and trains on its residual, boundary conditions and data. Implement forward and inverse PINNs and compare their cost and accuracy with classical solvers.
- 25Physics-informed neural networks II: failure modes and remediesStudy PINN failure modes including gradient imbalance, spectral bias and temporal causality, and evaluate adaptive weighting, Fourier features, causal training and residual-based sampling.
- 26Frontier I: operator learning (DeepONet and FNO)Learn operators mapping functions to PDE solutions with DeepONet and Fourier Neural Operators, and evaluate resolution transfer, distribution shift and surrogate error.
- 27Frontier II: differentiable simulation, hybrid solvers and equation discoveryCombine learned models and solvers through differentiable simulation and solver-in-the-loop corrections, discover equations with SINDy, and critically examine learned weather forecasting.
Module capstone
Uncertainty-aware digital twin of a contaminated aquifer
Build an end-to-end digital twin of a contaminant transported and reacting in a 2D aquifer with unknown permeability. (1) Modeling: nondimensionalized Darcy and advection–diffusion–reaction equations. (2) Simulation: Darcy with the custom P1 FEM and transport with limited finite volumes, verified using manufactured solutions and GCI. (3) Uncertainty: permeability as a Karhunen–Loève lognormal field; estimate the probability that concentration at a well exceeds a threshold using Monte Carlo, randomized QMC, MLMC and polynomial chaos, comparing cost at equal error; compute Sobol indices for scalar parameters. (4) Inversion: Bayesian permeability reconstruction from well measurements using a Matérn prior, adjoint MAP, low-rank Laplace approximation and pCN. (5) Assimilation: sequentially update state and permeability with localized EnKF as measurements arrive. (6) Learning: an FNO trained on the RTX 4060 as a surrogate in multifidelity MC and MCMC, and a PINN for the inverse problem, both compared fairly with classical methods. Deliver a reproducible report with verification, validation against data generated by a different discretization (avoiding the inverse crime), an error budget by source, and recommendations for additional wells to measure.
Check what you already know
- Nondimensionalize a physical model and obtain its dimensionless groups using Buckingham’s Pi theorem
- Choose an explicit integrator, an implicit integrator or a DAE solver from a work–precision diagram
- Estimate a chaotic system’s largest Lyapunov exponent and infer its predictability horizon
- Analyze finite-difference scheme stability using von Neumann analysis and connect it to convergence through Lax’s theorem
- Explain the CFL condition and why a high-order linear scheme oscillates at a shock
- Derive the weak form of a Poisson problem and assemble the P1 stiffness matrix
- Construct a control-variate estimator and calculate its optimal coefficient
- Explain why randomized QMC permits confidence intervals and when it beats Monte Carlo
- Calculate first-order and total Sobol indices with the Saltelli estimator
- Regularize an ill-posed inverse problem with Tikhonov regularization and choose the parameter using the L-curve or discrepancy principle
- Implement an ensemble Kalman filter with localization and inflation on Lorenz-96
- Train a PINN to solve forward and inverse problems and diagnose a training failure
References
- Finite Difference Methods for Ordinary and Partial Differential Equations
- The Mathematical Theory of Finite Element Methods
- Monte Carlo theory, methods and examples
- Introduction to Uncertainty Quantification
- Discrete Inverse Problems: Insight and Algorithms
- Inverse problems: A Bayesian perspective
- Data Assimilation: Methods, Algorithms, and Applications
- Data-Driven Science and Engineering: Machine Learning, Dynamical Systems, and Control
- Physics-informed machine learning