# No. 13, In this the lower pulley is movable (Brown 1868, p. 2).
#
# "In this the lower pulley is movable. One end of the rope being fixed, the other must move twice as
# fast as the weight, and a corresponding gain of power is consequently effected."
#
# Layout, as in the plate: a beam across the top. At the left a fixed pulley hangs on a hook from the
# beam; at the right the rope's end is tied to an eye in the beam. From that eye the rope runs plumb
# down to the right of the lower pulley, UNDER it, up its left side past the fixed pulley's right-hand
# rim (the two strands are plumb and touching), over the top of the fixed pulley and down to the left,
# where its free end hangs and the hand pulls it. The lower pulley is a block: the sheave turns on its
# axle inside it, and the weight hangs on the hook under it, so the block is lifted by nothing but the
# rope pressing on the sheave's rim. Nothing is driven but the hand — a slide joint in a guide along
# the rope, pulled at a constant 6 cm/s.
#
# Brown's statement is what the checks measure. With one end of the rope fixed, the block is held by
# two strands, so it rises at half the hand's speed (0.5); the pull is the weight the rope carries, half
# of the block and the weight on it (22 kg = 216 N, half 108 N), less the hand's own 0.9 kg pulling
# down its own strand (8.3 N), so about 100 N. The fixed pulley turns at the rope's own speed on its
# rim; the block's sheave turns faster, because the rope runs over it at the hand's 6 cm/s while the
# block itself rises at 3 cm/s beneath it (9 cm/s at the rim).
number: 13
slug: in-this-the-lower-pulley-is-movable
name: In this the Lower Pulley is Movable
brown: "In this the lower pulley is movable. One end of the rope being fixed, the other must move twice as fast as the weight, and a corresponding gain of power is consequently effected."
units: cm
sim: {timestep: 0.0001, integrator: implicitfast, iterations: 60, duration_s: 2.4}
bodies:
  # Fixed structure: the beam, the hook the fixed pulley's axle hangs in, and the eye the rope's end is
  # tied to (the eye is a part of the frame, so the rope's end can be lashed to it).
  - id: beam
    shape: frame
    color: "#cdc0a4"
    rods: [{from: [0, 0, 78.4], to: [0, 0, 64.6], radius: 0.42}, {from: [-2.9, 0, 63.7], to: [2.9, 0, 63.7], radius: 0.42}]
    boxes: [{pos: [8, 0, 79.4], size: [26, 3.2, 1.1]}]
  - {id: eye, shape: part, pos: [24.2, 0, 77.0], fixed: true, color: "#8f8a80",
     pieces: [{kind: disc, center: [24.2, 77.0], radius: 1.7, inner: 0.85, y: [-1.1, 1.1], collide: 0}]}
  # The fixed pulley: a solid sheave on its axle, hung by the hook (no spokes, as the plate draws it).
  - {id: fixed, shape: pulley, radius: 9, width: 3.2, pos: [0, 0, 62], mass: 1.2, spokes: 0, hub: 1.8, flange: 0.5, color: "#e6dcc6"}
  # The movable block: the shell and the hook the weight hangs on, with the sheave turning inside it.
  # The rope keeps its two strands plumb, as the plate draws them, so the block's guide is the vertical.
  - {id: block, shape: part, pos: [16.8, 0, 30], mass: 1.2, color: "#b8ac92",
     pieces: [{kind: rod, from: [16.8, 0, 30], to: [16.8, 0, 22.3], radius: 0.65, collide: 0},
              {kind: disc, center: [16.8, 22.1], radius: 1.5, inner: 0.75, y: [-0.85, 0.85], collide: 0}]}
  - {id: sheave, shape: pulley, radius: 7, width: 2.8, pos: [16.8, 0, 30], mass: 0.8, spokes: 0, hub: 1.5, flange: 0.45, color: "#e6dcc6", mount: block}
  # The weight, hung by its neck in the hook under the block.
  - {id: bag, shape: weight, pos: [16.8, 0, 19.0], mass: 20, size: [3.3, 3.3, 2.9], taper: 0.55, color: "#b9a179", mount: block}
  # The hand, gripping the rope's free end: a guide along the rope's strand, carrying fist and sleeve.
  - id: hand
    shape: grip
    pos: [-17.0416, 0, 42.6624]
    mass: 0.9
    color: "#c9bda2"
    rods:
      # the hand as the plate shows it, along the strand (which leaves the pulley 70 deg below horizontal)
      - {from: [-16.5286, 0, 44.0719], to: [-17.5546, 0, 41.2529], radius: 2.0}     # the fist
      - {from: [-17.5546, 0, 41.2529], to: [-18.1361, 0, 39.6554], radius: 1.55}   # the cuff
      - {from: [-18.1361, 0, 39.6554], to: [-18.7517, 0, 37.9639], radius: 1.25}   # the forearm
