Tutorial¶
This tutorial takes you from Euler’s method to the classical fourth-order Runge–Kutta method, and teaches you to verify your code: to show, with evidence, that it does what the theory says. Work through the sections in order; each one ends with something to do.
Section |
Topic |
|---|---|
Setting up Python and running |
|
The initial value problem |
|
Euler’s method: write |
|
Primer: measuring error and convergence order |
|
Heun’s method and classical RK4: write |
|
Comparing methods properly: error against cost |
|
Stability and stiffness |
|
Reading your verification report |
|
Choosing a project brief |
What you need: a computer with Python 3.10 or later, NumPy, SciPy and Matplotlib. Plan several sessions; setup, tutorial and project time depend on your background. The code and reports work offline after installation; section 0 explains how to prepare formatted tutorial material for offline reading.
What you should know already: calculus including Taylor series, a first course in ordinary differential equations, and basic Python (variables, functions, and arithmetic with NumPy arrays).
What you hand in: your student folder (including steps.py,
student_info.txt and completed CONTRIBUTION.md), your verification report,
and the agreed assignment or project write-up. For a project brief, also
submit the experiment scripts or notebooks, any additional inputs, and the
command and working directory that reproduce a named figure or table.
Further reading: Driscoll and Braun’s Fundamentals of Numerical Computation, Python edition provides additional explanations and examples. Your lecturer’s course text should guide the depth of theory expected.