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

MethodResultGates passedTheoretical orderObserved order (G4)
Euler euler_stepPASS4 / 410.977
Heun heun_stepPASS4 / 421.992
Classical RK4 rk4_stepPASS4 / 443.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

Log-log plot of error against step size on P2 for each implemented method, with dashed reference lines of the theoretical slopes.
R2. Each line should run parallel to its dashed reference slope. Numbers: table R1 for P2.
Log-log plot of error against number of f-evaluations on P2 for each implemented method.
R3. For a target error (a horizontal line), the method furthest left is the cheapest.

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)

#GateToleranceMeasuredResult
G1One step matches the method
Three stored cases (P2, P3, P4; h = 0.1). Only rounding separates a correct step from the stored values.
≤ 1e-12largest relative difference 0.0e+00PASS
G2Cost per step
The number of f-evaluations defines the method's cost; extra calls also reveal library solvers.
exactly 1f called oncePASS
G3Works 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.
exactcorrectPASS
G4Observed 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.1p_obs = 0.977PASS

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].

nP1 errororderP2 errororderP3 errororderP4 errororder
101.25e-014.40e-019.91e-023.29e+00
206.50e-020.9382.42e-010.8624.22e-021.2301.51e+001.120
403.32e-020.9681.27e-010.9251.96e-021.1086.26e-011.274
801.68e-020.9846.55e-020.9619.45e-031.0532.79e-011.167
1608.45e-030.9923.32e-020.9804.64e-031.0261.31e-011.087
3204.24e-030.9961.67e-020.9902.30e-031.0136.36e-021.044
6402.12e-030.9988.39e-030.9951.14e-031.0063.13e-021.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.

nhrelative error
15000.011.27e-01
150000.0011.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.

hh / limit|y(4)|behaviour
0.038100.9522.73e-05decays
0.042111.0531.35e+04grows

Heun heun_step

Gates (must pass)

#GateToleranceMeasuredResult
G1One step matches the method
Three stored cases (P2, P3, P4; h = 0.1). Only rounding separates a correct step from the stored values.
≤ 1e-12largest relative difference 0.0e+00PASS
G2Cost per step
The number of f-evaluations defines the method's cost; extra calls also reveal library solvers.
exactly 2f called twicePASS
G3Works 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.
exactcorrectPASS
G4Observed 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.1p_obs = 1.992PASS

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].

nP1 errororderP2 errororderP3 errororderP4 errororder
104.20e-037.24e-025.50e-024.25e-01
201.09e-031.9451.89e-021.9381.38e-021.9971.02e-012.052
402.78e-041.9734.82e-031.9723.46e-031.9932.57e-021.994
807.01e-051.9861.22e-031.9878.69e-041.9956.45e-031.996
1601.76e-051.9933.05e-041.9942.18e-041.9971.61e-031.998
3204.41e-061.9977.65e-051.9975.45e-051.9984.04e-042.000
6401.10e-061.9981.91e-051.9981.36e-051.9991.01e-042.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.

nhrelative error
15000.011.39e-04
150000.0011.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.

hh / limit|y(4)|behaviour
0.038100.9524.61e-05decays
0.042111.0532.17e+04grows

Classical RK4 rk4_step

Gates (must pass)

#GateToleranceMeasuredResult
G1One step matches the method
Three stored cases (P2, P3, P4; h = 0.1). Only rounding separates a correct step from the stored values.
≤ 1e-12largest relative difference 0.0e+00PASS
G2Cost per step
The number of f-evaluations defines the method's cost; extra calls also reveal library solvers.
exactly 4f called 4 timesPASS
G3Works 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.
exactcorrectPASS
G4Observed 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.1p_obs = 3.995PASS

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].

nP1 errororderP2 errororderP3 errororderP4 errororder
102.08e-061.09e-042.41e-047.01e-03
201.36e-073.9406.99e-063.9621.54e-053.9704.92e-043.833
408.67e-093.9704.42e-073.9839.72e-073.9833.16e-053.961
805.47e-103.9852.78e-083.9926.11e-083.9911.99e-063.990
1603.44e-113.9921.74e-093.9963.83e-093.9951.24e-073.998
3202.15e-123.9971.09e-103.9982.40e-103.9987.78e-093.999
6401.36e-133.9876.82e-123.9981.50e-113.9994.86e-104.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.

nhrelative error
15000.011.74e-09
150000.0015.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.

hh / limit|y(4)|behaviour
0.052630.9452.00e-08decays
0.058821.0567.29e+06grows