joints:
  - {id: j_fixed, type: hinge, body: fixed, axis: [0, 1, 0], damping: 0.01}   # the axle in the hook's eye
  - {id: j_block, type: slide, body: block, axis: [0, 0, 1], range: [-2, 22]}  # the block's guide, plumb
  - {id: j_sheave, type: hinge, body: sheave, axis: [0, 1, 0], damping: 0.01}  # the sheave on the block's axle
  - {id: j_hand, type: slide, body: hand, axis: [-0.3420201, 0, -0.9396926], range: [-3, 16]}  # the hand's guide, along the rope
cords:   # the rope: a chain of links on real contact with both sheaves
  # One rope, from the hand over the fixed pulley, UNDER the block's sheave, to the eye in the beam.
  # Its centreline rides 0.4 cm clear of each rim; the two strands between the block and the pulleys
  # are plumb and 1 cm apart in x less the sheave's smaller radius (16.8 = 9.4 + 7.4).
  - id: rope
    from: {body: hand, at: [-17.0416, 0, 42.6624]}
    to: {body: eye, at: [24.2, 0, 77.0]}
    over: [fixed, sheave]
    under: [sheave]        # passed under, so wrapped the other way round from the fixed pulley
    links: 48
    thickness: 0.8
    density: 1400          # hemp
    stiffness: 400000      # N/m per link: a rope is nearly inextensible (108 N stretches it 1.3 cm)
    pretension: 110        # N, so the rope hangs taut at the start, carrying the block's weight
    damping: 12
    friction: 0.5          # hemp on a wooden sheave
# The rope lies on the block's sheave under the whole weight, so its contact has to be stiff: the links
# press about 0.2 mm into the rim, which the pull then has to work against.
contact: {solref: [0.0005, 1], solimp: [0.98, 0.999, 0.0001], margin: 0}
driver: {joint: j_hand, kind: velocity, speed: 6, kv: 60000, max_torque: 400}
checks:
  # Brown's point: the rope's end moves twice as fast as the weight, so the block rises at half the
  # hand's speed. The rope takes up about 1 cm of its own stretch in the first second, so the window
  # is taken after that.
  - {type: ratio, out: j_block, in: j_hand, expect: 0.5, tol: 0.03, settle_s: 1.2, window_s: 1.0}
  # The rope rubs the fixed pulley round as it passes over it: v = ωR with R = 9 + 0.4 = 9.4 cm, so
  # ω/v = 10.64 rad per metre, the sheave turning the way the rope runs over it. Nothing turns the
  # axle but the rope on the rim.
  - {type: ratio, out: j_fixed, in: j_hand, expect: -10.638, tol: 0.6, settle_s: 1.2, window_s: 1.0}
  # The block's sheave rolls on the rope like a wheel on a rack: the strand to the beam's eye stands
  # still, so with no slip its rim must turn at the speed its centre climbs (3 cm/s, half the hand's
  # 6 cm/s, which is also the far strand's 6 cm/s less the climb): ω = v_block / (7 + 0.4) =
  # 0.405 rad/s, i.e. 6.76 rad per metre of hand. Nothing turns the sheave but the rope's friction.
  - {type: ratio, out: j_sheave, in: j_hand, expect: 6.757, tol: 0.6, settle_s: 1.2, window_s: 1.0}
  # Brown's "gain of power": half the weight the rope carries. It hangs 22 kg (block 1.2 + sheave 0.8 +
  # weight 20), so the rope carries 108 N on each side, and the hand's own 0.9 kg already pulls 8.3 N
  # down its own strand, so 100 N is the balance to expect.
  - {type: force, expect: 100, tol: 12, settle_s: 1.2, window_s: 1.0}
  # And the block is seen to rise: 3 cm/s after the rope takes up.
  - {type: position, joint: j_block, min: 0.5, max: 9, settle_s: 1.2, window_s: 1.2}
  - {type: penetration, max: 0.0005, settle_s: 1.2}
camera: {target: [2, 0, 47], position: [34, -186, 54], fov: 30}   # the plate's view: beam, both sheaves, the weight
display:
  output: j_block
  labels: {j_hand: Hand pulling the rope (driver), j_block: Movable block on the rope's two strands, j_fixed: Fixed pulley on its hook, j_sheave: Sheave turning in the block}
  expect: {default: 0.5}