# No. 318 (Brown 1868): "Watch regulator. The balance-spring is attached at its outer end to a fixed stud, R, and at its inner end to staff of balance. A neutral point is formed in the spring at P by inserting it between two curb-pins in the lever, which is fitted to turn on a fixed ring concentric with staff of balance, and the spring only vibrates between this neutral point and staff of balance. By moving lever to the right, the curb-pins are made to reduce the length of acting part of spring, and the vibrations of balance are made faster; and by moving it to the left an opposite effect is produced."
#
# Model (cm, a plan of the watch: gravity off). The balance turns about the origin; its spring is a chain of 47 short steel links, each hinged
# to the next with the stiffness of that much spring (EI/l, EI 7e-05 N m^2): 20 links on a 1.5-turn spiral from the collet (r 0.5) out to r 2.4,
# then 27 on an arc concentric with the balance (260 degrees) to the stud R, where the last link is pinned. The lever turns on
# the same centre and carries the two curb pins P, one each side of the arc with 0 play; they are the only things it touches. The lever is
# the one driven joint: a hand moves it 50 degrees to the right and back to the left (0.0625 Hz). The balance is let go
# 1.2 rad from rest and nothing else drives it. With the pins to the right the acting part of the spring (collet to pins) is shorter, so the
# balance vibrates faster: T = 2 pi sqrt(I L / EI). Generator: opencode-runs/batch12/gen318.py.
number: 318
slug: watch-regulator
name: Watch regulator
brown: "Watch regulator. The balance-spring is attached at its outer end to a fixed stud, R, and at its inner end to staff of balance. A neutral point is formed in the spring at P by inserting it between two curb-pins in the lever, which is fitted to turn on a fixed ring concentric with staff of balance, and the spring only vibrates between this neutral point and staff of balance. By moving lever to the right, the curb-pins are made to reduce the length of acting part of spring, and the vibrations of balance are made faster; and by moving it to the left an opposite effect is produced."
units: cm
sim: {timestep: 5e-05, integrator: implicitfast, iterations: 50, duration_s: 16, floor: false, gravity: 0}
bodies:
  - id: balance
    shape: part
    pos: [0, 0, 0]
    mass: 0.01
    color: "#d9c48f"
    pieces:
      - {kind: disc, center: [0, 0], radius: 3.6, inner: 3.25, y: [0.3, 0.5]}   # the rim
      - {kind: poly, points: [[-3.3, -0.12], [3.3, -0.12], [3.3, 0.12], [-3.3, 0.12]], y: [0.3, 0.5]}   # the arm
      - {kind: disc, center: [0, 0], radius: 0.45, y: [-0.15, 0.6], color: "#8f8a80"}   # the staff and collet
  - id: s0
    shape: part
    pos: [-0.38302, 0, 0.32139]
    mount: balance
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-0.38302, 0, 0.32139], to: [-0.6661, 0, -0.26682], radius: 0.03, collide: 1, capsule: true}
  - id: s1
    shape: part
    pos: [-0.6661, 0, -0.26682]
    mount: s0
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-0.6661, 0, -0.26682], to: [-0.30665, 0, -0.83143], radius: 0.03, collide: 1, capsule: true}
  - id: s2
    shape: part
    pos: [-0.30665, 0, -0.83143]
    mount: s1
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-0.30665, 0, -0.83143], to: [0.35613, 0, -0.96506], radius: 0.03, collide: 1, capsule: true}
  - id: s3
    shape: part
    pos: [0.35613, 0, -0.96506]
    mount: s2
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [0.35613, 0, -0.96506], to: [0.95559, 0, -0.6471], radius: 0.03, collide: 1, capsule: true}
  - id: s4
    shape: part
    pos: [0.95559, 0, -0.6471]
    mount: s3
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [0.95559, 0, -0.6471], to: [1.26695, 0, -0.0407], radius: 0.03, collide: 1, capsule: true}
  - id: s5
    shape: part
    pos: [1.26695, 0, -0.0407]
    mount: s4
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [1.26695, 0, -0.0407], to: [1.21306, 0, 0.6412], radius: 0.03, collide: 1, capsule: true}
  - id: s6
    shape: part
    pos: [1.21306, 0, 0.6412]
    mount: s5
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [1.21306, 0, 0.6412], to: [0.83416, 0, 1.20919], radius: 0.03, collide: 1, capsule: true}
  - id: s7
    shape: part
    pos: [0.83416, 0, 1.20919]
    mount: s6
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [0.83416, 0, 1.20919], to: [0.23546, 0, 1.54233], radius: 0.03, collide: 1, capsule: true}
  - id: s8
    shape: part
    pos: [0.23546, 0, 1.54233]
    mount: s7
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [0.23546, 0, 1.54233], to: [-0.45084, 0, 1.58373], radius: 0.03, collide: 1, capsule: true}
  - id: s9
    shape: part
    pos: [-0.45084, 0, 1.58373]
    mount: s8
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-0.45084, 0, 1.58373], to: [-1.09026, 0, 1.34109], radius: 0.03, collide: 1, capsule: true}
  - id: s10
    shape: part
    pos: [-1.09026, 0, 1.34109]
    mount: s9
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-1.09026, 0, 1.34109], to: [-1.58605, 0, 0.86528], radius: 0.03, collide: 1, capsule: true}
  - id: s11
    shape: part
    pos: [-1.58605, 0, 0.86528]
    mount: s10
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-1.58605, 0, 0.86528], to: [-1.86658, 0, 0.23862], radius: 0.03, collide: 1, capsule: true}
  - id: s12
    shape: part
    pos: [-1.86658, 0, 0.23862]
    mount: s11
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-1.86658, 0, 0.23862], to: [-1.90208, 0, -0.44735], radius: 0.03, collide: 1, capsule: true}
  - id: s13
    shape: part
    pos: [-1.90208, 0, -0.44735]
    mount: s12
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-1.90208, 0, -0.44735], to: [-1.69576, 0, -1.10461], radius: 0.03, collide: 1, capsule: true}
  - id: s14
    shape: part
    pos: [-1.69576, 0, -1.10461]
    mount: s13
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-1.69576, 0, -1.10461], to: [-1.2803, 0, -1.65353], radius: 0.03, collide: 1, capsule: true}
  - id: s15
    shape: part
    pos: [-1.2803, 0, -1.65353]
    mount: s14
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-1.2803, 0, -1.65353], to: [-0.70645, 0, -2.03782], radius: 0.03, collide: 1, capsule: true}
  - id: s16
    shape: part
    pos: [-0.70645, 0, -2.03782]
    mount: s15
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-0.70645, 0, -2.03782], to: [-0.04514, 0, -2.21952], radius: 0.03, collide: 1, capsule: true}
  - id: s17
    shape: part
    pos: [-0.04514, 0, -2.21952]
    mount: s16
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-0.04514, 0, -2.21952], to: [0.64365, 0, -2.18906], radius: 0.03, collide: 1, capsule: true}
  - id: s18
    shape: part
    pos: [0.64365, 0, -2.18906]
    mount: s17
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [0.64365, 0, -2.18906], to: [1.28882, 0, -1.95497], radius: 0.03, collide: 1, capsule: true}
  - id: s19
    shape: part
    pos: [1.28882, 0, -1.95497]
    mount: s18
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [1.28882, 0, -1.95497], to: [1.83851, 0, -1.54269], radius: 0.03, collide: 1, capsule: true}
  - id: s20
    shape: part
    pos: [1.83851, 0, -1.54269]
    mount: s19
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [1.83851, 0, -1.54269], to: [2.07066, 0, -1.21341], radius: 0.03, collide: 1, capsule: true}
  - id: s21
    shape: part
    pos: [2.07066, 0, -1.21341]
    mount: s20
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [2.07066, 0, -1.21341], to: [2.24446, 0, -0.84994], radius: 0.03, collide: 1, capsule: true}
  - id: s22
    shape: part
    pos: [2.24446, 0, -0.84994]
    mount: s21
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [2.24446, 0, -0.84994], to: [2.35501, 0, -0.46251], radius: 0.03, collide: 1, capsule: true}
  - id: s23
    shape: part
    pos: [2.35501, 0, -0.46251]
    mount: s22
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [2.35501, 0, -0.46251], to: [2.3992, 0, -0.06205], radius: 0.03, collide: 1, capsule: true}
  - id: s24
    shape: part
    pos: [2.3992, 0, -0.06205]
    mount: s23
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [2.3992, 0, -0.06205], to: [2.37577, 0, 0.34016], radius: 0.03, collide: 1, capsule: true}
  - id: s25
    shape: part
    pos: [2.37577, 0, 0.34016]
    mount: s24
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [2.37577, 0, 0.34016], to: [2.28539, 0, 0.73278], radius: 0.03, collide: 1, capsule: true}
  - id: s26
    shape: part
    pos: [2.28539, 0, 0.73278]
    mount: s25
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [2.28539, 0, 0.73278], to: [2.13061, 0, 1.10475], radius: 0.03, collide: 1, capsule: true}
  - id: s27
    shape: part
    pos: [2.13061, 0, 1.10475]
    mount: s26
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [2.13061, 0, 1.10475], to: [1.91579, 0, 1.44559], radius: 0.03, collide: 1, capsule: true}
  - id: s28
    shape: part
    pos: [1.91579, 0, 1.44559]
    mount: s27
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [1.91579, 0, 1.44559], to: [1.64698, 0, 1.7457], radius: 0.03, collide: 1, capsule: true}
  - id: s29
    shape: part
    pos: [1.64698, 0, 1.7457]
    mount: s28
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [1.64698, 0, 1.7457], to: [1.33176, 0, 1.9966], radius: 0.03, collide: 1, capsule: true}
  - id: s30
    shape: part
    pos: [1.33176, 0, 1.9966]
    mount: s29
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [1.33176, 0, 1.9966], to: [0.979, 0, 2.19125], radius: 0.03, collide: 1, capsule: true}
  - id: s31
    shape: part
    pos: [0.979, 0, 2.19125]
    mount: s30
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [0.979, 0, 2.19125], to: [0.59866, 0, 2.32414], radius: 0.03, collide: 1, capsule: true}
  - id: s32
    shape: part
    pos: [0.59866, 0, 2.32414]
    mount: s31
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [0.59866, 0, 2.32414], to: [0.20145, 0, 2.39153], radius: 0.03, collide: 1, capsule: true}
  - id: s33
    shape: part
    pos: [0.20145, 0, 2.39153]
    mount: s32
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [0.20145, 0, 2.39153], to: [-0.20145, 0, 2.39153], radius: 0.03, collide: 1, capsule: true}
  - id: s34
    shape: part
    pos: [-0.20145, 0, 2.39153]
    mount: s33
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-0.20145, 0, 2.39153], to: [-0.59866, 0, 2.32414], radius: 0.03, collide: 1, capsule: true}
  - id: s35
    shape: part
    pos: [-0.59866, 0, 2.32414]
    mount: s34
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-0.59866, 0, 2.32414], to: [-0.979, 0, 2.19125], radius: 0.03, collide: 1, capsule: true}
  - id: s36
    shape: part
    pos: [-0.979, 0, 2.19125]
    mount: s35
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-0.979, 0, 2.19125], to: [-1.33176, 0, 1.9966], radius: 0.03, collide: 1, capsule: true}
  - id: s37
    shape: part
    pos: [-1.33176, 0, 1.9966]
    mount: s36
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-1.33176, 0, 1.9966], to: [-1.64698, 0, 1.7457], radius: 0.03, collide: 1, capsule: true}
  - id: s38
    shape: part
    pos: [-1.64698, 0, 1.7457]
    mount: s37
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-1.64698, 0, 1.7457], to: [-1.91579, 0, 1.44559], radius: 0.03, collide: 1, capsule: true}
  - id: s39
    shape: part
    pos: [-1.91579, 0, 1.44559]
    mount: s38
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-1.91579, 0, 1.44559], to: [-2.13061, 0, 1.10475], radius: 0.03, collide: 1, capsule: true}
  - id: s40
    shape: part
    pos: [-2.13061, 0, 1.10475]
    mount: s39
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-2.13061, 0, 1.10475], to: [-2.28539, 0, 0.73278], radius: 0.03, collide: 1, capsule: true}
  - id: s41
    shape: part
    pos: [-2.28539, 0, 0.73278]
    mount: s40
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-2.28539, 0, 0.73278], to: [-2.37577, 0, 0.34016], radius: 0.03, collide: 1, capsule: true}
  - id: s42
    shape: part
    pos: [-2.37577, 0, 0.34016]
    mount: s41
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-2.37577, 0, 0.34016], to: [-2.3992, 0, -0.06205], radius: 0.03, collide: 1, capsule: true}
  - id: s43
    shape: part
    pos: [-2.3992, 0, -0.06205]
    mount: s42
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-2.3992, 0, -0.06205], to: [-2.35501, 0, -0.46251], radius: 0.03, collide: 1, capsule: true}
  - id: s44
    shape: part
    pos: [-2.35501, 0, -0.46251]
    mount: s43
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-2.35501, 0, -0.46251], to: [-2.24446, 0, -0.84994], radius: 0.03, collide: 1, capsule: true}
  - id: s45
    shape: part
    pos: [-2.24446, 0, -0.84994]
    mount: s44
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-2.24446, 0, -0.84994], to: [-2.07066, 0, -1.21341], radius: 0.03, collide: 1, capsule: true}
  - id: s46
    shape: part
    pos: [-2.07066, 0, -1.21341]
    mount: s45
    mass: 3e-05
    friction: 0.001
    color: "#3d4a5c"
    pieces:
      - {kind: rod, from: [-2.07066, 0, -1.21341], to: [-1.83851, 0, -1.54269], radius: 0.03, collide: 1, capsule: true}
  - id: lever
    shape: part
    pos: [0, 0, 0]
    mass: 0.01
    friction: 0.001
    color: "#9aa3ad"
    pieces:
      - {kind: disc, center: [0, 0], radius: 3.05, inner: 2.85, y: [-0.35, -0.25]}   # the ring it turns on
      - {kind: poly, points: [[-0.15, 2.9], [0.15, 2.9], [0.1, 4.6], [-0.1, 4.6]], y: [-0.35, -0.25]}   # the index
      - {kind: poly, points: [[-0.25, 2.14], [0.25, 2.14], [0.25, 2.95], [-0.25, 2.95]], y: [-0.35, -0.25]}   # the pins' bridge
      - {kind: disc, center: [-0.11985, 2.28686], radius: 0.08, y: [-0.3, 0.15], collide: 2, color: "#b85c38"}   # the inner curb pin
      - {kind: disc, center: [0.13136, 2.50656], radius: 0.08, y: [-0.3, 0.15], collide: 2, color: "#b85c38"}   # the outer curb pin
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: disc, center: [-1.98559, -1.66611], radius: 0.3, y: [-0.2, 0.6], color: "#8f8a80"}   # the stud R
      - {kind: disc, center: [0, 0], radius: 5.2, inner: 4.9, y: [0.7, 0.9]}   # the plate's edge
