FAILURE MAP
← Case archive

FA-87111 / Physics integrator stability / Open access

Energy peak ignores the initial state · case 01

A purely dissipative run reports a peak below one.

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

ROOT CAUSE

peak starts at 0 instead of E_0/E_0=1.

THE FAILURE

peak starts at 0 instead of E_0/E_0=1.

Unsuccessful approach: Seeding with 1 regardless of E_0 reports 1 for a system at rest.

Case contract

solve(x0, v0, k, m, c, dt, steps): backward Euler for x'=v, m v'=-k x-c v in closed form v1=(v-dt*k*x/m)/(1+dt*c/m+dt^2*k/m), x1=x+dt*v1. Energy E=0.5 m v^2+0.5 k x^2; report the peak E_n/E_0 including step 0 (0 when E_0=0). Return [x, v, peak] 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(x0, v0, k, m, c, dt, steps):
    x, v = x0, v0
    def energy(p, q):
        return 0.5 * m * q * q + 0.5 * k * p * p
    e0 = energy(x, v)
    peak = 0.0
    for _ in range(steps):
        v = (v - dt * k * x / m) / (1 + dt * c / m + dt * dt * k / m)
        x = x + dt * v
        if e0 > 0:
            peak = max(peak, energy(x, v) / e0)
    return [round(x, 6), round(v, 6), round(peak, 6)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[0.0, 0.0, 5.0, 1.0, 0.5, 0.1, 3], [0.0, 0.0, 0.0]], [[-1.795, -0.563, 97.971, 1.205, 2.366, 0.01, 5], [-1.618428, 6.062195, 1.0]], [[1.287, -0.056, 59.572, 2.284, 0.95, 0.01, 3], [1.265475, -1.044567, 1.0]], [[-1.047, -0.67, 79.136, 2.338, 2.551, 0.5, 5], [-0.002577, -0.011202, 1.0]], [[-0.221, -1.064, 98.514, 1.675, 2.729, 0.05, 6], [-0.014738, 1.136191, 1.0]], [[0.191, 1.945, 34.85, 2.123, 1.81, 0.5, 2], [0.064229, -0.321773, 1.0]], [[-1.173, 0.504, 23.099, 0.515, 1.355, 0.01, 5], [-1.077545, 2.77492, 1.0]], [[-0.359, 1.447, 98.584, 1.076, 0.728, 0.1, 1], [-0.120265, 2.387352, 1.0]]], [[[0.0, 0.0, 5.0, 1.0, 0.5, 0.1, 3], [0.0, 0.0, 0.0]], [[-0.519, -0.968, 62.61, 2.039, 0.152, 0.1, 6], [0.217976, 0.56902, 1.0]], [[-1.228, -0.451, 23.36, 2.048, 1.522, 0.01, 2], [-1.232747, -0.166441, 1.0]], [[0.194, -0.92, 25.988, 2.712, 0.886, 0.1, 8], [-0.209628, 0.163927, 1.0]], [[1.222, -0.934, 73.713, 1.468, 2.452, 0.5, 5], [0.00146, 0.00258, 1.0]], [[-0.353, 1.043, 27.253, 2.731, 0.193, 0.1, 2], [-0.092597, 1.343471, 1.0]], [[0.285, 0.068, 25.144, 2.544, 0.635, 0.05, 8], [0.107212, -0.715572, 1.0]], [[-0.807, 1.714, 56.088, 0.42, 1.994, 0.01, 2], [-0.746049, 3.463472, 1.0]]], [[[-0.643, 1.644, 71.947, 1.526, 2.926, 0.01, 9], [-0.398185, 3.378185, 1.0]], [[1.295, 1.182, 85.267, 2.457, 0.514, 0.5, 4], [0.000372, 0.08085, 1.0]], [[-0.434, -0.009, 26.785, 0.935, 0.736, 0.01, 8], [-0.392173, 0.912522, 1.0]], [[-1.401, 0.585, 79.1, 0.893, 2.35, 0.5, 10], [-0.0, -0.0, 1.0]], [[0.386, -0.162, 8.141, 0.775, 0.054, 0.05, 8], [0.058357, -1.106352, 1.0]], [[-1.79, 0.797, 47.159, 1.773, 0.615, 0.5, 8], [0.000479, -8.8e-05, 1.0]], [[-1.724, -0.957, 58.152, 0.412, 2.15, 0.01, 9], [-0.983354, 13.094621, 1.0]], [[0.0, 0.0, 5.0, 1.0, 0.5, 0.1, 3], [0.0, 0.0, 0.0]]], [[[-0.483, -0.784, 27.483, 1.465, 2.895, 0.5, 4], [0.012645, -0.018998, 1.0]], [[-1.031, -0.971, 69.316, 1.698, 1.184, 0.01, 12], [-0.833114, 3.639745, 1.0]], [[-0.078, 1.874, 4.44, 1.689, 0.968, 0.5, 7], [-0.098892, -0.060816, 1.0]], [[-0.969, 1.013, 41.406, 1.249, 0.992, 0.1, 10], [-0.075433, -0.873216, 1.0]], [[0.0, 0.0, 5.0, 1.0, 0.5, 0.1, 3], [0.0, 0.0, 0.0]], [[0.48, 0.698, 50.79, 1.825, 2.065, 0.05, 5], [0.243232, -1.683845, 1.0]], [[1.497, -1.379, 45.786, 1.63, 2.88, 0.1, 2], [0.636403, -4.774961, 1.0]], [[1.552, 0.554, 52.042, 1.485, 2.786, 0.1, 7], [-0.351271, 0.485422, 1.0]]], [[[1.033, -0.399, 54.986, 0.514, 0.653, 0.1, 2], [0.025322, -4.864814, 1.0]], [[0.544, 1.609, 65.688, 1.374, 0.719, 0.01, 10], [0.552951, -1.128422, 1.0]], [[0.0, 0.0, 5.0, 1.0, 0.5, 0.1, 3], [0.0, 0.0, 0.0]], [[-1.018, 0.6, 47.422, 0.649, 0.697, 0.05, 13], [-0.102658, -1.948575, 1.0]], [[1.48, -1.5, 47.647, 0.462, 0.24, 0.5, 7], [-1.4e-05, 2e-05, 1.0]], [[-0.149, -1.14, 86.892, 1.181, 0.035, 0.1, 12], [-0.000609, 0.061827, 1.0]], [[1.452, 1.003, 62.635, 0.47, 0.091, 0.01, 7], [1.023334, -10.790614, 1.0]], [[-0.392, 1.009, 22.203, 0.871, 0.568, 0.1, 12], [-0.074175, -0.141016, 1.0]]]]
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[0.0, 0.0, 0.0][0.0, 0.0, 0.0]Passed
case 1[-1.618428, 6.062195, 0.992009][-1.618428, 6.062195, 1.0]Failed
case 2[1.265475, -1.044567, 0.997394][1.265475, -1.044567, 1.0]Failed
case 3[-0.002577, -0.011202, 0.111623][-0.002577, -0.011202, 1.0]Failed
case 4[-0.014738, 1.136191, 0.859255][-0.014738, 1.136191, 1.0]Failed
case 5[0.064229, -0.321773, 0.190909][0.064229, -0.321773, 1.0]Failed
case 6[-1.077545, 2.77492, 0.99512][-1.077545, 2.77492, 1.0]Failed
case 7[-0.120265, 2.387352, 0.505296][-0.120265, 2.387352, 1.0]Failed

