Tutorial

14-week numerical methods lab

One two-hour lab per week. Assign the model and reference before class so students can spend their time measuring convergence, checking balances and explaining differences.

Prerequisites

Basic Python, NumPy and Matplotlib, plus an introduction to differential equations. Provide a OneSimulation Runtime environment before assigning the Runtime examples. The assessment assumes students can run a notebook from a fresh kernel and document input units and boundary conditions.

Weekly schedule

  1. Radiative cooling

    Integrate the temperature of a lumped thermal mass and check the result against the exact cooling curve. Exercise 1

  2. Time integration

    Compare a damped oscillator with its analytic solution. Halve the time step three times and measure amplitude error. Exercise 2

  3. Finite differences

    Advect a wave once around a periodic interval. Measure the stencil order for a smooth wave and for a profile with a kink. Exercise 3

  4. Finite volumes

    Transport a square pulse and compare the overshoot, total variation and mass balance with and without slope limiting. Exercise 4

  5. Finite elements

    Approximate the exact sine field from the Poisson case on the same mesh with linear and quadratic elements. Compare nodal interpolation with an L² projection.

  6. Discretization benchmark

    Solve the same 3D Poisson problem with FEM, FVM and FDM. Compare errors at common sampling points. Exercise 5

  7. Linear solvers

    Compare a sparse direct solve, conjugate gradients and preconditioned GMRES. Choose a stopping tolerance using both residual and solution error. Exercise 6

  8. Nonlinear solvers

    Take an implicit Euler step in the cooling model. For the scalar equation T + Δt β T⁴ − Told = 0, compare Newton iteration with bisection on [0, Told].

  9. 3D elasticity

    Check the displacement of a cantilever or an imported steel sleeve against an analytical reference. Report sensitivity to the mesh. Exercise 7 · STEP case

  10. Heat and magnetic fields

    Choose a heat-transfer case and a homogenized coil from the atlas. Report the heat balance for the first and plot field magnitude along the coil axis for the second.

  11. Coupled models

    Compare monolithic and partitioned solutions for thermal exchange. Transfer one field between meshes and report the change in its integral.

  12. Manufactured solutions

    Choose an exact reaction–diffusion field, derive the source and measure the error on three meshes. Exercise 8

  13. Project model

    Write a one-page model description that specifies inputs, governing equations, boundary conditions, a reference and a numerical acceptance threshold.

  14. Project verification

    Run the notebook from a fresh kernel. Present the model, reference check and a limitation in ten minutes.

Assessment

For each exercise, submit one executable notebook with parameters and units, a quantitative check and a short interpretation. For the final project, assess the model definition, reproducibility, choice of reference and whether the result meets the agreed threshold.

For a seven-session block, use weeks 1, 3, 4, 6, 7, 9 and 12.