joints:
  - {id: j_bal, type: hinge, body: balance, axis: [0, 1, 0], damping: 1e-07}   # the balance; + : clockwise
  - {id: j_s0, type: hinge, body: s0, axis: [0, 1, 0], stiffness: 0.0107233, springref: 0.04066, damping: 2e-07}
  - {id: j_s1, type: hinge, body: s1, axis: [0, 1, 0], stiffness: 0.0105892, springref: 0.04117, damping: 2e-07}
  - {id: j_s2, type: hinge, body: s2, axis: [0, 1, 0], stiffness: 0.0104056, springref: 0.0419, damping: 2e-07}
  - {id: j_s3, type: hinge, body: s3, axis: [0, 1, 0], stiffness: 0.0103346, springref: 0.04219, damping: 2e-07}
  - {id: j_s4, type: hinge, body: s4, axis: [0, 1, 0], stiffness: 0.0102924, springref: 0.04236, damping: 2e-07}
  - {id: j_s5, type: hinge, body: s5, axis: [0, 1, 0], stiffness: 0.0102512, springref: 0.04253, damping: 2e-07}
  - {id: j_s6, type: hinge, body: s6, axis: [0, 1, 0], stiffness: 0.0102429, springref: 0.04256, damping: 2e-07}
  - {id: j_s7, type: hinge, body: s7, axis: [0, 1, 0], stiffness: 0.0102345, springref: 0.0426, damping: 2e-07}
  - {id: j_s8, type: hinge, body: s8, axis: [0, 1, 0], stiffness: 0.0101989, springref: 0.04275, damping: 2e-07}
  - {id: j_s9, type: hinge, body: s9, axis: [0, 1, 0], stiffness: 0.0102081, springref: 0.04271, damping: 2e-07}
  - {id: j_s10, type: hinge, body: s10, axis: [0, 1, 0], stiffness: 0.0102109, springref: 0.0427, damping: 2e-07}
  - {id: j_s11, type: hinge, body: s11, axis: [0, 1, 0], stiffness: 0.010191, springref: 0.04278, damping: 2e-07}
  - {id: j_s12, type: hinge, body: s12, axis: [0, 1, 0], stiffness: 0.0101931, springref: 0.04277, damping: 2e-07}
  - {id: j_s13, type: hinge, body: s13, axis: [0, 1, 0], stiffness: 0.0101761, springref: 0.04284, damping: 2e-07}
  - {id: j_s14, type: hinge, body: s14, axis: [0, 1, 0], stiffness: 0.0101648, springref: 0.04289, damping: 2e-07}
  - {id: j_s15, type: hinge, body: s15, axis: [0, 1, 0], stiffness: 0.0101519, springref: 0.04294, damping: 2e-07}
  - {id: j_s16, type: hinge, body: s16, axis: [0, 1, 0], stiffness: 0.010171, springref: 0.04286, damping: 2e-07}
  - {id: j_s17, type: hinge, body: s17, axis: [0, 1, 0], stiffness: 0.0101797, springref: 0.04283, damping: 2e-07}
  - {id: j_s18, type: hinge, body: s18, axis: [0, 1, 0], stiffness: 0.010176, springref: 0.04284, damping: 2e-07}
  - {id: j_s19, type: hinge, body: s19, axis: [0, 1, 0], stiffness: 0.0101934, springref: 0.04277, damping: 2e-07}
  - {id: j_s20, type: hinge, body: s20, axis: [0, 1, 0], stiffness: 0.012844, springref: 0.03394, damping: 2e-07}
  - {id: j_s21, type: hinge, body: s21, axis: [0, 1, 0], stiffness: 0.0173745, springref: 0.02509, damping: 2e-07}
  - {id: j_s22, type: hinge, body: s22, axis: [0, 1, 0], stiffness: 0.0173745, springref: 0.02509, damping: 2e-07}
  - {id: j_s23, type: hinge, body: s23, axis: [0, 1, 0], stiffness: 0.0173745, springref: 0.02509, damping: 2e-07}
  - {id: j_s24, type: hinge, body: s24, axis: [0, 1, 0], stiffness: 0.0173745, springref: 0.02509, damping: 2e-07}
  - {id: j_s25, type: hinge, body: s25, axis: [0, 1, 0], stiffness: 0.0173745, springref: 0.02509, damping: 2e-07}
  - {id: j_s26, type: hinge, body: s26, axis: [0, 1, 0], stiffness: 0.0173745, springref: 0.02509, damping: 2e-07}
  - {id: j_s27, type: hinge, body: s27, axis: [0, 1, 0], stiffness: 0.0173745, springref: 0.02509, damping: 2e-07}
  - {id: j_s28, type: hinge, body: s28, axis: [0, 1, 0], stiffness: 0.0173745, springref: 0.02509, damping: 2e-07}
  - {id: j_s29, type: hinge, body: s29, axis: [0, 1, 0], stiffness: 0.0173745, springref: 0.02509, damping: 2e-07}
  - {id: j_s30, type: hinge, body: s30, axis: [0, 1, 0], stiffness: 0.0173745, springref: 0.02509, damping: 2e-07}
  - {id: j_s31, type: hinge, body: s31, axis: [0, 1, 0], stiffness: 0.0173745, springref: 0.02509, damping: 2e-07}
  - {id: j_s32, type: hinge, body: s32, axis: [0, 1, 0], stiffness: 0.0173745, springref: 0.02509, damping: 2e-07}
  - {id: j_s33, type: hinge, body: s33, axis: [0, 1, 0], stiffness: 0.0173745, springref: 0.02509, damping: 2e-07}
  - {id: j_s34, type: hinge, body: s34, axis: [0, 1, 0], stiffness: 0.0173745, damping: 2e-07}
  - {id: j_s35, type: hinge, body: s35, axis: [0, 1, 0], stiffness: 0.0173745, damping: 2e-07}
  - {id: j_s36, type: hinge, body: s36, axis: [0, 1, 0], stiffness: 0.0173745, damping: 2e-07}
  - {id: j_s37, type: hinge, body: s37, axis: [0, 1, 0], stiffness: 0.0173745, damping: 2e-07}
  - {id: j_s38, type: hinge, body: s38, axis: [0, 1, 0], stiffness: 0.0173745, damping: 2e-07}
  - {id: j_s39, type: hinge, body: s39, axis: [0, 1, 0], stiffness: 0.0173745, damping: 2e-07}
  - {id: j_s40, type: hinge, body: s40, axis: [0, 1, 0], stiffness: 0.0173745, damping: 2e-07}
  - {id: j_s41, type: hinge, body: s41, axis: [0, 1, 0], stiffness: 0.0173745, damping: 2e-07}
  - {id: j_s42, type: hinge, body: s42, axis: [0, 1, 0], stiffness: 0.0173745, damping: 2e-07}
  - {id: j_s43, type: hinge, body: s43, axis: [0, 1, 0], stiffness: 0.0173745, damping: 2e-07}
  - {id: j_s44, type: hinge, body: s44, axis: [0, 1, 0], stiffness: 0.0173745, damping: 2e-07}
  - {id: j_s45, type: hinge, body: s45, axis: [0, 1, 0], stiffness: 0.0173745, damping: 2e-07}
  - {id: j_s46, type: hinge, body: s46, axis: [0, 1, 0], stiffness: 0.0173745, damping: 2e-07}
  - {id: j_lever, type: hinge, body: lever, axis: [0, 1, 0], damping: 0.0001}   # the lever; + : to the right (clockwise)
