1. Radiative cooling
Integrate dT/dt = −βT⁴ for 30 s with T₀ = 400 K and β = 5 × 10−10 K−3 s−1. For surroundings at 0 K, the reference is T(t) = (T₀−3 + 3βt)−1/3.
python teaching-baselines.py cooling --step 0.4 > cooling.csv
- Plot the numerical and exact temperatures against time. Record the maximum absolute temperature error.
- Repeat with maximum steps of 0.2, 0.1 and 0.05 s. Use the actual step from the CSV and compute the observed order from successive error ratios.
- Set the surroundings to 293 K using −β(T⁴ − 293⁴). Check that the temperature decreases towards 293 K from above, and estimate the remaining error with a finer time step.
Submit The temperature curve, the convergence table and the check for the 293 K case.
2. Damped oscillator
Set x″ + 2γx′ + ω₀²x = 0, with γ = 0.1 s−1, ω₀ = 2π s−1, x(0) = 1 m and x′(0) = 0. The script supplies the exact displacement and specific energy over ten damped periods.
python teaching-baselines.py oscillator --step 0.1 > oscillator.csv
- Plot displacement and specific energy from the numerical and exact columns.
- Halve the step at fixed damping. Then double the damping at fixed step and compare the change in the physical decay.
- Report the largest tested step for which the displacement error at ten periods is below 1% of the exact displacement magnitude there. Repeat with the next finer step.
Submit Both plots, the error table and the tested step limit.
3. Order of a finite difference stencil
Solve periodic advection uₜ + uₓ = 0 on [0, 1) to t = 1. The solution returns to the initial profile after one circuit.
- Use sin(2πx) initially. Compare second- and fourth-order centred spatial differences with RK4 and Δt = 0.2Δx.
- Run 32, 64, 128 and 256 points, record the RMS error and fit a slope on a log–log plot.
- Repeat with the periodic triangular profile 1 − |2x − 1|. Compare slopes and plot the error near the kink.
Submit Error plots and observed orders for both profiles.
4. Slope limiters in finite volumes
Use the periodic advection model from exercise 3 with 100 cells and Courant number 0.4. Start with u = 1 on [0.25, 0.5) and u = 0 elsewhere.
- Use piecewise linear reconstruction with an upwind numerical flux. Compare unlimited centred slopes, minmod and monotonized central. Use the same second-order SSP Runge–Kutta time integration in all three runs.
- After one circuit, measure the minimum and maximum, the sum of absolute jumps including the periodic seam, and the change in Σᵢ uᵢ Δx. The initial mass is 0.25.
- Repeat with sin(2πx). Compare the trade-off between pulse smearing and smooth-wave error.
Submit A table of bounds, total variation and mass errors, with both profiles plotted.
5. One Poisson model, five discretizations
- Run the benchmark script on 16 cells per direction and compare the five cell-centre RMS errors with the article.
- Repeat on 8 and 32 cells per direction. Estimate the order separately over 8→16 and 16→32. Record resources if the largest direct solve exceeds your machine’s memory or time budget.
- Plot error against wall time and identify which tested runs meet RMS ≤ 10−5. List what you would need to hold fixed in a second benchmark on curved geometry.
Submit Errors, observed orders and the error–time plot.
6. Linear solver accuracy
Use linear FEM on the 16³ Poisson grid from exercise 5. Keep the assembled system and initial guess fixed when comparing iterative methods.
- Solve directly, with conjugate gradients and with GMRES using an ILU preconditioner. Apply CG to the symmetric positive definite system after eliminating the fixed boundary values.
- For relative tolerances from 10−3 to 10−9, record iterations, relative residual ‖b − Ax‖₂ / ‖b‖₂, wall time and cell-centre RMS difference from the direct solution.
- Choose the loosest tested tolerance where the difference from the direct solution is at most a tenth of the direct solution's discretization error.
Submit A solver comparison and the two errors that justify your chosen tolerance.
7. A cantilever in 3D
Use a 200 mm cantilever with a 20 × 10 mm rectangular section, E = 70 GPa and ν = 0.33. Fix one end and apply a total transverse force of 1 N to the other face, in the 10 mm direction. The beam reference is u = FL³/(3EI) and I = bh³/12, giving about 22.86 µm.
- Report mean transverse displacement on the loaded face for two meshes. Compare axial stress at midspan at the same physical location on both grids.
- Compare the displacement with the Euler–Bernoulli formula. Discuss local stress near the clamp separately from displacement.
- Double the length while keeping the section and force fixed. Compare the displacement ratio with the predicted factor of eight.
Submit Mesh sizes, displacements, a stress check and the length-scaling comparison.
8. Verify a reaction–diffusion equation
On the unit square with zero Dirichlet data, solve −∇·(D∇u) + ku = f with D = 0.1, k = 2 and prescribed exact field u = sin(πx) sin(πy).
- Apply the operator to the exact field to derive f = (2Dπ² + k)u. Check the boundary values.
- Solve on 16², 32² and 64² cells. Compare cell-centre RMS errors and inspect the signed error field.
- Compute both pairwise convergence orders and relate them to the discretization and linear solver tolerance.
Submit Source derivation, refinement table and one error-field plot.