SHA-256 / fc4ee1257508ca927af11438093560ad96c7ac42bd2b6cbd785a12facca1936d

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(x0, v0, k, m, c, dt, steps):
    x, v = x0, v0
    def energy(p, q):
        return 0.5 * m * q * q + 0.5 * k * p * p
    e0 = energy(x, v)
    peak = 1.0
    for _ in range(steps):
        v = (v - dt * k * x / m) / (1 + dt * c / m + dt * dt * k / m)
        x = x + dt * v
        if e0 > 0:
            peak = max(peak, energy(x, v) / e0)
    return [round(x, 6), round(v, 6), round(peak, 6)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[0.0, 0.0, 5.0, 1.0, 0.5, 0.1, 3], [0.0, 0.0, 0.0]], [[-1.795, -0.563, 97.971, 1.205, 2.366, 0.01, 5], [-1.618428, 6.062195, 1.0]], [[1.287, -0.056, 59.572, 2.284, 0.95, 0.01, 3], [1.265475, -1.044567, 1.0]], [[-1.047, -0.67, 79.136, 2.338, 2.551, 0.5, 5], [-0.002577, -0.011202, 1.0]], [[-0.221, -1.064, 98.514, 1.675, 2.729, 0.05, 6], [-0.014738, 1.136191, 1.0]], [[0.191, 1.945, 34.85, 2.123, 1.81, 0.5, 2], [0.064229, -0.321773, 1.0]], [[-1.173, 0.504, 23.099, 0.515, 1.355, 0.01, 5], [-1.077545, 2.77492, 1.0]], [[-0.359, 1.447, 98.584, 1.076, 0.728, 0.1, 1], [-0.120265, 2.387352, 1.0]]], [[[0.0, 0.0, 5.0, 1.0, 0.5, 0.1, 3], [0.0, 0.0, 0.0]], [[-0.519, -0.968, 62.61, 2.039, 0.152, 0.1, 6], [0.217976, 0.56902, 1.0]], [[-1.228, -0.451, 23.36, 2.048, 1.522, 0.01, 2], [-1.232747, -0.166441, 1.0]], [[0.194, -0.92, 25.988, 2.712, 0.886, 0.1, 8], [-0.209628, 0.163927, 1.0]], [[1.222, -0.934, 73.713, 1.468, 2.452, 0.5, 5], [0.00146, 0.00258, 1.0]], [[-0.353, 1.043, 27.253, 2.731, 0.193, 0.1, 2], [-0.092597, 1.343471, 1.0]], [[0.285, 0.068, 25.144, 2.544, 0.635, 0.05, 8], [0.107212, -0.715572, 1.0]], [[-0.807, 1.714, 56.088, 0.42, 1.994, 0.01, 2], [-0.746049, 3.463472, 1.0]]], [[[-0.643, 1.644, 71.947, 1.526, 2.926, 0.01, 9], [-0.398185, 3.378185, 1.0]], [[1.295, 1.182, 85.267, 2.457, 0.514, 0.5, 4], [0.000372, 0.08085, 1.0]], [[-0.434, -0.009, 26.785, 0.935, 0.736, 0.01, 8], [-0.392173, 0.912522, 1.0]], [[-1.401, 0.585, 79.1, 0.893, 2.35, 0.5, 10], [-0.0, -0.0, 1.0]], [[0.386, -0.162, 8.141, 0.775, 0.054, 0.05, 8], [0.058357, -1.106352, 1.0]], [[-1.79, 0.797, 47.159, 1.773, 0.615, 0.5, 8], [0.000479, -8.8e-05, 1.0]], [[-1.724, -0.957, 58.152, 0.412, 2.15, 0.01, 9], [-0.983354, 13.094621, 1.0]], [[0.0, 0.0, 5.0, 1.0, 0.5, 0.1, 3], [0.0, 0.0, 0.0]]], [[[-0.483, -0.784, 27.483, 1.465, 2.895, 0.5, 4], [0.012645, -0.018998, 1.0]], [[-1.031, -0.971, 69.316, 1.698, 1.184, 0.01, 12], [-0.833114, 3.639745, 1.0]], [[-0.078, 1.874, 4.44, 1.689, 0.968, 0.5, 7], [-0.098892, -0.060816, 1.0]], [[-0.969, 1.013, 41.406, 1.249, 0.992, 0.1, 10], [-0.075433, -0.873216, 1.0]], [[0.0, 0.0, 5.0, 1.0, 0.5, 0.1, 3], [0.0, 0.0, 0.0]], [[0.48, 0.698, 50.79, 1.825, 2.065, 0.05, 5], [0.243232, -1.683845, 1.0]], [[1.497, -1.379, 45.786, 1.63, 2.88, 0.1, 2], [0.636403, -4.774961, 1.0]], [[1.552, 0.554, 52.042, 1.485, 2.786, 0.1, 7], [-0.351271, 0.485422, 1.0]]], [[[1.033, -0.399, 54.986, 0.514, 0.653, 0.1, 2], [0.025322, -4.864814, 1.0]], [[0.544, 1.609, 65.688, 1.374, 0.719, 0.01, 10], [0.552951, -1.128422, 1.0]], [[0.0, 0.0, 5.0, 1.0, 0.5, 0.1, 3], [0.0, 0.0, 0.0]], [[-1.018, 0.6, 47.422, 0.649, 0.697, 0.05, 13], [-0.102658, -1.948575, 1.0]], [[1.48, -1.5, 47.647, 0.462, 0.24, 0.5, 7], [-1.4e-05, 2e-05, 1.0]], [[-0.149, -1.14, 86.892, 1.181, 0.035, 0.1, 12], [-0.000609, 0.061827, 1.0]], [[1.452, 1.003, 62.635, 0.47, 0.091, 0.01, 7], [1.023334, -10.790614, 1.0]], [[-0.392, 1.009, 22.203, 0.871, 0.568, 0.1, 12], [-0.074175, -0.141016, 1.0]]]]
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[0.0, 0.0, 1.0][0.0, 0.0, 0.0]Failed
case 1[-1.618428, 6.062195, 1.0][-1.618428, 6.062195, 1.0]Passed
case 2[1.265475, -1.044567, 1.0][1.265475, -1.044567, 1.0]Passed
case 3[-0.002577, -0.011202, 1.0][-0.002577, -0.011202, 1.0]Passed
case 4[-0.014738, 1.136191, 1.0][-0.014738, 1.136191, 1.0]Passed
case 5[0.064229, -0.321773, 1.0][0.064229, -0.321773, 1.0]Passed
case 6[-1.077545, 2.77492, 1.0][-1.077545, 2.77492, 1.0]Passed
case 7[-0.120265, 2.387352, 1.0][-0.120265, 2.387352, 1.0]Passed

SHA-256 / 97bdcea95f52a164cd229ecdfa3412bc41ab272a6a02f5b1c776c8788c5efda3

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:55.761349+00:00.

Case digest / 6fc308e584942dec57f71791b1187407960d98fe5f6b44c59d8e7b94839be96a