Verification report
verifiedmethods · Unit A1: ODE initial value problems · version 0.1.0a2
- Student
- Example student (reference implementation)
- Matriculation number
- EXAMPLE
- Department
- Mathematics
- Institution
- Example university
- Supervisor
- Example supervisor
- Run
- 2026-11-18 09:18 UTC (local run)
- Imports in steps.py
- numpy
- Student-code fingerprint
- SHA-256 aa417ecc2046bffc66dd4ac5de9c38ec543282eb3e4f7e1c13480f3c6372bcb6
- Check-suite fingerprint
- SHA-256 406f2a09c0b8a67974df7acc948194baaa71be36b3ba81933bac7db0c8b43a3d
- Environment
- Python 3.13.7, NumPy 2.5.4, SciPy 1.18.1, Matplotlib 3.11.2, Darwin 27.2.0
Summary
| Method | Result | Gates passed | Theoretical order | Observed order (G4) |
|---|---|---|---|---|
| Euler euler_step | PASS | 4 / 4 | 1 | 0.977 |
| Heun heun_step | PASS | 4 / 4 | 2 | 1.992 |
| Classical RK4 rk4_step | PASS | 4 / 4 | 4 | 3.995 |
A method passes when all four gates pass. Gate G4 accepts an observed order within ±0.1 of the theoretical order. Details for each method follow the statement below.
Comparing the methods
AI-use disclosure
Maintainer reference implementation; this is an example, not a student submission.
What this report shows
This report shows that the code with the student-code fingerprint above passed the gates marked PASS, using the check suite with the check-suite fingerprint above. It does not show who wrote the code.
To confirm it, copy the student's student folder into your own fresh copy of this unit and run python verify.py --strict. Your report should show the same gates and student-code fingerprint, and the check-suite fingerprint should match the stated checker on the unit's page at verifiedmethods.github.io. Keep the original versioned zip and its SHA-256 with the submission.
Euler euler_step
Gates (must pass)
| # | Gate | Tolerance | Measured | Result |
|---|---|---|---|---|
| G1 | One step matches the method Three stored cases (P2, P3, P4; h = 0.1). Only rounding separates a correct step from the stored values. | ≤ 1e-12 | largest relative difference 0.0e+00 | PASS |
| G2 | Cost per step The number of f-evaluations defines the method's cost; extra calls also reveal library solvers. | exactly 1 | f called once | PASS |
| G3 | Works on systems, without side effects P4 is a system of two equations. Changing y in place is the most common NumPy bug in hand-written RK code. | exact | correct | PASS |
| G4 | Observed convergence order Least-squares slope of log(error) against log(h) on P2 for n = 40 to 320 steps; the margin covers the pre-asymptotic range without letting a lower-order method pass. | |p_obs - 1| ≤ 0.1 | p_obs = 0.977 | PASS |
Reported results below have no pass mark: interpret them in your write-up.
R1. Error against the exact solution (expected order 1)
Error at the end of each interval (max norm) with n equal steps, so h = (interval length)/n. Order is log(eprevious/e)/log 2, since h halves between rows. P1 Exponential growth: y' = y, y(0) = 1, on [0, 1]; P2 Non-autonomous scalar equation: y' = y - t^2 + 1, y(0) = 0.5, on [0, 2]; P3 Logistic growth: y' = 0.8 y (1 - y/10), y(0) = 1, on [0, 5]; P4 Harmonic oscillator (system): y1' = y2, y2' = -y1, y(0) = (1, 0), on [0, 2 pi].
| n | P1 error | order | P2 error | order | P3 error | order | P4 error | order |
|---|---|---|---|---|---|---|---|---|
| 10 | 1.25e-01 | 4.40e-01 | 9.91e-02 | 3.29e+00 | ||||
| 20 | 6.50e-02 | 0.938 | 2.42e-01 | 0.862 | 4.22e-02 | 1.230 | 1.51e+00 | 1.120 |
| 40 | 3.32e-02 | 0.968 | 1.27e-01 | 0.925 | 1.96e-02 | 1.108 | 6.26e-01 | 1.274 |
| 80 | 1.68e-02 | 0.984 | 6.55e-02 | 0.961 | 9.45e-03 | 1.053 | 2.79e-01 | 1.167 |
| 160 | 8.45e-03 | 0.992 | 3.32e-02 | 0.980 | 4.64e-03 | 1.026 | 1.31e-01 | 1.087 |
| 320 | 4.24e-03 | 0.996 | 1.67e-02 | 0.990 | 2.30e-03 | 1.013 | 6.36e-02 | 1.044 |
| 640 | 2.12e-03 | 0.998 | 8.39e-03 | 0.995 | 1.14e-03 | 1.006 | 3.13e-02 | 1.022 |
R4. Agreement with SciPy on P5 (Lotka–Volterra, no exact solution)
Relative error at t = 15 against SciPy solve_ivp, DOP853, rtol = atol = 1e-13.
| n | h | relative error |
|---|---|---|
| 1500 | 0.01 | 1.27e-01 |
| 15000 | 0.001 | 1.10e-02 |
R5. Stability on the stiff problem P6 (y' = −50y on [0, 4])
Theory: stable for h < 2.0000/|λ| = 0.04000. The exact solution decays to 1.4e-87.
| h | h / limit | |y(4)| | behaviour |
|---|---|---|---|
| 0.03810 | 0.952 | 2.73e-05 | decays |
| 0.04211 | 1.053 | 1.35e+04 | grows |
Heun heun_step
Gates (must pass)
| # | Gate | Tolerance | Measured | Result |
|---|---|---|---|---|
| G1 | One step matches the method Three stored cases (P2, P3, P4; h = 0.1). Only rounding separates a correct step from the stored values. | ≤ 1e-12 | largest relative difference 0.0e+00 | PASS |
| G2 | Cost per step The number of f-evaluations defines the method's cost; extra calls also reveal library solvers. | exactly 2 | f called twice | PASS |
| G3 | Works on systems, without side effects P4 is a system of two equations. Changing y in place is the most common NumPy bug in hand-written RK code. | exact | correct | PASS |
| G4 | Observed convergence order Least-squares slope of log(error) against log(h) on P2 for n = 40 to 320 steps; the margin covers the pre-asymptotic range without letting a lower-order method pass. | |p_obs - 2| ≤ 0.1 | p_obs = 1.992 | PASS |
Reported results below have no pass mark: interpret them in your write-up.
R1. Error against the exact solution (expected order 2)
Error at the end of each interval (max norm) with n equal steps, so h = (interval length)/n. Order is log(eprevious/e)/log 2, since h halves between rows. P1 Exponential growth: y' = y, y(0) = 1, on [0, 1]; P2 Non-autonomous scalar equation: y' = y - t^2 + 1, y(0) = 0.5, on [0, 2]; P3 Logistic growth: y' = 0.8 y (1 - y/10), y(0) = 1, on [0, 5]; P4 Harmonic oscillator (system): y1' = y2, y2' = -y1, y(0) = (1, 0), on [0, 2 pi].
| n | P1 error | order | P2 error | order | P3 error | order | P4 error | order |
|---|---|---|---|---|---|---|---|---|
| 10 | 4.20e-03 | 7.24e-02 | 5.50e-02 | 4.25e-01 | ||||
| 20 | 1.09e-03 | 1.945 | 1.89e-02 | 1.938 | 1.38e-02 | 1.997 | 1.02e-01 | 2.052 |
| 40 | 2.78e-04 | 1.973 | 4.82e-03 | 1.972 | 3.46e-03 | 1.993 | 2.57e-02 | 1.994 |
| 80 | 7.01e-05 | 1.986 | 1.22e-03 | 1.987 | 8.69e-04 | 1.995 | 6.45e-03 | 1.996 |
| 160 | 1.76e-05 | 1.993 | 3.05e-04 | 1.994 | 2.18e-04 | 1.997 | 1.61e-03 | 1.998 |
| 320 | 4.41e-06 | 1.997 | 7.65e-05 | 1.997 | 5.45e-05 | 1.998 | 4.04e-04 | 2.000 |
| 640 | 1.10e-06 | 1.998 | 1.91e-05 | 1.998 | 1.36e-05 | 1.999 | 1.01e-04 | 2.000 |
R4. Agreement with SciPy on P5 (Lotka–Volterra, no exact solution)
Relative error at t = 15 against SciPy solve_ivp, DOP853, rtol = atol = 1e-13.
| n | h | relative error |
|---|---|---|
| 1500 | 0.01 | 1.39e-04 |
| 15000 | 0.001 | 1.41e-06 |
R5. Stability on the stiff problem P6 (y' = −50y on [0, 4])
Theory: stable for h < 2.0000/|λ| = 0.04000. The exact solution decays to 1.4e-87.
| h | h / limit | |y(4)| | behaviour |
|---|---|---|---|
| 0.03810 | 0.952 | 4.61e-05 | decays |
| 0.04211 | 1.053 | 2.17e+04 | grows |
Classical RK4 rk4_step
Gates (must pass)
| # | Gate | Tolerance | Measured | Result |
|---|---|---|---|---|
| G1 | One step matches the method Three stored cases (P2, P3, P4; h = 0.1). Only rounding separates a correct step from the stored values. | ≤ 1e-12 | largest relative difference 0.0e+00 | PASS |
| G2 | Cost per step The number of f-evaluations defines the method's cost; extra calls also reveal library solvers. | exactly 4 | f called 4 times | PASS |
| G3 | Works on systems, without side effects P4 is a system of two equations. Changing y in place is the most common NumPy bug in hand-written RK code. | exact | correct | PASS |
| G4 | Observed convergence order Least-squares slope of log(error) against log(h) on P2 for n = 40 to 320 steps; the margin covers the pre-asymptotic range without letting a lower-order method pass. | |p_obs - 4| ≤ 0.1 | p_obs = 3.995 | PASS |
Reported results below have no pass mark: interpret them in your write-up.
R1. Error against the exact solution (expected order 4)
Error at the end of each interval (max norm) with n equal steps, so h = (interval length)/n. Order is log(eprevious/e)/log 2, since h halves between rows. P1 Exponential growth: y' = y, y(0) = 1, on [0, 1]; P2 Non-autonomous scalar equation: y' = y - t^2 + 1, y(0) = 0.5, on [0, 2]; P3 Logistic growth: y' = 0.8 y (1 - y/10), y(0) = 1, on [0, 5]; P4 Harmonic oscillator (system): y1' = y2, y2' = -y1, y(0) = (1, 0), on [0, 2 pi].
| n | P1 error | order | P2 error | order | P3 error | order | P4 error | order |
|---|---|---|---|---|---|---|---|---|
| 10 | 2.08e-06 | 1.09e-04 | 2.41e-04 | 7.01e-03 | ||||
| 20 | 1.36e-07 | 3.940 | 6.99e-06 | 3.962 | 1.54e-05 | 3.970 | 4.92e-04 | 3.833 |
| 40 | 8.67e-09 | 3.970 | 4.42e-07 | 3.983 | 9.72e-07 | 3.983 | 3.16e-05 | 3.961 |
| 80 | 5.47e-10 | 3.985 | 2.78e-08 | 3.992 | 6.11e-08 | 3.991 | 1.99e-06 | 3.990 |
| 160 | 3.44e-11 | 3.992 | 1.74e-09 | 3.996 | 3.83e-09 | 3.995 | 1.24e-07 | 3.998 |
| 320 | 2.15e-12 | 3.997 | 1.09e-10 | 3.998 | 2.40e-10 | 3.998 | 7.78e-09 | 3.999 |
| 640 | 1.36e-13 | 3.987 | 6.82e-12 | 3.998 | 1.50e-11 | 3.999 | 4.86e-10 | 4.000 |
R4. Agreement with SciPy on P5 (Lotka–Volterra, no exact solution)
Relative error at t = 15 against SciPy solve_ivp, DOP853, rtol = atol = 1e-13.
| n | h | relative error |
|---|---|---|
| 1500 | 0.01 | 1.74e-09 |
| 15000 | 0.001 | 5.27e-14 |
R5. Stability on the stiff problem P6 (y' = −50y on [0, 4])
Theory: stable for h < 2.7853/|λ| = 0.05571. The exact solution decays to 1.4e-87.
| h | h / limit | |y(4)| | behaviour |
|---|---|---|---|
| 0.05263 | 0.945 | 2.00e-08 | decays |
| 0.05882 | 1.056 | 7.29e+06 | grows |