# No. 483 (Brown 1868): "Dry gas meter. Consists of two bellows-like chambers, A, A', which are alternately filled with gas, and discharged through a valve, B, something like the slide-valve of a steam engine, worked by the chambers, A, A'. The capacity of the chambers being known, and the number of times they are filled being registered by dial-work, the quantity of gas passing through the meter is indicated on the dials."
# Model (cm, gravity on, seen from in front, the chambers cut away in half section). The two chambers A (above the shaft) and A'
# (below it), 12 cm across, each closed by a moving board (the bellows' board) on a rod to one crank of a shaft; the cranks
# (2.5 cm) stand at right angles, so one chamber fills while the other is half way. Gas from the main (300 Pa gauge, the
# only input) is let into a chamber, and the chamber let out to the burners, by its slide valve (B for A, B' for A'; Brown's
# one valve drawn as two), each worked by an eccentric (1.5 cm) on the same shaft, so the chambers work their own valves.
# Each chamber is a lumped gas vessel (src/fluid/vessels.c) swept by its board (a piston); as in the meters of the day each
# board's other side is a measuring space too (behind a fixed wall, the rod through it), so each chamber works both ways and the
# two, a quarter turn apart, leave the shaft no dead point. The valve's ports are links that open with the valve's travel (lap
# 0.05 cm, full at 0.65): while one side of a board takes gas from the main the other side is let out to the burners,
# and past the end of the stroke the valve changes them over. So the shaft turns as the gas passes, each turn a known volume
# (2261.95 cm3). A small fly (6 cm) on the shaft stands in for the dial-work's train, which is not modelled.
# All four spaces' gas is drawn, shaded by its pressure. Generator: opencode-runs/water/gen483.py.
number: 483
slug: dry-gas-meter
name: Dry gas meter
brown: "Dry gas meter. Consists of two bellows-like chambers, A, A', which are alternately filled with gas, and discharged through a valve, B, something like the slide-valve of a steam engine, worked by the chambers, A, A'. The capacity of the chambers being known, and the number of times they are filled being registered by dial-work, the quantity of gas passing through the meter is indicated on the dials."
units: cm
sim:
  timestep: 0.0005
  integrator: implicitfast
  iterations: 60
  duration_s: 14
  floor: false
