# No. 319 (Brown 1868): "Compensation balance. t, a, t', is the main bar of balance, with timing screws for regulation at the ends. t and t' are two compound bars, of which the outside is brass and the inside steel, carrying weights, b, b'. As heat increases, these bars are bent inward by the greater expansion of the brass, and the weights are thus drawn inward, diminishing the inertia of the balance. As the heat diminishes, an opposite effect is produced. This balance compensates both for its own expansion and contraction, and that of the balance-spring."
#
# Model (cm, a plan of the watch: gravity off). The watch is No. 314's lever chronometer escapement, with its plain balance changed for a
# compensation balance of the same size: the main bar t a t' (steel) with a timing screw at each end, and from each end a compound bar
# (160 degrees round, 0.3 thick, brass outside and steel inside, free at its far end) carrying a weight b, b' 109.0 degrees from its root.
# Heat is not simulated: the weights' place is the one that compensates. Warmed a degree, each bar's curvature grows by 1.5 (19 - 11.5)e-6 / 0.3
# per cm, drawing a point psi along it in by 0.000408 (1 - cos psi) cm; that takes 0.000228 off the balance's inertia (relative), which pays for its
# own expansion (+2.3e-05) and for the spring's loss of stiffness (0.000206), so the period stays put. Only the escape-wheel is driven (the
# mainspring); the balance is let go 2 rad from rest. Generator: opencode-runs/batch12/gen319.py.
number: 319
slug: compensation-balance
name: Compensation balance
brown: "Compensation balance. t, a, t', is the main bar of balance, with timing screws for regulation at the ends. t and t' are two compound bars, of which the outside is brass and the inside steel, carrying weights, b, b'. As heat increases, these bars are bent inward by the greater expansion of the brass, and the weights are thus drawn inward, diminishing the inertia of the balance. As the heat diminishes, an opposite effect is produced. This balance compensates both for its own expansion and contraction, and that of the balance-spring."
units: cm
sim: {timestep: 0.0001, integrator: implicitfast, iterations: 50, duration_s: 12, floor: false, gravity: 0}
bodies:
  - id: wheel
    shape: part
    pos: [0, 0, 0]
    mass: 0.003
    friction: 0.1
    color: "#e6d7b0"
    pieces:
      - {kind: disc, center: [0, 0], radius: 2.12, inner: 1.7, y: [-0.15, 0.15]}   # the rim
      - {kind: disc, center: [0, 0], radius: 0.5, y: [-0.15, 0.15]}   # the hub
      - {kind: poly, points: [[0.45962, 0.10607], [1.37886, 1.0253], [1.0253, 1.37886], [0.10607, 0.45962]], y: [-0.15, 0.15]}   # a spoke
      - {kind: poly, points: [[-0.10607, 0.45962], [-1.0253, 1.37886], [-1.37886, 1.0253], [-0.45962, 0.10607]], y: [-0.15, 0.15]}   # a spoke
      - {kind: poly, points: [[-0.45962, -0.10607], [-1.37886, -1.0253], [-1.0253, -1.37886], [-0.10607, -0.45962]], y: [-0.15, 0.15]}   # a spoke
      - {kind: poly, points: [[0.10607, -0.45962], [1.0253, -1.37886], [1.37886, -1.0253], [0.45962, -0.10607]], y: [-0.15, 0.15]}   # a spoke
      - {kind: disc, center: [0, 0], radius: 0.2, y: [-0.6, 0.6], color: "#8f8a80"}   # its arbor
      - {kind: poly, points: [[-1.56973, 2.55655], [-1.43221, 1.53583], [-1.64462, 1.30585], [-1.59167, 2.4002]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-2.47386, 1.69706], [-1.93307, 0.82052], [-2.03357, 0.52402], [-2.43032, 1.5453]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-2.95024, 0.54413], [-2.09968, -0.03666], [-2.0709, -0.34841], [-2.84874, 0.42321]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-2.9165, -0.70288], [-1.90324, -0.88751], [-1.75015, -1.1606], [-2.77458, -0.77207]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-2.37847, -1.82836], [-1.37771, -1.5849], [-1.12678, -1.77211], [-2.22068, -1.83384]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-1.42917, -2.6377], [-0.61397, -2.00824], [-0.30859, -2.0772], [-1.2828, -2.57853]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-0.23277, -2.99096], [0.25594, -2.08435], [0.56297, -2.02313], [-0.12311, -2.87737]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[1.00389, -2.82705], [1.08159, -1.80004], [1.33718, -1.61925], [1.05786, -2.67868]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[2.06696, -2.17432], [1.72023, -1.2045], [1.88018, -0.93537], [2.05592, -2.01683]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[2.77264, -1.14563], [2.06142, -0.40069], [2.09808, -0.08977], [2.6985, -1.00624]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[2.9989, 0.08115], [2.04617, 0.47241], [1.9532, 0.77136], [2.87447, 0.17833]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[2.70663, 1.2939], [1.67713, 1.26382], [1.4706, 1.49911], [2.55343, 1.33206]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[1.94635, 2.28292], [1.01809, 1.83671], [0.73372, 1.96765], [1.79087, 2.25548]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[0.84954, 2.8772], [0.18301, 2.09201], [-0.13003, 2.09597], [0.71866, 2.78889]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-0.39417, 2.97399], [-0.6837, 1.98558], [-0.9713, 1.86188], [-0.47782, 2.84009]], y: [-0.15, 0.15], collide: 2}   # a tooth
  - id: anchor
    shape: part
    pos: [0, 0, 3.4641]
    mass: 0.004
    friction: 0.1
    color: "#9aa3ad"
    pieces:
      - {kind: disc, center: [0, 3.4641], radius: 0.35, y: [-0.5, 0.5], color: "#8f8a80"}   # the anchor's arbor B
      - {kind: poly, points: [[0.03264, 3.32796], [-1.65549, 2.92321], [-1.72077, 3.19549], [-0.03264, 3.60024]], y: [-0.25, -0.05]}   # an arm of the anchor
      - {kind: poly, points: [[0.02941, 3.60098], [2.32086, 3.10858], [2.26204, 2.83483], [-0.02941, 3.32723]], y: [-0.25, -0.05]}   # an arm of the anchor
      - {kind: poly, points: [[-1.4785, 2.4365], [-1.37082, 2.49867], [-1.68346, 3.06854], [-1.6928, 3.05016]], y: [-0.15, 0.15], collide: 1, color: "#b85c38"}   # the entry pallet
      - {kind: poly, points: [[1.83549, 2.49848], [1.94201, 2.43434], [2.28937, 2.98374], [2.29353, 2.95968]], y: [-0.15, 0.15], collide: 1, color: "#b85c38"}   # the exit pallet
      - {kind: poly, points: [[0.30484, 3.35698], [0.14687, 3.1763], [2.77338, 0.87992], [2.93135, 1.0606]], y: [0.2, 0.4]}   # the lever E C
      - {kind: poly, points: [[2.93032, 1.28731], [2.54856, 0.85067], [2.66149, 0.75194], [3.04325, 1.18858]], y: [0.2, 0.4]}   # the notch's bottom
      - {kind: poly, points: [[3.04325, 1.18858], [2.92477, 1.05307], [3.13811, 0.86655], [3.25659, 1.00206]], y: [0.2, 0.4], collide: 1}   # the notch E: a horn
      - {kind: poly, points: [[2.77996, 0.88745], [2.66149, 0.75194], [2.87483, 0.56541], [2.99331, 0.70092]], y: [0.2, 0.4], collide: 1}   # the notch E: a horn
  - id: balance
    shape: part
    pos: [4.36824, 0, -0.8491]
    mass: 0.1
    friction: 0.1
    color: "#d9c49a"
    pieces:
      - {kind: poly, points: [[0.91824, -0.9891], [7.81824, -0.9891], [7.81824, -0.7091], [0.91824, -0.7091]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # the main bar t a t' (steel)
      - {kind: rod, from: [7.76824, 1.0, -0.8491], to: [8.16824, 1.0, -0.8491], radius: 0.1, density: 8500, color: "#c9a54e"}   # a timing screw
      - {kind: rod, from: [0.96824, 1.0, -0.8491], to: [0.56824, 1.0, -0.8491], radius: 0.1, density: 8500, color: "#c9a54e"}   # a timing screw
      - {kind: poly, points: [[7.66824, -0.8491], [7.81824, -0.8491], [7.78466, -0.36895], [7.63612, -0.38983]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[7.51824, -0.8491], [7.66824, -0.8491], [7.63612, -0.38983], [7.48758, -0.4107]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[7.63612, -0.38983], [7.78466, -0.36895], [7.68459, 0.10185], [7.5404, 0.0605]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[7.48758, -0.4107], [7.63612, -0.38983], [7.5404, 0.0605], [7.39621, 0.01916]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[7.5404, 0.0605], [7.68459, 0.10185], [7.51997, 0.55414], [7.38294, 0.49313]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[7.39621, 0.01916], [7.5404, 0.0605], [7.38294, 0.49313], [7.24591, 0.43212]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[7.38294, 0.49313], [7.51997, 0.55414], [7.29401, 0.97912], [7.1668, 0.89963]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[7.24591, 0.43212], [7.38294, 0.49313], [7.1668, 0.89963], [7.03959, 0.82015]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[7.1668, 0.89963], [7.29401, 0.97912], [7.01109, 1.36852], [6.89619, 1.2721]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[7.03959, 0.82015], [7.1668, 0.89963], [6.89619, 1.2721], [6.78128, 1.17568]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[6.89619, 1.2721], [7.01109, 1.36852], [6.67674, 1.71475], [6.57637, 1.60328]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[6.78128, 1.17568], [6.89619, 1.2721], [6.57637, 1.60328], [6.476, 1.49181]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[6.57637, 1.60328], [6.67674, 1.71475], [6.29746, 2.01108], [6.21358, 1.88672]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[6.476, 1.49181], [6.57637, 1.60328], [6.21358, 1.88672], [6.1297, 1.76237]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[6.21358, 1.88672], [6.29746, 2.01108], [5.88062, 2.25174], [5.81486, 2.11692]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[6.1297, 1.76237], [6.21358, 1.88672], [5.81486, 2.11692], [5.74911, 1.9821]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[5.81486, 2.11692], [5.88062, 2.25174], [5.43435, 2.43204], [5.388, 2.28939]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[5.74911, 1.9821], [5.81486, 2.11692], [5.388, 2.28939], [5.34164, 2.14673]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[5.388, 2.28939], [5.43435, 2.43204], [4.96733, 2.54849], [4.94128, 2.40077]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[5.34164, 2.14673], [5.388, 2.28939], [4.94128, 2.40077], [4.91523, 2.25304]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[4.94128, 2.40077], [4.96733, 2.54849], [4.48864, 2.5988], [4.48341, 2.44889]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[4.91523, 2.25304], [4.94128, 2.40077], [4.48341, 2.44889], [4.47817, 2.29898]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[4.48341, 2.44889], [4.48864, 2.5988], [4.00762, 2.582], [4.0233, 2.43282]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[4.47817, 2.29898], [4.48341, 2.44889], [4.0233, 2.43282], [4.03898, 2.28364]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[4.0233, 2.43282], [4.00762, 2.582], [3.53361, 2.49842], [3.5699, 2.35288]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[4.03898, 2.28364], [4.0233, 2.43282], [3.5699, 2.35288], [3.60619, 2.20733]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[3.5699, 2.35288], [3.53361, 2.49842], [3.07585, 2.34968], [3.13204, 2.21061]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[3.60619, 2.20733], [3.5699, 2.35288], [3.13204, 2.21061], [3.18823, 2.07153]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[3.13204, 2.21061], [3.07585, 2.34968], [2.64324, 2.13869], [2.71824, 2.00878]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[3.18823, 2.07153], [3.13204, 2.21061], [2.71824, 2.00878], [2.79324, 1.87888]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[2.71824, 2.00878], [2.64324, 2.13869], [2.24421, 1.86954], [2.33656, 1.75134]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[2.79324, 1.87888], [2.71824, 2.00878], [2.33656, 1.75134], [2.42891, 1.63313]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[2.33656, 1.75134], [2.24421, 1.86954], [1.88652, 1.54747], [1.99442, 1.44327]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[2.42891, 1.63313], [2.33656, 1.75134], [1.99442, 1.44327], [2.10232, 1.33907]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[1.99442, 1.44327], [1.88652, 1.54747], [1.57713, 1.17876], [1.69848, 1.09059]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[2.10232, 1.33907], [1.99442, 1.44327], [1.69848, 1.09059], [1.81984, 1.00242]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[1.69848, 1.09059], [1.57713, 1.17876], [1.32207, 0.77058], [1.45451, 0.70016]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[1.81984, 1.00242], [1.69848, 1.09059], [1.45451, 0.70016], [1.58696, 0.62974]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[1.45451, 0.70016], [1.32207, 0.77058], [1.1263, 0.33087], [1.26725, 0.27957]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t: brass (outside)
      - {kind: poly, points: [[1.58696, 0.62974], [1.45451, 0.70016], [1.26725, 0.27957], [1.40821, 0.22826]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[1.06824, -0.8491], [0.91824, -0.8491], [0.95182, -1.32925], [1.10036, -1.30837]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[1.21824, -0.8491], [1.06824, -0.8491], [1.10036, -1.30837], [1.2489, -1.2875]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[1.10036, -1.30837], [0.95182, -1.32925], [1.05189, -1.80005], [1.19608, -1.7587]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[1.2489, -1.2875], [1.10036, -1.30837], [1.19608, -1.7587], [1.34027, -1.71736]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[1.19608, -1.7587], [1.05189, -1.80005], [1.21651, -2.25234], [1.35354, -2.19133]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[1.34027, -1.71736], [1.19608, -1.7587], [1.35354, -2.19133], [1.49057, -2.13032]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[1.35354, -2.19133], [1.21651, -2.25234], [1.44247, -2.67732], [1.56968, -2.59783]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[1.49057, -2.13032], [1.35354, -2.19133], [1.56968, -2.59783], [1.69689, -2.51835]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[1.56968, -2.59783], [1.44247, -2.67732], [1.72539, -3.06672], [1.84029, -2.9703]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[1.69689, -2.51835], [1.56968, -2.59783], [1.84029, -2.9703], [1.9552, -2.87388]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[1.84029, -2.9703], [1.72539, -3.06672], [2.05974, -3.41295], [2.16011, -3.30148]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[1.9552, -2.87388], [1.84029, -2.9703], [2.16011, -3.30148], [2.26048, -3.19001]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[2.16011, -3.30148], [2.05974, -3.41295], [2.43902, -3.70928], [2.5229, -3.58492]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[2.26048, -3.19001], [2.16011, -3.30148], [2.5229, -3.58492], [2.60678, -3.46057]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[2.5229, -3.58492], [2.43902, -3.70928], [2.85586, -3.94994], [2.92162, -3.81512]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[2.60678, -3.46057], [2.5229, -3.58492], [2.92162, -3.81512], [2.98737, -3.6803]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[2.92162, -3.81512], [2.85586, -3.94994], [3.30213, -4.13024], [3.34848, -3.98759]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[2.98737, -3.6803], [2.92162, -3.81512], [3.34848, -3.98759], [3.39484, -3.84493]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[3.34848, -3.98759], [3.30213, -4.13024], [3.76915, -4.24669], [3.7952, -4.09897]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[3.39484, -3.84493], [3.34848, -3.98759], [3.7952, -4.09897], [3.82125, -3.95124]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[3.7952, -4.09897], [3.76915, -4.24669], [4.24784, -4.297], [4.25307, -4.14709]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[3.82125, -3.95124], [3.7952, -4.09897], [4.25307, -4.14709], [4.25831, -3.99718]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[4.25307, -4.14709], [4.24784, -4.297], [4.72886, -4.2802], [4.71318, -4.13102]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[4.25831, -3.99718], [4.25307, -4.14709], [4.71318, -4.13102], [4.6975, -3.98184]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[4.71318, -4.13102], [4.72886, -4.2802], [5.20287, -4.19662], [5.16658, -4.05108]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[4.6975, -3.98184], [4.71318, -4.13102], [5.16658, -4.05108], [5.13029, -3.90553]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[5.16658, -4.05108], [5.20287, -4.19662], [5.66063, -4.04788], [5.60444, -3.90881]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[5.13029, -3.90553], [5.16658, -4.05108], [5.60444, -3.90881], [5.54825, -3.76973]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[5.60444, -3.90881], [5.66063, -4.04788], [6.09324, -3.83689], [6.01824, -3.70698]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[5.54825, -3.76973], [5.60444, -3.90881], [6.01824, -3.70698], [5.94324, -3.57708]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[6.01824, -3.70698], [6.09324, -3.83689], [6.49227, -3.56774], [6.39992, -3.44954]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[5.94324, -3.57708], [6.01824, -3.70698], [6.39992, -3.44954], [6.30757, -3.33133]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[6.39992, -3.44954], [6.49227, -3.56774], [6.84996, -3.24567], [6.74206, -3.14147]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[6.30757, -3.33133], [6.39992, -3.44954], [6.74206, -3.14147], [6.63416, -3.03727]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[6.74206, -3.14147], [6.84996, -3.24567], [7.15935, -2.87696], [7.038, -2.78879]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[6.63416, -3.03727], [6.74206, -3.14147], [7.038, -2.78879], [6.91664, -2.70062]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[7.038, -2.78879], [7.15935, -2.87696], [7.41441, -2.46878], [7.28197, -2.39836]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[6.91664, -2.70062], [7.038, -2.78879], [7.28197, -2.39836], [7.14952, -2.32794]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: poly, points: [[7.28197, -2.39836], [7.41441, -2.46878], [7.61018, -2.02907], [7.46923, -1.97777]], y: [0.85, 1.15], density: 8500, color: "#d8b25a"}   # compound bar t': brass (outside)
      - {kind: poly, points: [[7.14952, -2.32794], [7.28197, -2.39836], [7.46923, -1.97777], [7.32827, -1.92646]], y: [0.85, 1.15], density: 7800, color: "#8f8a80"}   # and steel (inside)
      - {kind: disc, center: [3.14085, 2.71551], radius: 0.32, y: [0.75, 1.25], density: 8500, color: "#e6d7b0"}   # the weight b
      - {kind: disc, center: [5.59563, -4.41371], radius: 0.32, y: [0.75, 1.25], density: 8500, color: "#e6d7b0"}   # the weight b'
      - {kind: disc, center: [4.36824, -0.8491], radius: 0.25, y: [0.0, 1.3], color: "#8f8a80"}   # its arbor
      - {kind: disc, center: [4.36824, -0.8491], radius: 2.25, y: [0.55, 0.65], color: "#cfc6b4"}   # the disk
      - {kind: disc, center: [6.23824, -0.13981], radius: 0.08, y: [0.15, 0.65], collide: 2, color: "#b85c38"}   # the pin
      - {kind: poly, points: [[5.07997, -0.29381], [5.52298, 0.11083], [5.42857, 0.2142], [4.98555, -0.19045]], y: [-0.15, 0.15], collide: 1, color: "#b85c38"}   # the impulse pallet C
  - id: plate
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#8f8a80"
    pieces:
      - {kind: disc, center: [2.37701, 1.71795], radius: 0.12, y: [0.2, 0.6]}   # a banking pin
      - {kind: disc, center: [1.77615, 1.10942], radius: 0.12, y: [0.2, 0.6]}   # a banking pin
joints:
  - {id: j_wheel, type: hinge, body: wheel, axis: [0, 1, 0], damping: 0.000003}   # the escape-wheel; + : clockwise (its way)
  - {id: j_anchor, type: hinge, body: anchor, axis: [0, 1, 0], range: [-0.002, 0.12324], damping: 1e-05, frictionloss: 0.0003}   # the anchor and lever; + : clockwise; the range is the banking pins
  - {id: j_bal, type: hinge, body: balance, axis: [0, 1, 0], stiffness: 0.0028, springref: -2.0, damping: 3e-06}   # the balance and its spring; + : clockwise
contact: {solref: [0.001, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
# The mainspring: a constant torque on the escape-wheel, clockwise. Nothing else is driven.
driver: {joint: j_wheel, kind: torque, torque: 0.0038, max_torque: 0.05}
checks:
  - {type: advance, joint: j_wheel, beat: j_bal, expect: 0.20944, tol: 0.03, settle_s: 3, window_s: 8.2}
  - {type: period, joint: j_bal, expect_s: 0.97213, tol: 0.03, settle_s: 3, window_s: 8}
  - {type: amplitude, joint: j_bal, min: 1.2, max: 3.0, sustain: 0.9, settle_s: 3, window_s: 8}
  - {type: penetration, max: 0.0005, settle_s: 1}
camera: {target: [2.4, 0, -2.1], position: [2.4, -36.0, -2.1], fov: 30}
display:
  output: j_wheel
  swing: j_bal
  labels: {j_wheel: "Escape-wheel (mainspring)", j_bal: "Compensation balance", j_anchor: "Lever"}
  proof: {label: "Pallets and pin out of contact", sub: "nothing makes good the balance's losses, so its swing dies away, and the mainspring spins the wheel freely"}

