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

  1. 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.Core100 min
  2. 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.Review75 min
  3. 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.Core100 min
  4. 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.Advanced95 min
  5. 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.Core95 min
  6. 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. GPUCore100 min
  7. 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.Core115 min
  8. 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.Advanced115 min
  9. 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.Core120 min
  10. 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. GPUAdvanced120 min
  11. 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.Advanced110 min
  12. 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.Core90 min
  13. 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.Core110 min
  14. 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.Advanced110 min
  15. 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.Advanced100 min
  16. 16Parametric uncertainty propagation: polynomial chaos and stochastic collocationPropagate uncertain inputs using Karhunen-Loève fields, polynomial chaos, stochastic Galerkin and Smolyak sparse-grid collocation.Advanced115 min
  17. 17Local and global sensitivity analysisExplore parameter importance through local sensitivities, Morris screening, Sobol variance decomposition, polynomial chaos and active subspaces.Advanced100 min
  18. 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.Core115 min
  19. 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.Advanced120 min
  20. 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.Advanced115 min
  21. 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. GPUAdvanced110 min
  22. 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.Advanced115 min
  23. 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.Advanced105 min
  24. 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. GPUAdvanced110 min
  25. 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. GPUResearch110 min
  26. 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. GPUResearch110 min
  27. 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. GPUResearch110 min

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 EquationsRandall J. LeVeque, 2007
  • The Mathematical Theory of Finite Element MethodsSusanne C. Brenner, L. Ridgway Scott, 2008
  • Monte Carlo theory, methods and examplesArt B. Owen, 2013
  • Introduction to Uncertainty QuantificationT. J. Sullivan, 2015
  • Discrete Inverse Problems: Insight and AlgorithmsPer Christian Hansen, 2010
  • Inverse problems: A Bayesian perspectiveAndrew M. Stuart, 2010
  • Data Assimilation: Methods, Algorithms, and ApplicationsMark Asch, Marc Bocquet, Maëlle Nodet, 2016
  • Data-Driven Science and Engineering: Machine Learning, Dynamical Systems, and ControlSteven L. Brunton, J. Nathan Kutz, 2022
  • Physics-informed machine learningGeorge Em Karniadakis, Ioannis G. Kevrekidis, Lu Lu, Paris Perdikaris, Sifan Wang, Liu Yang, 2021