bodies:
  - id: crank
    shape: part
    pos: [0, 0, 30]
    mass: 2
    color: "#a8884a"
    pieces:
      - {kind: loft, a: [[3.5, -0.6, 30], [3.3287, -0.6, 31.0816], [2.8316, -0.6, 32.0572], [2.0572, -0.6, 32.8316], [1.0816, -0.6, 33.3287], [0, -0.6, 33.5], [-1.0816, -0.6, 33.3287], [-2.0572, -0.6, 32.8316], [-2.8316, -0.6, 32.0572], [-3.3287, -0.6, 31.0816], [-3.5, -0.6, 30], [-3.3287, -0.6, 28.9184], [-2.8316, -0.6, 27.9428], [-2.0572, -0.6, 27.1684], [-1.0816, -0.6, 26.6713], [-0, -0.6, 26.5], [1.0816, -0.6, 26.6713], [2.0572, -0.6, 27.1684], [2.8316, -0.6, 27.9428], [3.3287, -0.6, 28.9184]], b: [[3.5, 0, 30], [3.3287, 0, 31.0816], [2.8316, 0, 32.0572], [2.0572, 0, 32.8316], [1.0816, 0, 33.3287], [0, 0, 33.5], [-1.0816, 0, 33.3287], [-2.0572, 0, 32.8316], [-2.8316, 0, 32.0572], [-3.3287, 0, 31.0816], [-3.5, 0, 30], [-3.3287, 0, 28.9184], [-2.8316, 0, 27.9428], [-2.0572, 0, 27.1684], [-1.0816, 0, 26.6713], [-0, 0, 26.5], [1.0816, 0, 26.6713], [2.0572, 0, 27.1684], [2.8316, 0, 27.9428], [3.3287, 0, 28.9184]], collide: 0, color: "#a8884a"}
      - {kind: rod, from: [0, -1.2, 27.5], to: [0, 0, 27.5], radius: 0.35, collide: 0, color: "#6d675c"}
      - {kind: rod, from: [2.5, -1.2, 30], to: [2.5, 0, 30], radius: 0.35, collide: 0, color: "#6d675c"}
      - {kind: rod, from: [1.5, -2.2, 30], to: [1.5, 0, 30], radius: 0.35, collide: 0, color: "#6d675c"}
      - {kind: rod, from: [0, -2.2, 31.5], to: [0, 0, 31.5], radius: 0.35, collide: 0, color: "#6d675c"}
      - {kind: rod, from: [0, -0.6, 30], to: [0, 0.8, 30], radius: 0.6, collide: 0, color: "#6d675c"}
      - {kind: loft, a: [[6, 0.9, 30], [5.4813, 0.9, 32.4404], [4.0148, 0.9, 34.4589], [1.8541, 0.9, 35.7063], [-0.6272, 0.9, 35.9671], [-3, 0.9, 35.1962], [-4.8541, 0.9, 33.5267], [-5.8689, 0.9, 31.2475], [-5.8689, 0.9, 28.7525], [-4.8541, 0.9, 26.4733], [-3, 0.9, 24.8038], [-0.6272, 0.9, 24.0329], [1.8541, 0.9, 24.2937], [4.0148, 0.9, 25.5411], [5.4813, 0.9, 27.5596]], b: [[6, 1.5, 30], [5.4813, 1.5, 32.4404], [4.0148, 1.5, 34.4589], [1.8541, 1.5, 35.7063], [-0.6272, 1.5, 35.9671], [-3, 1.5, 35.1962], [-4.8541, 1.5, 33.5267], [-5.8689, 1.5, 31.2475], [-5.8689, 1.5, 28.7525], [-4.8541, 1.5, 26.4733], [-3, 1.5, 24.8038], [-0.6272, 1.5, 24.0329], [1.8541, 1.5, 24.2937], [4.0148, 1.5, 25.5411], [5.4813, 1.5, 27.5596]], collide: 0, color: "#6d675c"}
  - id: plate_b
    shape: part
    pos: [0, 0, 15.5]
    mass: 0.05
    color: "#a8884a"
    pieces:
      - {kind: loft, a: [[5.85, 0, 15.5], [5.4047, 2.2387, 15.5], [4.1366, 4.1366, 15.5], [2.2387, 5.4047, 15.5], [0, 5.85, 15.5], [-2.2387, 5.4047, 15.5], [-4.1366, 4.1366, 15.5], [-5.4047, 2.2387, 15.5], [-5.85, 0, 15.5], [-5.4047, -2.2387, 15.5], [-4.1366, -4.1366, 15.5], [-2.2387, -5.4047, 15.5], [-0, -5.85, 15.5], [2.2387, -5.4047, 15.5], [4.1366, -4.1366, 15.5], [5.4047, -2.2387, 15.5]], b: [[5.85, 0, 14.7], [5.4047, 2.2387, 14.7], [4.1366, 4.1366, 14.7], [2.2387, 5.4047, 14.7], [0, 5.85, 14.7], [-2.2387, 5.4047, 14.7], [-4.1366, 4.1366, 14.7], [-5.4047, 2.2387, 14.7], [-5.85, 0, 14.7], [-5.4047, -2.2387, 14.7], [-4.1366, -4.1366, 14.7], [-2.2387, -5.4047, 14.7], [-0, -5.85, 14.7], [2.2387, -5.4047, 14.7], [4.1366, -4.1366, 14.7], [5.4047, -2.2387, 14.7]], collide: 0, color: "#a8884a"}
      - {kind: rod, from: [0, 0, 15.5], to: [0, 0, 17], radius: 0.6, collide: 0, color: "#6d675c"}
  - id: rod_b
    shape: part
    mount: plate_b
    pos: [0, 0, 17]
    mass: 0.02
    color: "#6d675c"
    pieces:
      - {kind: rod, from: [0, -1.2, 17], to: [0, -1.2, 27.5], radius: 0.4, capsule: true, collide: 0}
  - id: plate_a
    shape: part
    pos: [0, 0, 42]
    mass: 0.05
    color: "#a8884a"
    pieces:
      - {kind: loft, a: [[5.85, 0, 42.8], [5.4047, 2.2387, 42.8], [4.1366, 4.1366, 42.8], [2.2387, 5.4047, 42.8], [0, 5.85, 42.8], [-2.2387, 5.4047, 42.8], [-4.1366, 4.1366, 42.8], [-5.4047, 2.2387, 42.8], [-5.85, 0, 42.8], [-5.4047, -2.2387, 42.8], [-4.1366, -4.1366, 42.8], [-2.2387, -5.4047, 42.8], [-0, -5.85, 42.8], [2.2387, -5.4047, 42.8], [4.1366, -4.1366, 42.8], [5.4047, -2.2387, 42.8]], b: [[5.85, 0, 42], [5.4047, 2.2387, 42], [4.1366, 4.1366, 42], [2.2387, 5.4047, 42], [0, 5.85, 42], [-2.2387, 5.4047, 42], [-4.1366, 4.1366, 42], [-5.4047, 2.2387, 42], [-5.85, 0, 42], [-5.4047, -2.2387, 42], [-4.1366, -4.1366, 42], [-2.2387, -5.4047, 42], [-0, -5.85, 42], [2.2387, -5.4047, 42], [4.1366, -4.1366, 42], [5.4047, -2.2387, 42]], collide: 0, color: "#a8884a"}
      - {kind: rod, from: [0, 0, 42], to: [0, 0, 40.5], radius: 0.6, collide: 0, color: "#6d675c"}
  - id: rod_a
    shape: part
    mount: plate_a
    pos: [0, 0, 40.5]
    mass: 0.02
    color: "#6d675c"
    pieces:
      - {kind: rod, from: [0, -1.2, 40.5], to: [2.5, -1.2, 30], radius: 0.4, capsule: true, collide: 0}
  - id: valve_a
    shape: part
    pos: [-16, 0, 30]
    mass: 0.02
    color: "#a8884a"
    pieces:
      - {kind: loft, a: [[-18.6, 0.4, 30.4], [-13.4, 0.4, 30.4], [-13.4, 2.4, 30.4], [-18.6, 2.4, 30.4]], b: [[-18.6, 0.4, 28.9], [-13.4, 0.4, 28.9], [-13.4, 2.4, 28.9], [-18.6, 2.4, 28.9]], collide: 0, color: "#a8884a"}
      - {kind: rod, from: [-13.4, -2.2, 30], to: [-13.4, 1.4, 30], radius: 0.3, collide: 0, color: "#6d675c"}
  - id: vrod_a
    shape: part
    mount: valve_a
    pos: [-13.4, 0, 30]
    mass: 0.01
    color: "#6d675c"
    pieces:
      - {kind: rod, from: [-13.4, -2.2, 30], to: [1.5, -2.2, 30], radius: 0.3, capsule: true, collide: 0}
  - id: valve_b
    shape: part
    pos: [16, 0, 31.5]
    mass: 0.02
    color: "#a8884a"
    pieces:
      - {kind: loft, a: [[13.4, 0.4, 31.9], [18.6, 0.4, 31.9], [18.6, 2.4, 31.9], [13.4, 2.4, 31.9]], b: [[13.4, 0.4, 30.4], [18.6, 0.4, 30.4], [18.6, 2.4, 30.4], [13.4, 2.4, 30.4]], collide: 0, color: "#a8884a"}
      - {kind: rod, from: [13.4, -2.2, 31.5], to: [13.4, 1.4, 31.5], radius: 0.3, collide: 0, color: "#6d675c"}
  - id: vrod_b
    shape: part
    mount: valve_b
    pos: [13.4, 0, 31.5]
    mass: 0.01
    color: "#6d675c"
    pieces:
      - {kind: rod, from: [13.4, -2.2, 31.5], to: [0, -2.2, 31.5], radius: 0.3, capsule: true, collide: 0}
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#d6cdb8"
    pieces:
      - {kind: loft, a: [[-30, -10, 0], [30, -10, 0], [30, 16, 0], [-30, 16, 0]], b: [[-30, -10, -1.5], [30, -10, -1.5], [30, 16, -1.5], [-30, 16, -1.5]], collide: 0, color: "#8b7d66"}
      - {kind: loft, a: [[6, 0, 24.5], [5.7063, 1.8541, 24.5], [6.277, 2.0395, 24.5], [6.6, 0, 24.5]], b: [[6, 0, 5], [5.7063, 1.8541, 5], [6.277, 2.0395, 5], [6.6, 0, 5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[5.7063, 1.8541, 24.5], [4.8541, 3.5267, 24.5], [5.3395, 3.8794, 24.5], [6.277, 2.0395, 24.5]], b: [[5.7063, 1.8541, 5], [4.8541, 3.5267, 5], [5.3395, 3.8794, 5], [6.277, 2.0395, 5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[4.8541, 3.5267, 24.5], [3.5267, 4.8541, 24.5], [3.8794, 5.3395, 24.5], [5.3395, 3.8794, 24.5]], b: [[4.8541, 3.5267, 5], [3.5267, 4.8541, 5], [3.8794, 5.3395, 5], [5.3395, 3.8794, 5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[3.5267, 4.8541, 24.5], [1.8541, 5.7063, 24.5], [2.0395, 6.277, 24.5], [3.8794, 5.3395, 24.5]], b: [[3.5267, 4.8541, 5], [1.8541, 5.7063, 5], [2.0395, 6.277, 5], [3.8794, 5.3395, 5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[1.8541, 5.7063, 24.5], [0, 6, 24.5], [0, 6.6, 24.5], [2.0395, 6.277, 24.5]], b: [[1.8541, 5.7063, 5], [0, 6, 5], [0, 6.6, 5], [2.0395, 6.277, 5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[0, 6, 24.5], [-1.8541, 5.7063, 24.5], [-2.0395, 6.277, 24.5], [0, 6.6, 24.5]], b: [[0, 6, 5], [-1.8541, 5.7063, 5], [-2.0395, 6.277, 5], [0, 6.6, 5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[-1.8541, 5.7063, 24.5], [-3.5267, 4.8541, 24.5], [-3.8794, 5.3395, 24.5], [-2.0395, 6.277, 24.5]], b: [[-1.8541, 5.7063, 5], [-3.5267, 4.8541, 5], [-3.8794, 5.3395, 5], [-2.0395, 6.277, 5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[-3.5267, 4.8541, 24.5], [-4.8541, 3.5267, 24.5], [-5.3395, 3.8794, 24.5], [-3.8794, 5.3395, 24.5]], b: [[-3.5267, 4.8541, 5], [-4.8541, 3.5267, 5], [-5.3395, 3.8794, 5], [-3.8794, 5.3395, 5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[-4.8541, 3.5267, 24.5], [-5.7063, 1.8541, 24.5], [-6.277, 2.0395, 24.5], [-5.3395, 3.8794, 24.5]], b: [[-4.8541, 3.5267, 5], [-5.7063, 1.8541, 5], [-6.277, 2.0395, 5], [-5.3395, 3.8794, 5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[-5.7063, 1.8541, 24.5], [-6, 0, 24.5], [-6.6, 0, 24.5], [-6.277, 2.0395, 24.5]], b: [[-5.7063, 1.8541, 5], [-6, 0, 5], [-6.6, 0, 5], [-6.277, 2.0395, 5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[6.6, 0, 5], [6.0976, 2.5257, 5], [4.6669, 4.6669, 5], [2.5257, 6.0976, 5], [0, 6.6, 5], [-2.5257, 6.0976, 5], [-4.6669, 4.6669, 5], [-6.0976, 2.5257, 5], [-6.6, 0, 5], [-6.0976, -2.5257, 5], [-4.6669, -4.6669, 5], [-2.5257, -6.0976, 5], [-0, -6.6, 5], [2.5257, -6.0976, 5], [4.6669, -4.6669, 5], [6.0976, -2.5257, 5]], b: [[6.6, 0, 4.2], [6.0976, 2.5257, 4.2], [4.6669, 4.6669, 4.2], [2.5257, 6.0976, 4.2], [0, 6.6, 4.2], [-2.5257, 6.0976, 4.2], [-4.6669, 4.6669, 4.2], [-6.0976, 2.5257, 4.2], [-6.6, 0, 4.2], [-6.0976, -2.5257, 4.2], [-4.6669, -4.6669, 4.2], [-2.5257, -6.0976, 4.2], [-0, -6.6, 4.2], [2.5257, -6.0976, 4.2], [4.6669, -4.6669, 4.2], [6.0976, -2.5257, 4.2]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[6.6, 0, 25.1], [6.0976, 2.5257, 25.1], [4.6669, 4.6669, 25.1], [2.5257, 6.0976, 25.1], [0, 6.6, 25.1], [-2.5257, 6.0976, 25.1], [-4.6669, 4.6669, 25.1], [-6.0976, 2.5257, 25.1], [-6.6, 0, 25.1], [-6.0976, -2.5257, 25.1], [-4.6669, -4.6669, 25.1], [-2.5257, -6.0976, 25.1], [-0, -6.6, 25.1], [2.5257, -6.0976, 25.1], [4.6669, -4.6669, 25.1], [6.0976, -2.5257, 25.1]], b: [[6.6, 0, 24.5], [6.0976, 2.5257, 24.5], [4.6669, 4.6669, 24.5], [2.5257, 6.0976, 24.5], [0, 6.6, 24.5], [-2.5257, 6.0976, 24.5], [-4.6669, 4.6669, 24.5], [-6.0976, 2.5257, 24.5], [-6.6, 0, 24.5], [-6.0976, -2.5257, 24.5], [-4.6669, -4.6669, 24.5], [-2.5257, -6.0976, 24.5], [-0, -6.6, 24.5], [2.5257, -6.0976, 24.5], [4.6669, -4.6669, 24.5], [6.0976, -2.5257, 24.5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[6.6, 0, 35.5], [6.0976, 2.5257, 35.5], [4.6669, 4.6669, 35.5], [2.5257, 6.0976, 35.5], [0, 6.6, 35.5], [-2.5257, 6.0976, 35.5], [-4.6669, 4.6669, 35.5], [-6.0976, 2.5257, 35.5], [-6.6, 0, 35.5], [-6.0976, -2.5257, 35.5], [-4.6669, -4.6669, 35.5], [-2.5257, -6.0976, 35.5], [-0, -6.6, 35.5], [2.5257, -6.0976, 35.5], [4.6669, -4.6669, 35.5], [6.0976, -2.5257, 35.5]], b: [[6.6, 0, 34.9], [6.0976, 2.5257, 34.9], [4.6669, 4.6669, 34.9], [2.5257, 6.0976, 34.9], [0, 6.6, 34.9], [-2.5257, 6.0976, 34.9], [-4.6669, 4.6669, 34.9], [-6.0976, 2.5257, 34.9], [-6.6, 0, 34.9], [-6.0976, -2.5257, 34.9], [-4.6669, -4.6669, 34.9], [-2.5257, -6.0976, 34.9], [-0, -6.6, 34.9], [2.5257, -6.0976, 34.9], [4.6669, -4.6669, 34.9], [6.0976, -2.5257, 34.9]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[6, 0, 55], [5.7063, 1.8541, 55], [6.277, 2.0395, 55], [6.6, 0, 55]], b: [[6, 0, 35.5], [5.7063, 1.8541, 35.5], [6.277, 2.0395, 35.5], [6.6, 0, 35.5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[5.7063, 1.8541, 55], [4.8541, 3.5267, 55], [5.3395, 3.8794, 55], [6.277, 2.0395, 55]], b: [[5.7063, 1.8541, 35.5], [4.8541, 3.5267, 35.5], [5.3395, 3.8794, 35.5], [6.277, 2.0395, 35.5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[4.8541, 3.5267, 55], [3.5267, 4.8541, 55], [3.8794, 5.3395, 55], [5.3395, 3.8794, 55]], b: [[4.8541, 3.5267, 35.5], [3.5267, 4.8541, 35.5], [3.8794, 5.3395, 35.5], [5.3395, 3.8794, 35.5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[3.5267, 4.8541, 55], [1.8541, 5.7063, 55], [2.0395, 6.277, 55], [3.8794, 5.3395, 55]], b: [[3.5267, 4.8541, 35.5], [1.8541, 5.7063, 35.5], [2.0395, 6.277, 35.5], [3.8794, 5.3395, 35.5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[1.8541, 5.7063, 55], [0, 6, 55], [0, 6.6, 55], [2.0395, 6.277, 55]], b: [[1.8541, 5.7063, 35.5], [0, 6, 35.5], [0, 6.6, 35.5], [2.0395, 6.277, 35.5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[0, 6, 55], [-1.8541, 5.7063, 55], [-2.0395, 6.277, 55], [0, 6.6, 55]], b: [[0, 6, 35.5], [-1.8541, 5.7063, 35.5], [-2.0395, 6.277, 35.5], [0, 6.6, 35.5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[-1.8541, 5.7063, 55], [-3.5267, 4.8541, 55], [-3.8794, 5.3395, 55], [-2.0395, 6.277, 55]], b: [[-1.8541, 5.7063, 35.5], [-3.5267, 4.8541, 35.5], [-3.8794, 5.3395, 35.5], [-2.0395, 6.277, 35.5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[-3.5267, 4.8541, 55], [-4.8541, 3.5267, 55], [-5.3395, 3.8794, 55], [-3.8794, 5.3395, 55]], b: [[-3.5267, 4.8541, 35.5], [-4.8541, 3.5267, 35.5], [-5.3395, 3.8794, 35.5], [-3.8794, 5.3395, 35.5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[-4.8541, 3.5267, 55], [-5.7063, 1.8541, 55], [-6.277, 2.0395, 55], [-5.3395, 3.8794, 55]], b: [[-4.8541, 3.5267, 35.5], [-5.7063, 1.8541, 35.5], [-6.277, 2.0395, 35.5], [-5.3395, 3.8794, 35.5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[-5.7063, 1.8541, 55], [-6, 0, 55], [-6.6, 0, 55], [-6.277, 2.0395, 55]], b: [[-5.7063, 1.8541, 35.5], [-6, 0, 35.5], [-6.6, 0, 35.5], [-6.277, 2.0395, 35.5]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[6.6, 0, 55.8], [6.0976, 2.5257, 55.8], [4.6669, 4.6669, 55.8], [2.5257, 6.0976, 55.8], [0, 6.6, 55.8], [-2.5257, 6.0976, 55.8], [-4.6669, 4.6669, 55.8], [-6.0976, 2.5257, 55.8], [-6.6, 0, 55.8], [-6.0976, -2.5257, 55.8], [-4.6669, -4.6669, 55.8], [-2.5257, -6.0976, 55.8], [-0, -6.6, 55.8], [2.5257, -6.0976, 55.8], [4.6669, -4.6669, 55.8], [6.0976, -2.5257, 55.8]], b: [[6.6, 0, 55], [6.0976, 2.5257, 55], [4.6669, 4.6669, 55], [2.5257, 6.0976, 55], [0, 6.6, 55], [-2.5257, 6.0976, 55], [-4.6669, 4.6669, 55], [-6.0976, 2.5257, 55], [-6.6, 0, 55], [-6.0976, -2.5257, 55], [-4.6669, -4.6669, 55], [-2.5257, -6.0976, 55], [-0, -6.6, 55], [2.5257, -6.0976, 55], [4.6669, -4.6669, 55], [6.0976, -2.5257, 55]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[-8, 0, 5], [-6.6, 0, 5], [-6.6, 2, 5], [-8, 2, 5]], b: [[-8, 0, 0], [-6.6, 0, 0], [-6.6, 2, 0], [-8, 2, 0]], collide: 0, color: "#6d675c"}
      - {kind: loft, a: [[6.6, 0, 5], [8, 0, 5], [8, 2, 5], [6.6, 2, 5]], b: [[6.6, 0, 0], [8, 0, 0], [8, 2, 0], [6.6, 2, 0]], collide: 0, color: "#6d675c"}
      - {kind: loft, a: [[-9.5, 2, 55.8], [-8, 2, 55.8], [-8, 4, 55.8], [-9.5, 4, 55.8]], b: [[-9.5, 2, 0], [-8, 2, 0], [-8, 4, 0], [-9.5, 4, 0]], collide: 0, color: "#6d675c"}
      - {kind: loft, a: [[8, 2, 55.8], [9.5, 2, 55.8], [9.5, 4, 55.8], [8, 4, 55.8]], b: [[8, 2, 0], [9.5, 2, 0], [9.5, 4, 0], [8, 4, 0]], collide: 0, color: "#6d675c"}
      - {kind: loft, a: [[-9.5, 2, 31], [9.5, 2, 31], [9.5, 4, 31], [-9.5, 4, 31]], b: [[-9.5, 2, 29], [9.5, 2, 29], [9.5, 4, 29], [-9.5, 4, 29]], collide: 0, color: "#6d675c"}
      - {kind: rod, from: [0, 0.8, 30], to: [0, 4, 30], radius: 0.5, collide: 0, color: "#6d675c"}
      - {kind: loft, a: [[-19.5, 0, 28.9], [-12.5, 0, 28.9], [-12.5, 3, 28.9], [-19.5, 3, 28.9]], b: [[-19.5, 0, 28.4], [-12.5, 0, 28.4], [-12.5, 3, 28.4], [-19.5, 3, 28.4]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[-19.5, 2.6, 31.6], [-12.5, 2.6, 31.6], [-12.5, 3, 31.6], [-19.5, 3, 31.6]], b: [[-19.5, 2.6, 28.9], [-12.5, 2.6, 28.9], [-12.5, 3, 28.9], [-19.5, 3, 28.9]], collide: 0, color: "#7d7a72"}
      - {kind: rod, from: [-16, 1.5, 28.4], to: [-16, 1.5, 48], radius: 0.6, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [-16, 1.5, 48], to: [-6.3, 1.5, 48], radius: 0.6, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [-14.8, 1.5, 31.6], to: [-14.8, 1.5, 34.5], radius: 0.5, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [-14.8, 1.5, 34.5], to: [-6.3, 1.5, 34.5], radius: 0.5, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [-18.2, 1.5, 28.4], to: [-18.2, 1.5, 3], radius: 0.5, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [-13.8, 1.5, 28.4], to: [-13.8, 1.5, 3], radius: 0.5, collide: 0, color: "#5f5a52"}
      - {kind: loft, a: [[12.5, 0, 30.4], [19.5, 0, 30.4], [19.5, 3, 30.4], [12.5, 3, 30.4]], b: [[12.5, 0, 29.9], [19.5, 0, 29.9], [19.5, 3, 29.9], [12.5, 3, 29.9]], collide: 0, color: "#7d7a72"}
      - {kind: loft, a: [[12.5, 2.6, 33.1], [19.5, 2.6, 33.1], [19.5, 3, 33.1], [12.5, 3, 33.1]], b: [[12.5, 2.6, 30.4], [19.5, 2.6, 30.4], [19.5, 3, 30.4], [12.5, 3, 30.4]], collide: 0, color: "#7d7a72"}
      - {kind: rod, from: [16, 1.5, 29.9], to: [16, 1.5, 9.5], radius: 0.6, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [16, 1.5, 9.5], to: [6.3, 1.5, 9.5], radius: 0.6, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [14.8, 1.5, 29.9], to: [14.8, 1.5, 26], radius: 0.5, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [14.8, 1.5, 26], to: [6.3, 1.5, 26], radius: 0.5, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [13.8, 1.5, 29.9], to: [13.8, 1.5, 3], radius: 0.5, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [18.2, 1.5, 29.9], to: [18.2, 1.5, 3], radius: 0.5, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [-18.2, 1.5, 3], to: [13.8, 1.5, 3], radius: 0.5, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [-18.2, 1.5, 3], to: [-30, 1.5, 3], radius: 0.5, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [-13.8, 2.6, 2], to: [18.2, 2.6, 2], radius: 0.5, collide: 0, color: "#5f5a52"}
      - {kind: rod, from: [18.2, 2.6, 2], to: [30, 2.6, 2], radius: 0.5, collide: 0, color: "#5f5a52"}
joints:
  - {id: j_c, type: hinge, body: crank, axis: [0, 1, 0], damping: 0.001}   # the shaft
  - {id: j_pa, type: slide, body: plate_a, axis: [0, 0, 1], damping: 0.01}
  - {id: j_ra, type: hinge, body: rod_a, axis: [0, 1, 0], damping: 0.0001}
  - {id: j_pb, type: slide, body: plate_b, axis: [0, 0, 1], damping: 0.01}
  - {id: j_rb, type: hinge, body: rod_b, axis: [0, 1, 0], damping: 0.0001}
  - {id: j_va, type: slide, body: valve_a, axis: [1, 0, 0], damping: 0.01}
  - {id: j_qa, type: hinge, body: vrod_a, axis: [0, 1, 0], damping: 0.0001}
  - {id: j_vb, type: slide, body: valve_b, axis: [1, 0, 0], damping: 0.01}
  - {id: j_qb, type: hinge, body: vrod_b, axis: [0, 1, 0], damping: 0.0001}
pins:
  - {id: p_a, a: crank, b: rod_a, at: [2.5, 0, 30]}
  - {id: p_b, a: crank, b: rod_b, at: [0, 0, 27.5]}
  - {id: p_va, a: crank, b: vrod_a, at: [1.5, 0, 30]}
  - {id: p_vb, a: crank, b: vrod_b, at: [0, 0, 31.5]}
vessels:
  substeps: 8
  nodes:
    - {id: main, kind: source, p: 300, gas: true, RT: 84100}
    - {id: burners, kind: source, p: 0, gas: true, RT: 84100}
    - {id: chamber_a, kind: gas, volume: 1379.79, p: 0, RT: 84100,
       draw: {sections: [[[-5.9, 38], [5.9, 38], [5.9, 54.9], [-5.9, 54.9]]], y: [0.1, 5.5], face: {body: plate_a, z: 42.8, side: above}, pref: 600}}   # A's gas
    - {id: chamber_b, kind: gas, volume: 1097.04, p: 0, RT: 84100,
       draw: {sections: [[[-5.9, 5.1], [5.9, 5.1], [5.9, 19.5], [-5.9, 19.5]]], y: [0.1, 5.5], face: {body: plate_b, z: 14.7, side: below}, pref: 600}}   # A''s gas
    - {id: back_a, kind: gas, volume: 735.133, p: 0, RT: 84100,
       draw: {sections: [[[-5.9, 35.6], [5.9, 35.6], [5.9, 45], [-5.9, 45]]], y: [0.1, 5.5], face: {body: plate_a, z: 42, side: below}, pref: 600}}   # the space behind A's board
    - {id: back_b, kind: gas, volume: 1017.88, p: 0, RT: 84100,
       draw: {sections: [[[-5.9, 12.5], [5.9, 12.5], [5.9, 24.4], [-5.9, 24.4]]], y: [0.1, 5.5], face: {body: plate_b, z: 15.5, side: above}, pref: 600}}   # the space behind A''s board
  links:
    - {id: in_a, from: main, to: chamber_a, area: 0.4, cd: 0.62, open: {joint: j_va, q: [-1.45, -0.85], frac: [0, 1]}}
    - {id: out_a, from: chamber_a, to: burners, area: 0.4, cd: 0.62, open: {joint: j_va, q: [-2.15, -1.55], frac: [1, 0]}}
    - {id: in_b, from: main, to: chamber_b, area: 0.4, cd: 0.62, open: {joint: j_vb, q: [0.05, 0.65], frac: [0, 1]}}
    - {id: out_b, from: chamber_b, to: burners, area: 0.4, cd: 0.62, open: {joint: j_vb, q: [-0.65, -0.05], frac: [1, 0]}}
    - {id: in_a2, from: main, to: back_a, area: 0.4, cd: 0.62, open: {joint: j_va, q: [-2.15, -1.55], frac: [1, 0]}}
    - {id: out_a2, from: back_a, to: burners, area: 0.4, cd: 0.62, open: {joint: j_va, q: [-1.45, -0.85], frac: [0, 1]}}
    - {id: in_b2, from: main, to: back_b, area: 0.4, cd: 0.62, open: {joint: j_vb, q: [-0.65, -0.05], frac: [1, 0]}}
    - {id: out_b2, from: back_b, to: burners, area: 0.4, cd: 0.62, open: {joint: j_vb, q: [0.05, 0.65], frac: [0, 1]}}
  pistons:
    - {node: chamber_a, joint: j_pa, area: 113.097, sign: -1}   # A grows as its board goes down
    - {node: chamber_b, joint: j_pb, area: 113.097, sign: 1}    # A' grows as its board goes up
    - {node: back_a, joint: j_pa, area: 113.097, sign: 1}
    - {node: back_b, joint: j_pb, area: 113.097, sign: -1}
driver: {joint: j_c, kind: torque, torque: 0, max_torque: 0.001}   # no hand on the shaft: the gas is the only input
checks:
  - {type: turning, joint: j_c, direction: 1, min_mean: 0.5, min_fraction: 0.9, settle_s: 2.0, window_s: 11}
  - {type: penetration, max: 0.01}
camera: {target: [0, 0, 17], position: [0, -260, 25], fov: 19.5}
display:
  output: j_c
  labels: {j_c: "Shaft", j_pa: "Board of A", j_pb: "Board of A'", j_va: "Valve B", j_vb: "Valve B'"}
