FAILURE MAP
← Case archive

FA-93511 / Solar tracker geometry / Open access

Heliostat mirror normal aiming: sun vector components · case 01

Mirrors aim as if the sun were mirrored about the north-east diagonal.

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

ROOT CAUSE

The sun vector is built with azimuth measured from east.

VERIFIED REPAIR

Use east=cos(el)sin(az), north=cos(el)cos(az).

Unsuccessful approach: Dropping the cos(el) factor makes the sun vector non-unit.

Case contract

mirror and receiver are [east, north, up] positions in metres. The mirror normal bisects the unit sun vector (east=cos(el)sin(az), north=cos(el)cos(az), up=sin(el)) and the unit vector from the mirror to the receiver. Return [normal azimuth 0..360 clockwise from north, normal elevation], rounded to 3; None when sun_el <= 0; 'invalid' when receiver equals mirror.

Why this case matters

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.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(sun_az, sun_el, mirror, receiver):
    if sun_el <= 0:
        return None
    dx = [receiver[i] - mirror[i] for i in range(3)]
    d = math.sqrt(sum(v * v for v in dx))
    if d == 0:
        return 'invalid'
    t = [v / d for v in dx]
    az = math.radians(sun_az)
    el = math.radians(sun_el)
    s = [math.cos(el) * math.cos(az), math.cos(el) * math.sin(az), math.sin(el)]
    h = [s[i] + t[i] for i in range(3)]
    m = math.sqrt(sum(v * v for v in h))
    h = [v / m for v in h]
    n_az = math.degrees(math.atan2(h[0], h[1])) % 360
    n_el = math.degrees(math.asin(h[2]))
    return [round(n_az, 3), round(n_el, 3)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [270, 60, [6, -1, 1], [0, 5, 0]], [300.29, 28.278]],
  ['regression: sun vector components (partial repair)', [270, 80, [-16, -19, 1], [0, 0, 0]],
   [31.588, 46.473]],
  ['control 1', [90, -3, [-12, 43, 1], [0, 0, 0]], None],
  ['control 2', [200, 60, [-10, 12, 0], [0, 0, 60]], [180.839, 70.11]]],
 [['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [315, 25, [47, -28, 0], [0, 0, 60]], [308.943, 36.527]],
  ['regression: sun vector components (partial repair)', [90, 25, [-19, 40, 2], [-10, 5, 60]],
   [116.262, 47.684]],
  ['control 1', [135, 60, [31, 24, 2], [10, 0, 60]], [177.1, 67.63]],
  ['control 2', [225, -3, [-22, -29, 0], [0, 5, 30]], None]],
 [['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [60, 40, [7, -5, 0], [0, 0, 60]], [49.649, 66.233]],
  ['regression: sun vector components (partial repair)', [315, 10, [-37, 26, 0], [0, -5, 60]],
   [323.691, 69.061]],
  ['control 1', [90, 10, [-6, -40, 0], [-10, 0, 30]], [48.617, 32.61]],
  ['control 2', [30, 10, [-44, 5, 1], [-10, 0, 0]], [64.473, 5.033]]],
 [['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [315, 60, [-28, -33, 2], [-10, 5, 60]], [353.399, 62.028]],
  ['regression: sun vector components (partial repair)', [200, 80, [9, 42, 3], [-10, 0, 30]],
   [203.614, 55.19]],
  ['control 1', [150, 40, [16, -12, 0], [0, 0, 0]], [261.353, 56.729]],
  ['control 2', [90, 0, [46, -4, 0], [0, -5, 0]], None]],
 [['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [200, 10, [41, -47, 2], [0, 0, 30]], [255.744, 31.113]],
  ['regression: sun vector components (partial repair)', [225, 40, [-5, 13, 2], [-10, -5, 30]],
   [212.668, 49.07]],
  ['control 1', [250, -3, [-49, 36, 3], [-10, 5, 60]], None],
  ['control 2', [300, 80, [-27, -17, 1], [-10, 0, 60]], [18.225, 78.974]]]]
for label, args, expected in fixtures[N-1]:
    check(label, 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
boundary: receiver at mirrorinvalidinvalidPassed
normal: receiver due north on tower[312.709, 52.321][180.0, 87.5]Failed
boundary: nightNoneNonePassed
regression: sun vector components[286.066, 45.704][300.29, 28.278]Failed
regression: sun vector components (partial repair)[47.457, 47.237][31.588, 46.473]Failed
control 1NoneNonePassed
control 2[220.244, 75.402][180.839, 70.11]Failed

SHA-256 / 9280dcdcf47dc6b27209a56366d90fe9c2f1e5adf116d7ec3d5838b41ff44073

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(sun_az, sun_el, mirror, receiver):
    if sun_el <= 0:
        return None
    dx = [receiver[i] - mirror[i] for i in range(3)]
    d = math.sqrt(sum(v * v for v in dx))
    if d == 0:
        return 'invalid'
    t = [v / d for v in dx]
    az = math.radians(sun_az)
    el = math.radians(sun_el)
    s = [math.sin(az), math.cos(az), math.sin(el)]
    h = [s[i] + t[i] for i in range(3)]
    m = math.sqrt(sum(v * v for v in h))
    h = [v / m for v in h]
    n_az = math.degrees(math.atan2(h[0], h[1])) % 360
    n_el = math.degrees(math.asin(h[2]))
    return [round(n_az, 3), round(n_el, 3)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [270, 60, [6, -1, 1], [0, 5, 0]], [300.29, 28.278]],
  ['regression: sun vector components (partial repair)', [270, 80, [-16, -19, 1], [0, 0, 0]],
   [31.588, 46.473]],
  ['control 1', [90, -3, [-12, 43, 1], [0, 0, 0]], None],
  ['control 2', [200, 60, [-10, 12, 0], [0, 0, 60]], [180.839, 70.11]]],
 [['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [315, 25, [47, -28, 0], [0, 0, 60]], [308.943, 36.527]],
  ['regression: sun vector components (partial repair)', [90, 25, [-19, 40, 2], [-10, 5, 60]],
   [116.262, 47.684]],
  ['control 1', [135, 60, [31, 24, 2], [10, 0, 60]], [177.1, 67.63]],
  ['control 2', [225, -3, [-22, -29, 0], [0, 5, 30]], None]],
 [['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [60, 40, [7, -5, 0], [0, 0, 60]], [49.649, 66.233]],
  ['regression: sun vector components (partial repair)', [315, 10, [-37, 26, 0], [0, -5, 60]],
   [323.691, 69.061]],
  ['control 1', [90, 10, [-6, -40, 0], [-10, 0, 30]], [48.617, 32.61]],
  ['control 2', [30, 10, [-44, 5, 1], [-10, 0, 0]], [64.473, 5.033]]],
 [['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [315, 60, [-28, -33, 2], [-10, 5, 60]], [353.399, 62.028]],
  ['regression: sun vector components (partial repair)', [200, 80, [9, 42, 3], [-10, 0, 30]],
   [203.614, 55.19]],
  ['control 1', [150, 40, [16, -12, 0], [0, 0, 0]], [261.353, 56.729]],
  ['control 2', [90, 0, [46, -4, 0], [0, -5, 0]], None]],
 [['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [200, 10, [41, -47, 2], [0, 0, 30]], [255.744, 31.113]],
  ['regression: sun vector components (partial repair)', [225, 40, [-5, 13, 2], [-10, -5, 30]],
   [212.668, 49.07]],
  ['control 1', [250, -3, [-49, 36, 3], [-10, 5, 60]], None],
  ['control 2', [300, 80, [-27, -17, 1], [-10, 0, 60]], [18.225, 78.974]]]]
for label, args, expected in fixtures[N-1]:
    check(label, 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
boundary: receiver at mirrorinvalidinvalidPassed
normal: receiver due north on tower[180.0, 77.758][180.0, 87.5]Failed
boundary: nightNoneNonePassed
regression: sun vector components[292.418, 22.134][300.29, 28.278]Failed
regression: sun vector components (partial repair)[335.001, 48.242][31.588, 46.473]Failed
control 1NoneNonePassed
control 2[189.061, 57.962][180.839, 70.11]Failed

SHA-256 / 378bb088800e68f5ce70b899cef094073fc0c75bfd6b1ef021ec71b818169bd0

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(sun_az, sun_el, mirror, receiver):
    if sun_el <= 0:
        return None
    dx = [receiver[i] - mirror[i] for i in range(3)]
    d = math.sqrt(sum(v * v for v in dx))
    if d == 0:
        return 'invalid'
    t = [v / d for v in dx]
    az = math.radians(sun_az)
    el = math.radians(sun_el)
    s = [math.cos(el) * math.sin(az), math.cos(el) * math.cos(az), math.sin(el)]
    h = [s[i] + t[i] for i in range(3)]
    m = math.sqrt(sum(v * v for v in h))
    h = [v / m for v in h]
    n_az = math.degrees(math.atan2(h[0], h[1])) % 360
    n_el = math.degrees(math.asin(h[2]))
    return [round(n_az, 3), round(n_el, 3)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [270, 60, [6, -1, 1], [0, 5, 0]], [300.29, 28.278]],
  ['regression: sun vector components (partial repair)', [270, 80, [-16, -19, 1], [0, 0, 0]],
   [31.588, 46.473]],
  ['control 1', [90, -3, [-12, 43, 1], [0, 0, 0]], None],
  ['control 2', [200, 60, [-10, 12, 0], [0, 0, 60]], [180.839, 70.11]]],
 [['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [315, 25, [47, -28, 0], [0, 0, 60]], [308.943, 36.527]],
  ['regression: sun vector components (partial repair)', [90, 25, [-19, 40, 2], [-10, 5, 60]],
   [116.262, 47.684]],
  ['control 1', [135, 60, [31, 24, 2], [10, 0, 60]], [177.1, 67.63]],
  ['control 2', [225, -3, [-22, -29, 0], [0, 5, 30]], None]],
 [['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [60, 40, [7, -5, 0], [0, 0, 60]], [49.649, 66.233]],
  ['regression: sun vector components (partial repair)', [315, 10, [-37, 26, 0], [0, -5, 60]],
   [323.691, 69.061]],
  ['control 1', [90, 10, [-6, -40, 0], [-10, 0, 30]], [48.617, 32.61]],
  ['control 2', [30, 10, [-44, 5, 1], [-10, 0, 0]], [64.473, 5.033]]],
 [['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [315, 60, [-28, -33, 2], [-10, 5, 60]], [353.399, 62.028]],
  ['regression: sun vector components (partial repair)', [200, 80, [9, 42, 3], [-10, 0, 30]],
   [203.614, 55.19]],
  ['control 1', [150, 40, [16, -12, 0], [0, 0, 0]], [261.353, 56.729]],
  ['control 2', [90, 0, [46, -4, 0], [0, -5, 0]], None]],
 [['boundary: receiver at mirror', [180, 40, [0, 0, 0], [0, 0, 0]], 'invalid'],
  ['normal: receiver due north on tower', [180, 40, [0, -40, 0], [0, 0, 40]], [180.0, 87.5]],
  ['boundary: night', [90, 0, [10, 10, 0], [0, 0, 50]], None],
  ['regression: sun vector components', [200, 10, [41, -47, 2], [0, 0, 30]], [255.744, 31.113]],
  ['regression: sun vector components (partial repair)', [225, 40, [-5, 13, 2], [-10, -5, 30]],
   [212.668, 49.07]],
  ['control 1', [250, -3, [-49, 36, 3], [-10, 5, 60]], None],
  ['control 2', [300, 80, [-27, -17, 1], [-10, 0, 60]], [18.225, 78.974]]]]
for label, args, expected in fixtures[N-1]:
    check(label, 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
boundary: receiver at mirrorinvalidinvalidPassed
normal: receiver due north on tower[180.0, 87.5][180.0, 87.5]Passed
boundary: nightNoneNonePassed
regression: sun vector components[300.29, 28.278][300.29, 28.278]Passed
regression: sun vector components (partial repair)[31.588, 46.473][31.588, 46.473]Passed
control 1NoneNonePassed
control 2[180.839, 70.11][180.839, 70.11]Passed

SHA-256 / 8a6a146980872473893733b5897057bf10ed1243d31832fac4dc204e9566ff5c

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:51:55.763455+00:00.

Case digest / cad275725f1c2e25b31316b718a325fa2314142cf4ac50f22230d28c63083108