FAILURE MAP
← Case archive

FA-86871 / Physics integrator stability / Open access

Verlet velocity kick uses only the start-of-step acceleration · case 01

Pendulum energy drifts steadily instead of oscillating around a constant.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The velocity update uses a0*dt instead of averaging old and new accelerations.

THE FAILURE

The velocity update uses a0*dt instead of averaging old and new accelerations.

Unsuccessful approach: Using only the new acceleration a1 is the mirror-image first-order error.

Case contract

solve(theta_deg, omega, g, L, dt, steps): planar pendulum theta''=-(g/L)*sin(theta), initial angle in degrees, omega in rad/s, integrated with velocity Verlet carrying the acceleration between steps. Return [angle in degrees, omega, energy per unit mass 0.5*L^2*omega^2 + g*L*(1-cos theta)], rounded to 6.

Why this case matters

Game and robotics physics loops depend on integrator update order, step control and stabilization terms; a wrong decision point turns a stable simulation into drifting or exploding motion.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(theta_deg, omega, g, L, dt, steps):
    th = math.radians(theta_deg)
    w = omega
    def acc(t):
        return -(g / L) * math.sin(t)
    a0 = acc(th)
    for _ in range(steps):
        th = th + w * dt + 0.5 * a0 * dt * dt
        a1 = acc(th)
        w = w + a0 * dt
        a0 = a1
    energy = 0.5 * L * L * w * w + g * L * (1 - math.cos(th))
    return [round(math.degrees(th), 6), round(w, 6), round(energy, 6)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[90.0, 0.0, 9.81, 2.0, 0.05, 1], [89.648705, -0.245248, 19.619998]], [[45.28, -1.957, 9.81, 0.998, 0.1, 14], [7.145368, 3.058241, 4.733766]], [[-17.9, -0.36, 1.62, 0.534, 0.05, 4], [-20.892631, -0.156704, 0.06038]], [[-46.16, 2.086, 3.71, 0.917, 0.1, 1], [-33.372114, 2.343182, 2.869399]], [[140.32, -0.763, 9.81, 2.845, 0.05, 10], [99.827729, -2.171297, 51.752981]], [[-90.69, -2.431, 1.62, 1.319, 0.02, 2], [-96.205198, -2.38199, 7.303336]], [[0.0, 0.0, 9.81, 1.0, 0.01, 5], [0.0, 0.0, 0.0]], [[47.0, -0.897, 1.62, 1.061, 0.05, 10], [14.725067, -1.294022, 0.998958]]], [[[-66.88, -1.684, 1.62, 1.853, 0.05, 7], [-97.681275, -1.384232, 6.692659]], [[50.01, 1.967, 9.81, 2.774, 0.01, 17], [66.748485, 1.454635, 24.611383]], [[101.38, -0.622, 1.62, 0.715, 0.01, 12], [96.18263, -0.890496, 1.485743]], [[-83.79, 0.173, 3.71, 1.845, 0.02, 8], [-80.740326, 0.491946, 6.15544]], [[0.0, 0.0, 9.81, 1.0, 0.01, 5], [0.0, 0.0, 0.0]], [[-71.06, 1.343, 9.81, 1.769, 0.05, 2], [-61.883545, 1.851333, 14.538443]], [[-137.97, -1.859, 3.71, 2.333, 0.1, 4], [-177.048337, -1.62521, 24.487545]], [[90.0, 0.0, 9.81, 2.0, 0.05, 1], [89.648705, -0.245248, 19.619998]]], [[[41.0, 2.417, 9.81, 1.109, 0.1, 6], [48.818539, -2.042704, 6.28179]], [[90.0, 0.0, 9.81, 2.0, 0.05, 1], [89.648705, -0.245248, 19.619998]], [[0.0, 0.0, 9.81, 1.0, 0.01, 5], [0.0, 0.0, 0.0]], [[-147.13, 1.443, 9.81, 0.534, 0.02, 21], [-41.951908, 7.759592, 9.927407]], [[34.97, -0.247, 9.81, 2.137, 0.02, 1], [34.656809, -0.299415, 3.92428]], [[-5.94, -0.635, 9.81, 1.1, 0.02, 4], [-8.656433, -0.543974, 0.301948]], [[93.55, -2.099, 9.81, 1.544, 0.02, 22], [9.152123, -4.210614, 21.325549]], [[-124.01, -2.0, 9.81, 0.956, 0.01, 22], [-138.432846, -0.351896, 16.451635]]], [[[43.67, 2.105, 3.71, 1.353, 0.1, 4], [81.504443, 1.136382, 5.460058]], [[90.0, 0.0, 9.81, 2.0, 0.05, 1], [89.648705, -0.245248, 19.619998]], [[0.0, 0.0, 9.81, 1.0, 0.01, 5], [0.0, 0.0, 0.0]], [[-122.19, -0.803, 1.62, 2.68, 0.05, 7], [-136.605657, -0.640582, 8.970025]], [[-113.01, 0.456, 3.71, 2.862, 0.02, 8], [-107.945309, 0.65005, 15.620154]], [[8.85, 1.42, 1.62, 1.964, 0.05, 3], [20.939517, 1.388226, 3.926961]], [[94.03, -1.834, 3.71, 2.089, 0.05, 1], [88.649097, -1.922676, 15.633494]], [[94.3, 1.458, 3.71, 2.777, 0.01, 21], [110.183604, 1.184993, 19.27183]]], [[[89.14, -1.757, 9.81, 1.734, 0.05, 20], [-85.551502, -1.947875, 21.395293]], [[49.27, 2.096, 1.62, 0.582, 0.02, 28], [93.815702, 0.625255, 1.071795]], [[0.0, 0.0, 9.81, 1.0, 0.01, 5], [0.0, 0.0, 0.0]], [[-8.32, -0.065, 9.81, 1.083, 0.05, 15], [4.306096, 0.37811, 0.113833]], [[44.22, -1.933, 1.62, 1.489, 0.02, 3], [37.499438, -1.975685, 4.825535]], [[28.1, 1.68, 3.71, 2.527, 0.05, 6], [54.707443, 1.389139, 10.119947]], [[-51.4, 2.238, 9.81, 2.867, 0.05, 23], [91.230573, 0.773077, 31.185525]], [[90.0, 0.0, 9.81, 2.0, 0.05, 1], [89.648705, -0.245248, 19.619998]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("case %d" % i, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
case 0[89.648705, -0.24525, 19.620001][89.648705, -0.245248, 19.619998]Failed
case 1[-2.719808, 4.171023, 8.674985][7.145368, 3.058241, 4.733766]Failed
case 2[-20.911286, -0.160407, 0.060648][-20.892631, -0.156704, 0.06038]Failed
case 3[-33.372114, 2.377814, 2.938142][-33.372114, 2.343182, 2.869399]Failed
case 4[100.235224, -2.140109, 51.404268][99.827729, -2.171297, 51.752981]Failed
case 5[-96.205174, -2.381918, 7.303041][-96.205198, -2.38199, 7.303336]Failed
case 6[0.0, 0.0, 0.0][0.0, 0.0, 0.0]Passed
case 7[14.523708, -1.311631, 1.023259][14.725067, -1.294022, 0.998958]Failed

SHA-256 / a031e6f28a7b077346e4bb73320aef01a6c747f4a4b456e4511fd3e0b76143cc

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(theta_deg, omega, g, L, dt, steps):
    th = math.radians(theta_deg)
    w = omega
    def acc(t):
        return -(g / L) * math.sin(t)
    a0 = acc(th)
    for _ in range(steps):
        th = th + w * dt + 0.5 * a0 * dt * dt
        a1 = acc(th)
        w = w + a1 * dt
        a0 = a1
    energy = 0.5 * L * L * w * w + g * L * (1 - math.cos(th))
    return [round(math.degrees(th), 6), round(w, 6), round(energy, 6)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[90.0, 0.0, 9.81, 2.0, 0.05, 1], [89.648705, -0.245248, 19.619998]], [[45.28, -1.957, 9.81, 0.998, 0.1, 14], [7.145368, 3.058241, 4.733766]], [[-17.9, -0.36, 1.62, 0.534, 0.05, 4], [-20.892631, -0.156704, 0.06038]], [[-46.16, 2.086, 3.71, 0.917, 0.1, 1], [-33.372114, 2.343182, 2.869399]], [[140.32, -0.763, 9.81, 2.845, 0.05, 10], [99.827729, -2.171297, 51.752981]], [[-90.69, -2.431, 1.62, 1.319, 0.02, 2], [-96.205198, -2.38199, 7.303336]], [[0.0, 0.0, 9.81, 1.0, 0.01, 5], [0.0, 0.0, 0.0]], [[47.0, -0.897, 1.62, 1.061, 0.05, 10], [14.725067, -1.294022, 0.998958]]], [[[-66.88, -1.684, 1.62, 1.853, 0.05, 7], [-97.681275, -1.384232, 6.692659]], [[50.01, 1.967, 9.81, 2.774, 0.01, 17], [66.748485, 1.454635, 24.611383]], [[101.38, -0.622, 1.62, 0.715, 0.01, 12], [96.18263, -0.890496, 1.485743]], [[-83.79, 0.173, 3.71, 1.845, 0.02, 8], [-80.740326, 0.491946, 6.15544]], [[0.0, 0.0, 9.81, 1.0, 0.01, 5], [0.0, 0.0, 0.0]], [[-71.06, 1.343, 9.81, 1.769, 0.05, 2], [-61.883545, 1.851333, 14.538443]], [[-137.97, -1.859, 3.71, 2.333, 0.1, 4], [-177.048337, -1.62521, 24.487545]], [[90.0, 0.0, 9.81, 2.0, 0.05, 1], [89.648705, -0.245248, 19.619998]]], [[[41.0, 2.417, 9.81, 1.109, 0.1, 6], [48.818539, -2.042704, 6.28179]], [[90.0, 0.0, 9.81, 2.0, 0.05, 1], [89.648705, -0.245248, 19.619998]], [[0.0, 0.0, 9.81, 1.0, 0.01, 5], [0.0, 0.0, 0.0]], [[-147.13, 1.443, 9.81, 0.534, 0.02, 21], [-41.951908, 7.759592, 9.927407]], [[34.97, -0.247, 9.81, 2.137, 0.02, 1], [34.656809, -0.299415, 3.92428]], [[-5.94, -0.635, 9.81, 1.1, 0.02, 4], [-8.656433, -0.543974, 0.301948]], [[93.55, -2.099, 9.81, 1.544, 0.02, 22], [9.152123, -4.210614, 21.325549]], [[-124.01, -2.0, 9.81, 0.956, 0.01, 22], [-138.432846, -0.351896, 16.451635]]], [[[43.67, 2.105, 3.71, 1.353, 0.1, 4], [81.504443, 1.136382, 5.460058]], [[90.0, 0.0, 9.81, 2.0, 0.05, 1], [89.648705, -0.245248, 19.619998]], [[0.0, 0.0, 9.81, 1.0, 0.01, 5], [0.0, 0.0, 0.0]], [[-122.19, -0.803, 1.62, 2.68, 0.05, 7], [-136.605657, -0.640582, 8.970025]], [[-113.01, 0.456, 3.71, 2.862, 0.02, 8], [-107.945309, 0.65005, 15.620154]], [[8.85, 1.42, 1.62, 1.964, 0.05, 3], [20.939517, 1.388226, 3.926961]], [[94.03, -1.834, 3.71, 2.089, 0.05, 1], [88.649097, -1.922676, 15.633494]], [[94.3, 1.458, 3.71, 2.777, 0.01, 21], [110.183604, 1.184993, 19.27183]]], [[[89.14, -1.757, 9.81, 1.734, 0.05, 20], [-85.551502, -1.947875, 21.395293]], [[49.27, 2.096, 1.62, 0.582, 0.02, 28], [93.815702, 0.625255, 1.071795]], [[0.0, 0.0, 9.81, 1.0, 0.01, 5], [0.0, 0.0, 0.0]], [[-8.32, -0.065, 9.81, 1.083, 0.05, 15], [4.306096, 0.37811, 0.113833]], [[44.22, -1.933, 1.62, 1.489, 0.02, 3], [37.499438, -1.975685, 4.825535]], [[28.1, 1.68, 3.71, 2.527, 0.05, 6], [54.707443, 1.389139, 10.119947]], [[-51.4, 2.238, 9.81, 2.867, 0.05, 23], [91.230573, 0.773077, 31.185525]], [[90.0, 0.0, 9.81, 2.0, 0.05, 1], [89.648705, -0.245248, 19.619998]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("case %d" % i, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
case 0[89.648705, -0.245245, 19.619996][89.648705, -0.245248, 19.619998]Failed
case 1[8.642592, 2.058167, 2.220731][7.145368, 3.058241, 4.733766]Failed
case 2[-20.874072, -0.153047, 0.060118][-20.892631, -0.156704, 0.06038]Failed
case 3[-33.372114, 2.308549, 2.801665][-33.372114, 2.343182, 2.869399]Failed
case 4[99.416531, -2.20269, 52.111198][99.827729, -2.171297, 51.752981]Failed
case 5[-96.205223, -2.382061, 7.303632][-96.205198, -2.38199, 7.303336]Failed
case 6[0.0, 0.0, 0.0][0.0, 0.0, 0.0]Passed
case 7[14.924719, -1.276666, 0.975378][14.725067, -1.294022, 0.998958]Failed

SHA-256 / 2ab2310a6a3ec5325604d440948b3bcfe92c945df7e29dfe7e4e054d44aeed7f

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

A deterministic bounded teaching model with stipulated toy conventions and rounded float output; not a production physics engine or a proof of numerical stability. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:50:53.460532+00:00.

Case digest / d020c473c1cd9b05c8c9d9bb47f8675d3bfe5ed85750a8eab1553a79231a9b4e