pins:
  - {id: stud, a: s46, b: frame, at: [-1.83851, 0, -1.54269]}
contact: {solref: [0.002, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_lever, kind: velocity, swing: {amplitude: 0.87266, hz: 0.0625}, kv: 1, max_torque: 1}
checks:
  - {type: period, joint: j_bal, expect_s: 0.89557, tol: 0.03, settle_s: 2.5, window_s: 3}   # lever to the right: acting part 17.17 cm, T = 2 pi sqrt(I L / EI)
  - {type: period, joint: j_bal, expect_s: 0.99256, tol: 0.03, settle_s: 10.5, window_s: 3}   # lever to the left: acting part 21.36 cm
  - {type: amplitude, joint: j_bal, min: 0.8, max: 1.6, sustain: 0.8, settle_s: 1, window_s: 14}   # the balance keeps vibrating (no escapement here, so its swing dies slowly)
  - {type: penetration, max: 0.0005, settle_s: 0.5}
camera: {target: [0, 0, -2.3], position: [0, -40.0, -2.3], fov: 30}
display:
  output: j_bal
  swing: j_bal
  labels: {j_lever: "Regulator lever (hand)", j_bal: "Balance"}
  proof: {label: "Curb pins off the spring", sub: "the whole spring acts wherever the lever is, so the balance keeps one rate"}
