{"abstract":"The commanded rotation is the complement of the correct angle.","category":"Solar tracker geometry","checks":7,"contract":"Sun azimuth clockwise from north and elevation in degrees. The horizontal axis points to axis_az; rotation is positive toward azimuth axis_az+90. Sun vector east=cos(el)sin(az), north=cos(el)cos(az), up=sin(el). Rotation = atan2(component along axis_az+90, up). Clamp to +-max_angle (status 'limited', else 'tracking'); sun_el <= 0 returns [0.0, 'night']. Round to 3 decimals.","evaluation_group":"w2-solar_tracker_geometry-horizontal-axis-true-tracking","failed_approach":"asin of the unnormalised perpendicular component ignores the along-axis sun component.","family":"w2-solar_tracker_geometry-horizontal-axis-true-tracking-rotation-angle-function","id":"FA-93356","implementations":{"attempt":{"sha256":"72a2a4cdb7a6e6d6ed7063924ef875496f8583adb1d6fc7418db47568be06d23","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(sun_az, sun_el, axis_az, max_angle):\n    if sun_el <= 0:\n        return [0.0, 'night']\n    az = math.radians(sun_az)\n    el = math.radians(sun_el)\n    e = math.cos(el) * math.sin(az)\n    n = math.cos(el) * math.cos(az)\n    u = math.sin(el)\n    pa = math.radians(axis_az + 90)\n    perp = e * math.sin(pa) + n * math.cos(pa)\n    rot = math.degrees(math.asin(perp))\n    status = 'tracking'\n    if abs(rot) > max_angle:\n        rot = math.copysign(max_angle, rot)\n        status = 'limited'\n    return [round(rot, 3), status]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [30, 10, 180, 55], [-55.0, 'limited']],\n  ['regression: rotation angle function (partial repair)', [315, 75, 20, 45], [-13.65, 'tracking']],\n  ['control 1', [150, 10, 190, 45], [-45.0, 'limited']],\n  ['control 2', [180, 89, 0, 55], [0.0, 'tracking']]],\n [['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [100, 3, 20, 60], [60.0, 'limited']],\n  ['regression: rotation angle function (partial repair)', [200, 10, 190, 55],\n   [44.561, 'tracking']],\n  ['control 1', [60, 0, 20, 45], [0.0, 'night']],\n  ['control 2', [340, 60, 170, 45], [5.725, 'tracking']]],\n [['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [0, 10, 190, 60], [44.561, 'tracking']],\n  ['regression: rotation angle function (partial repair)', [300, 45, 20, 45],\n   [-44.561, 'tracking']],\n  ['control 1', [135, 0, 0, 60], [0.0, 'night']],\n  ['control 2', [60, 20, 170, 55], [-55.0, 'limited']]],\n [['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [45, 10, 20, 45], [45.0, 'limited']],\n  ['regression: rotation angle function (partial repair)', [150, 45, 170, 55],\n   [-18.882, 'tracking']],\n  ['control 1', [90, 20, 0, 60], [60.0, 'limited']],\n  ['control 2', [30, 3, 190, 45], [-45.0, 'limited']]],\n [['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [30, 20, 170, 45], [-45.0, 'limited']],\n  ['regression: rotation angle function (partial repair)', [340, 3, 20, 55], [-55.0, 'limited']],\n  ['control 1', [100, 3, 190, 60], [-60.0, 'limited']],\n  ['control 2', [90, 75, 170, 55], [-14.782, 'tracking']]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"78b87274dc87a07e5d9f69053fb07240cd34c2d4bac4a2674e39a6450c4ac917","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(sun_az, sun_el, axis_az, max_angle):\n    if sun_el <= 0:\n        return [0.0, 'night']\n    az = math.radians(sun_az)\n    el = math.radians(sun_el)\n    e = math.cos(el) * math.sin(az)\n    n = math.cos(el) * math.cos(az)\n    u = math.sin(el)\n    pa = math.radians(axis_az + 90)\n    perp = e * math.sin(pa) + n * math.cos(pa)\n    rot = math.degrees(math.atan2(u, perp))\n    status = 'tracking'\n    if abs(rot) > max_angle:\n        rot = math.copysign(max_angle, rot)\n        status = 'limited'\n    return [round(rot, 3), status]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [30, 10, 180, 55], [-55.0, 'limited']],\n  ['regression: rotation angle function (partial repair)', [315, 75, 20, 45], [-13.65, 'tracking']],\n  ['control 1', [150, 10, 190, 45], [-45.0, 'limited']],\n  ['control 2', [180, 89, 0, 55], [0.0, 'tracking']]],\n [['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [100, 3, 20, 60], [60.0, 'limited']],\n  ['regression: rotation angle function (partial repair)', [200, 10, 190, 55],\n   [44.561, 'tracking']],\n  ['control 1', [60, 0, 20, 45], [0.0, 'night']],\n  ['control 2', [340, 60, 170, 45], [5.725, 'tracking']]],\n [['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [0, 10, 190, 60], [44.561, 'tracking']],\n  ['regression: rotation angle function (partial repair)', [300, 45, 20, 45],\n   [-44.561, 'tracking']],\n  ['control 1', [135, 0, 0, 60], [0.0, 'night']],\n  ['control 2', [60, 20, 170, 55], [-55.0, 'limited']]],\n [['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [45, 10, 20, 45], [45.0, 'limited']],\n  ['regression: rotation angle function (partial repair)', [150, 45, 170, 55],\n   [-18.882, 'tracking']],\n  ['control 1', [90, 20, 0, 60], [60.0, 'limited']],\n  ['control 2', [30, 3, 190, 45], [-45.0, 'limited']]],\n [['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [30, 20, 170, 45], [-45.0, 'limited']],\n  ['regression: rotation angle function (partial repair)', [340, 3, 20, 55], [-55.0, 'limited']],\n  ['control 1', [100, 3, 190, 60], [-60.0, 'limited']],\n  ['control 2', [90, 75, 170, 55], [-14.782, 'tracking']]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"2fe4f4362df9ccdcf425f580e112068acaef8cfbd47cf9a1544918c30012c5d7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(sun_az, sun_el, axis_az, max_angle):\n    if sun_el <= 0:\n        return [0.0, 'night']\n    az = math.radians(sun_az)\n    el = math.radians(sun_el)\n    e = math.cos(el) * math.sin(az)\n    n = math.cos(el) * math.cos(az)\n    u = math.sin(el)\n    pa = math.radians(axis_az + 90)\n    perp = e * math.sin(pa) + n * math.cos(pa)\n    rot = math.degrees(math.atan2(perp, u))\n    status = 'tracking'\n    if abs(rot) > max_angle:\n        rot = math.copysign(max_angle, rot)\n        status = 'limited'\n    return [round(rot, 3), status]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [30, 10, 180, 55], [-55.0, 'limited']],\n  ['regression: rotation angle function (partial repair)', [315, 75, 20, 45], [-13.65, 'tracking']],\n  ['control 1', [150, 10, 190, 45], [-45.0, 'limited']],\n  ['control 2', [180, 89, 0, 55], [0.0, 'tracking']]],\n [['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [100, 3, 20, 60], [60.0, 'limited']],\n  ['regression: rotation angle function (partial repair)', [200, 10, 190, 55],\n   [44.561, 'tracking']],\n  ['control 1', [60, 0, 20, 45], [0.0, 'night']],\n  ['control 2', [340, 60, 170, 45], [5.725, 'tracking']]],\n [['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [0, 10, 190, 60], [44.561, 'tracking']],\n  ['regression: rotation angle function (partial repair)', [300, 45, 20, 45],\n   [-44.561, 'tracking']],\n  ['control 1', [135, 0, 0, 60], [0.0, 'night']],\n  ['control 2', [60, 20, 170, 55], [-55.0, 'limited']]],\n [['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [45, 10, 20, 45], [45.0, 'limited']],\n  ['regression: rotation angle function (partial repair)', [150, 45, 170, 55],\n   [-18.882, 'tracking']],\n  ['control 1', [90, 20, 0, 60], [60.0, 'limited']],\n  ['control 2', [30, 3, 190, 45], [-45.0, 'limited']]],\n [['boundary: sun on the horizon', [90, 0, 180, 60], [0.0, 'night']],\n  ['normal: solar noon on N-S axis', [180, 60, 180, 60], [0.0, 'tracking']],\n  ['boundary: low morning sun hits east limit', [90, 10, 180, 60], [-60.0, 'limited']],\n  ['regression: rotation angle function', [30, 20, 170, 45], [-45.0, 'limited']],\n  ['regression: rotation angle function (partial repair)', [340, 3, 20, 55], [-55.0, 'limited']],\n  ['control 1', [100, 3, 190, 60], [-60.0, 'limited']],\n  ['control 2', [90, 75, 170, 55], [-14.782, 'tracking']]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"Deterministic stipulated toy contract for teaching; no claim of conformance with any standard, vendor protocol or production controller. 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-solar_tracker_geometry-horizontal-axis-true-tracking-rotation-angle-function","generated_at":"2026-09-29T14:51:54.349919+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Single-axis and dual-axis solar trackers turn a sun direction into actuator commands; a sign, frame or limit mistake points a whole plant away from the sun or into a mechanical stop.","repair":"Use atan2(perpendicular, up).","root_cause":"atan2 receives the vertical component first.","sha256":"dd3ebacd22b90b1d533e157ddea73daa8e585c7a5880e5e2906a7bad08c5ae61","title":"Horizontal single-axis true tracking: rotation angle function · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.031,"exit_code":1,"observations":[{"actual":[0.0,"night"],"check":"boundary: sun on the horizon","expected":[0.0,"night"],"passed":true},{"actual":[0.0,"tracking"],"check":"normal: solar noon on N-S axis","expected":[0.0,"tracking"],"passed":true},{"actual":[-60.0,"limited"],"check":"boundary: low morning sun hits east limit","expected":[-60.0,"limited"],"passed":true},{"actual":[-29.499,"tracking"],"check":"regression: rotation angle function","expected":[-55.0,"limited"],"passed":false},{"actual":[-13.566,"tracking"],"check":"regression: rotation angle function (partial repair)","expected":[-13.65,"tracking"],"passed":false},{"actual":[-39.273,"tracking"],"check":"control 1","expected":[-45.0,"limited"],"passed":false},{"actual":[0.0,"tracking"],"check":"control 2","expected":[0.0,"tracking"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary: sun on the horizon\", \"actual\": [0.0, \"night\"], \"expected\": [0.0, \"night\"], \"passed\": true}, {\"check\": \"normal: solar noon on N-S axis\", \"actual\": [0.0, \"tracking\"], \"expected\": [0.0, \"tracking\"], \"passed\": true}, {\"check\": \"boundary: low morning sun hits east limit\", \"actual\": [-60.0, \"limited\"], \"expected\": [-60.0, \"limited\"], \"passed\": true}, {\"check\": \"regression: rotation angle function\", \"actual\": [-29.499, \"tracking\"], \"expected\": [-55.0, \"limited\"], \"passed\": false}, {\"check\": \"regression: rotation angle function (partial repair)\", \"actual\": [-13.566, \"tracking\"], \"expected\": [-13.65, \"tracking\"], \"passed\": false}, {\"check\": \"control 1\", \"actual\": [-39.273, \"tracking\"], \"expected\": [-45.0, \"limited\"], \"passed\": false}, {\"check\": \"control 2\", \"actual\": [0.0, \"tracking\"], \"expected\": [0.0, \"tracking\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.438,"exit_code":1,"observations":[{"actual":[0.0,"night"],"check":"boundary: sun on the horizon","expected":[0.0,"night"],"passed":true},{"actual":[60.0,"limited"],"check":"normal: solar noon on N-S axis","expected":[0.0,"tracking"],"passed":false},{"actual":[60.0,"limited"],"check":"boundary: low morning sun hits east limit","expected":[-60.0,"limited"],"passed":false},{"actual":[55.0,"limited"],"check":"regression: rotation angle function","expected":[-55.0,"limited"],"passed":false},{"actual":[45.0,"limited"],"check":"regression: rotation angle function (partial repair)","expected":[-13.65,"tracking"],"passed":false},{"actual":[45.0,"limited"],"check":"control 1","expected":[-45.0,"limited"],"passed":false},{"actual":[55.0,"limited"],"check":"control 2","expected":[0.0,"tracking"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary: sun on the horizon\", \"actual\": [0.0, \"night\"], \"expected\": [0.0, \"night\"], \"passed\": true}, {\"check\": \"normal: solar noon on N-S axis\", \"actual\": [60.0, \"limited\"], \"expected\": [0.0, \"tracking\"], \"passed\": false}, {\"check\": \"boundary: low morning sun hits east limit\", \"actual\": [60.0, \"limited\"], \"expected\": [-60.0, \"limited\"], \"passed\": false}, {\"check\": \"regression: rotation angle function\", \"actual\": [55.0, \"limited\"], \"expected\": [-55.0, \"limited\"], \"passed\": false}, {\"check\": \"regression: rotation angle function (partial repair)\", \"actual\": [45.0, \"limited\"], \"expected\": [-13.65, \"tracking\"], \"passed\": false}, {\"check\": \"control 1\", \"actual\": [45.0, \"limited\"], \"expected\": [-45.0, \"limited\"], \"passed\": false}, {\"check\": \"control 2\", \"actual\": [55.0, \"limited\"], \"expected\": [0.0, \"tracking\"], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.877,"exit_code":0,"observations":[{"actual":[0.0,"night"],"check":"boundary: sun on the horizon","expected":[0.0,"night"],"passed":true},{"actual":[0.0,"tracking"],"check":"normal: solar noon on N-S axis","expected":[0.0,"tracking"],"passed":true},{"actual":[-60.0,"limited"],"check":"boundary: low morning sun hits east limit","expected":[-60.0,"limited"],"passed":true},{"actual":[-55.0,"limited"],"check":"regression: rotation angle function","expected":[-55.0,"limited"],"passed":true},{"actual":[-13.65,"tracking"],"check":"regression: rotation angle function (partial repair)","expected":[-13.65,"tracking"],"passed":true},{"actual":[-45.0,"limited"],"check":"control 1","expected":[-45.0,"limited"],"passed":true},{"actual":[0.0,"tracking"],"check":"control 2","expected":[0.0,"tracking"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary: sun on the horizon\", \"actual\": [0.0, \"night\"], \"expected\": [0.0, \"night\"], \"passed\": true}, {\"check\": \"normal: solar noon on N-S axis\", \"actual\": [0.0, \"tracking\"], \"expected\": [0.0, \"tracking\"], \"passed\": true}, {\"check\": \"boundary: low morning sun hits east limit\", \"actual\": [-60.0, \"limited\"], \"expected\": [-60.0, \"limited\"], \"passed\": true}, {\"check\": \"regression: rotation angle function\", \"actual\": [-55.0, \"limited\"], \"expected\": [-55.0, \"limited\"], \"passed\": true}, {\"check\": \"regression: rotation angle function (partial repair)\", \"actual\": [-13.65, \"tracking\"], \"expected\": [-13.65, \"tracking\"], \"passed\": true}, {\"check\": \"control 1\", \"actual\": [-45.0, \"limited\"], \"expected\": [-45.0, \"limited\"], \"passed\": true}, {\"check\": \"control 2\", \"actual\": [0.0, \"tracking\"], \"expected\": [0.0, \"tracking\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}