# Mechanism Lab > Play with real mechanisms: gear ratios, clock gear trains and more. Every model is computed from the engineering formulas, with sliders and the maths explained. Every page is a working simulator or calculator: the numbers come from tested models in one shared engine (formulas and test files are named on each page). Every input can be set from the address, as shown under each page ("Link with settings"), so you can link someone straight to a particular setup. The simulators are also available as tools for AI assistants over MCP at https://mechanismlab.pages.dev/mcp (streamable HTTP, no sign-in). Home: https://mechanismlab.pages.dev/ Sitemap: https://mechanismlab.pages.dev/sitemap-index.xml Pages: 49 ## Main pages - [3D print cost calculator: filament, electricity and wear](https://mechanismlab.pages.dev/3d-print-cost-calculator/): Work out what a 3D print really costs: filament by weight, electricity for the print time, machine wear, and an allowance for failed prints. - Inputs: Filament used (g) `grams` 0– (default 50); Spool price `spoolPrice` 0– (default 20); Spool weight (g) `spoolGrams` 0– (default 1000); Print time (hours) `hours` 0– (default 3); Printer power (W) `watts` 0– (default 120); Electricity per kWh `kwhPrice` 0– (default 0.3); Machine wear per hour (nozzle, belts, printer cost spread) `wearPerHour` 0– (default 0.1); Prints that fail (%) `failPct` 0– (default 5) - How it's worked out: Filament = grams used ÷ spool weight × spool price. • Electricity = printer watts ÷ 1000 × hours × price per kWh. A printer's average draw is well below its power supply's rating once the bed is hot; measure it with a plug-in meter if you can. • Wear = an allowance per hour for nozzles, belts and the printer's own cost spread over its life. • Failed prints: if a share of prints fail, each good one carries the cost of the failures: total ÷ (1 − failure rate). | Tested against a hand calculation (packages/mechanics/test/classics.test.ts). Print the parts for every mechanism on this site from their 3D print kits. | Related: Gear generator · Printable clock kit · Lead screw calculator - Link with settings: https://mechanismlab.pages.dev/3d-print-cost-calculator/?grams=50&spoolPrice=20&spoolGrams=1000&hours=3&watts=120&kwhPrice=0.3&wearPerHour=0.1&failPct=5 - [About | Mechanism Lab](https://mechanismlab.pages.dev/about/): How the Mechanism Lab models are made and checked. - [Anchor escapement: how a clock ticks | Mechanism Lab](https://mechanismlab.pages.dev/anchor-escapement/): Watch an anchor escapement let a clock’s escape wheel through one tooth per pendulum period. Change the pendulum length: tick rate and wheel turn time. - Inputs: Pendulum length (cm) `L` 10–100 (default 25) - Outputs: Pendulum period; Ticks; Wheel turns once in - How it works: The wheel is always trying to turn (a weight or spring drives it), but a pallet is always in its way, except for a moment each swing. • Each swing releases the wheel by half a tooth, so it advances one tooth per period of the pendulum: two ticks per tooth. • The pendulum sets the pace: period T = 2π√(L/g) for small swings, so a 25 cm pendulum ticks about twice a second. | This is a simplified drawing: 15 sawtooth teeth, pallets that move straight in and out (real ones swing on arcs), and the pendulum's swing exaggerated so it shows. The small push the wheel gives the pallets each tick, which keeps the pendulum going, isn't modelled. Tested: no tooth overlaps a pallet at any moment over ten swings, the wheel advances exactly one tooth per period, and a version with pallets dipping twice as deep fails that test (packages/mechanics/test/escapement.test.ts). - Link with settings: https://mechanismlab.pages.dev/anchor-escapement/?L=25 - [Beam deflection calculator: simply supported beam, point load](https://mechanismlab.pages.dev/beam-deflection-calculator/): Deflection, bending moment, stress and reactions for a simply supported rectangular beam with a point load anywhere along the span. - Inputs: Span (m) `L` 1–10 (default 4); Load (kN) `P` 0.1–100 (default 10); Load position (% of span) `a` 0–100 (default 50); Beam width (mm) `b` 20–300 (default 100); Beam depth (mm) `h` 20–600 (default 200); Young's modulus E (GPa) `E` 1–400 (default 200) - Outputs: Largest deflection; Where; Deflection as a share of span; Largest bending moment; Largest bending stress; Support reactions - The formulas: Reactions: with the load P a from the left support and b = L − a from the right, R_left = P b ÷ L and R_right = P a ÷ L. • Bending moment: largest under the load, M = P a b ÷ L. Stress at the top and bottom faces: σ = M (h ÷ 2) ÷ I. • Section: a solid rectangle b wide and h deep has I = b h³ ÷ 12. • Deflection (from E I y″ = M, integrated twice with zero deflection at both supports): for x ≤ a, y = P b x (L² − b² − x²) ÷ (6 L E I). With the load at or right of centre (a ≥ b), the largest sag is at x = √((L² − b²) ÷ 3) from the left support, which is always in the longer part of the span; with the load in the middle it is P L³ ÷ (48 E I). | Linear elastic, small deflections, the beam's own weight left out, and the stress is from bending only. For a real structure use your building code's loads and limits. Tested: the reactions balance the load and its moment, and the deflection formulas match a direct numerical double integration of M ÷ E I to one part in a million for loads at three positions (packages/mechanics/test/science.test.ts). - Link with settings: https://mechanismlab.pages.dev/beam-deflection-calculator/?L=4&P=10&a=50&b=100&h=200&E=200 - [Belt length calculator for 2 or 3 pulleys (with drawing)](https://mechanismlab.pages.dev/belt-length-calculator/): Work out the belt length for two or three pulleys from their diameters and centre distances, with the contact angle on each pulley and a to-scale drawing. - Inputs: Pulleys `n` one of 2, 3 (default 2); Diameter (mm or in) `d0` 1– (default 120); Diameter (same unit) `d1` 1– (default 60); Centre distance from A (same unit) `x1` 1– (default 400); Diameter (same unit) `d2` 1– (default 80); Across from A (same unit) `x2` (default 150); Up from A (same unit) `y2` (default 250) - The formula: For two pulleys of radius r₁ and r₂ with centres d apart, an open belt is L = 2√(d² − (r₁ − r₂)²) + r₁(π + 2β) + r₂(π − 2β), where sin β = (r₁ − r₂) ÷ d. The bigger pulley is wrapped by π + 2β radians and the smaller by π − 2β. With three or more pulleys the belt runs straight between each pair and wraps each pulley by its turning angle; the angles add up to one full turn. | This assumes every pulley is on the outside of the loop. A tensioner or idler pressing on the back of the belt changes the length. The calculator uses pitch diameters: for a toothed or V belt, use the pulley's pitch diameter, not its outside diameter. Checked in tests against the two-pulley formula and against equal-pulley loops, whose length is the perimeter of the centres plus one pulley's circumference. | Tested: two equal pulleys give two straight runs plus one circle, unequal pulleys match the open-belt formula, three pulleys’ wraps add up to a full turn with every run tangent at both ends, and a pulley inside the belt is rejected (packages/mechanics/test/drive.test.ts). | Related: Pulley RPM calculator · Chain length calculator · Gear ratio - Link with settings: https://mechanismlab.pages.dev/belt-length-calculator/?n=2&d0=120&d1=60&x1=400&d2=80&x2=150&y2=250 - [Bike gear calculator: gear inches, ratio and speed at any cadence](https://mechanismlab.pages.dev/bike-gear-calculator/): Pick a chainring, cog, wheel and tyre: gear ratio, gear inches, distance per pedal turn and your speed at any cadence, with the drivetrain to scale. - Inputs: Chainring teeth `ring` 22–60 (default 50); Rear cog teeth `cog` 9–42 (default 12); Wheel `wheel` 0–5 (default 0); Tyre width (mm) `tyre` 18–70 (default 25); Cadence (rpm) `cad` 40–130 (default 90) - The formulas: Gear ratio = chainring teeth ÷ cog teeth. The rear wheel turns that many times per pedal turn. • Wheel diameter ≈ rim size (ISO bead seat diameter, e.g. 622 mm for 700c) + 2 × tyre width. Real tyres vary a little with pressure and brand. • Gear inches = wheel diameter in inches × ratio: the size of penny-farthing wheel that would feel the same. • Development = wheel circumference × ratio: metres travelled per pedal turn. • Speed = development × cadence × 60 ÷ 1000 km/h (÷ 1.609 for mph). | The drawing uses the standard bicycle chain pitch of ½ inch (12.7 mm), so each sprocket's size, pitch ÷ sin(180°/teeth), and the wheel are to scale. | Tested: 50/12 on a 700×25 wheel at 90 rpm against a hand calculation, a 1:1 gear moves one wheel circumference per pedal turn, and every sprocket pair and wheel gives a chain line and finite numbers (packages/mechanics/test/bike.test.ts and packages/mechanics/test/ranges.test.ts). | Related: Chain length calculator · Speed from gear ratio · Gear ratio - Link with settings: https://mechanismlab.pages.dev/bike-gear-calculator/?ring=50&cog=12&wheel=0&tyre=25&cad=90 - [Block and tackle calculator: mechanical advantage and pull force](https://mechanismlab.pages.dev/block-and-tackle/): Choose the number of rope segments, the load and friction per pulley to get the pull needed and how much rope you haul, with an animated block and tackle. - Inputs: Rope segments `n` 1–6 (default 4); Load (kg) `kg` 10–500 (default 100); Friction per pulley (%) `loss` 0–10 (default 0) - Outputs: Mechanical advantage; Pull needed; Rope per metre lifted - The formulas: Ideal: pull = load ÷ n, where n is the number of rope segments holding the moving block. Rope pulled = n × height lifted, so the work in equals the work out. • With friction: if each pulley passes on a share η of the tension (η = 1 − loss), the segment tensions fall step by step and the advantage becomes (1 − ηⁿ) ÷ (1 − η). | Weight = mass × 9.81 m/s². Tested: rope length is conserved as the block rises, and the friction formula against a hand calculation (packages/mechanics/test/classics.test.ts). - Link with settings: https://mechanismlab.pages.dev/block-and-tackle/?n=4&kg=100&loss=0 - [Cam and follower: design a rise-dwell-fall cam | Mechanism Lab](https://mechanismlab.pages.dev/cam-and-follower/): Set the lift and the angles for rise, dwell and fall: the cam shape and the follower’s motion update live, with simple-harmonic starts and stops. - Inputs: Lift (mm) `lift` 5–40 (default 20); Rise (°) `rise` 30–180 (default 90); Dwell at top (°) `dwell` 0–120 (default 45); Fall (°) `fall` 30–180 (default 90) - Outputs: Rest at bottom; Lift now - The motion: Simple harmonic rise: s = (h/2)(1 − cos(πθ/β)) over the rise angle β, then a dwell at full lift, a matching fall, and rest for the remainder of the turn. The follower starts and stops without a jump in position. The cam drawn is the pitch curve for a follower in line with the cam centre: radius = base circle + lift at that angle. | Tested: the lift is continuous all the way round and never leaves 0 to h (packages/mechanics/test/classics.test.ts). If rise + dwell + fall come to more than 360°, all three are scaled down to fit one turn, and the readout says so. - Link with settings: https://mechanismlab.pages.dev/cam-and-follower/?lift=20&rise=90&dwell=45&fall=90 - [Chain length calculator: bicycle and motorcycle chain links](https://mechanismlab.pages.dev/chain-length-calculator/): How many links your chain needs: bike chains from chainring, cog and chainstay (Park Tool method), or any two-sprocket drive from teeth and centres. - Inputs: Largest chainring (teeth) `ring` 10– (default 50); Largest cog (teeth) `cog` 9– (default 34); Chainstay length (mm, crank axle to rear axle) `stay` 200– (default 410); Front sprocket (teeth) `front` 5– (default 15); Rear sprocket (teeth) `rear` 5– (default 45); Centre distance (mm) `c` 1– (default 600); Chain pitch `pitch` one of 12.7 (1/2 in (12.7 mm): bicycle, ANSI #40), 9.525 (3/8 in (9.525 mm): ANSI #35), 15.875 (5/8 in (15.875 mm): ANSI #50), 19.05 (3/4 in (19.05 mm): ANSI #60) (default 15.875) - Single-speed, motorcycle or machine chain: Front sprocket (teeth) | Rear sprocket (teeth) | Centre distance (mm) | Chain pitch 1/2 in (12.7 mm): bicycle, ANSI #40 3/8 in (9.525 mm): ANSI #35 5/8 in (15.875 mm): ANSI #50 3/4 in (19.05 mm): ANSI #60 | ANSI chain numbers give the pitch in eighths of an inch in the digits before the last (#40 = 4/8 in). Motorcycle chain sizes such as 520 or 428 are numbered differently: take the pitch from your chain's specification. - Link with settings: https://mechanismlab.pages.dev/chain-length-calculator/?ring=50&cog=34&stay=410&front=15&rear=45&c=600&pitch=15.875 - [Check valve cracking pressure calculator: spring and seat](https://mechanismlab.pages.dev/check-valve/): A spring-loaded check valve lets flow one way: cracking pressure from spring rate, preload and seat size, with the poppet lifting as pressure rises. - Inputs: Spring rate (N/mm) `k` 0.5–10 (default 2); Spring preload (mm) `pre` 1–10 (default 4); Seat diameter (mm) `seat` 5–25 (default 10); Peak upstream pressure (bar) `bar` 0.2–5 (default 2) - Outputs: Cracking pressure; Valve now; Pressure for full lift (6 mm) - The physics: Cracking pressure: the poppet lifts when the pressure difference times the seat area beats the spring's preload force: Δp_crack = k x₀ ÷ A, with A = π d² ÷ 4. • Lift: above that the spring compresses further: lift = (Δp − Δp_crack) A ÷ k, until the poppet reaches its stop. | This is the static balance only: in a real valve the moving flow also pushes on the poppet and the seal touches over a slightly different area, so a measured cracking pressure is close to this but not exact. Tested: the cracking pressure against a hand calculation, and the lift limits (packages/mechanics/test/fluids.test.ts). - Link with settings: https://mechanismlab.pages.dev/check-valve/?k=2&pre=4&seat=10&bar=2 - [Printable clock gears: clock motion work kit (STL, SVG, DXF)](https://mechanismlab.pages.dev/clock-kit/): A free kit for the gears behind a clock’s hands: turn the minute hand and the hour hand follows at 1/12. Every part as STL, SVG or DXF. - Inputs: Clock speed `speed` 1–24 (default 6); Explode `explode` 0–100 (default 45); Turn view `yaw` 0–360 (default 20); Tilt `tilt` 20–80 (default 55) - Parts: Back plate, 4 mm: press the two rods into the centre and minute-wheel holes • Cannon pinion (18 teeth) with minute-hand tube, 4 + 30 mm: turns freely on the centre rod; the minute hand presses onto the top of its tube • Minute wheel (54 teeth), 4 mm: glue to the minute pinion so they turn together on the second rod • Minute pinion (18 teeth, module 1.2), 6 mm • Hour wheel (72 teeth, module 1.2) with hour-hand tube, 4 + 18.5 mm: rides on the cannon pinion tube; the hour hand presses onto its tube • Dial, 2 mm: held by the three pillars; the holes mark the hours • Hour hand, 2 mm: press onto the hour-wheel tube • Minute hand, 2 mm: press onto the cannon pinion tube • Pillar 1, 24 mm: M3 screw through the back plate, pillar and dial • Pillar 2, 24 mm: M3 screw through the back plate, pillar and dial • Pillar 3, 24 mm: M3 screw through the back plate, pillar and dial - Link with settings: https://mechanismlab.pages.dev/clock-kit/?speed=6&explode=45&yaw=20&tilt=55 - [Clock motion work: how the hour hand turns 12× slower](https://mechanismlab.pages.dev/clock-motion-work/): The gears behind a clock’s hands: cannon pinion, minute wheel, minute pinion and hour wheel turn the hour hand 12 times slower, on the same axis. - Inputs: Clock speed `speed` 1–24 (default 12); Dial `dial` 0–100 (default 25) - Outputs: Time shown; Minute hand; Hour hand - How it works: The minute hand sits on the cannon pinion (18 teeth), which turns once an hour. • It drives the minute wheel (54 teeth): a third of the speed. • A minute pinion (18 teeth) on the same arbor drives the hour wheel (72 teeth): a quarter of that. • The hour wheel rides on the cannon pinion's tube, so the hour hand shares the minute hand's centre. | ω_hour = ω_minute × (18/54) × (18/72) = ω_minute / 12 | For the hour wheel to come back to the centre, both pairs need the same centre distance. With module m, the first pair is (18 + 54)·m/2 = 36m apart. The second pair has 18 + 72 = 90 teeth, so its teeth are made smaller, with module 0.8m: 90 × 0.8m / 2 = 36m. This is called a reverted train. | Real clocks use their own tooth counts and often cycloidal teeth; we use involute gears with at least 18 teeth so the drawing is exact (fewer would need undercut at 20°). The arithmetic is the same: the two ratios multiply to 1/12. | Tested: the hour wheel is coaxial with the cannon pinion, 12 turns of the minute hand make one turn of the hour hand in the same direction, and both pairs mesh cleanly at every sampled angle (packages/mechanics/test/clock.test.ts). | Related: Printable clock kit · … - Link with settings: https://mechanismlab.pages.dev/clock-motion-work/?speed=12&dial=25 - [Double pendulum simulator: chaos from a 0.001° difference](https://mechanismlab.pages.dev/double-pendulum/): Three double pendulums released a thousandth of a degree apart stay together, then split completely. Set the starting angles; the energy stays constant. - Inputs: Upper arm start (°) `a1` -179–179 (default 120); Lower arm start (°) `a2` -179–179 (default -10); Difference between pendulums (°, log scale) `diff` -6–0 (default -3) - How it works: Each pendulum is two equal point masses on light 1 m rods under normal gravity, with no friction. The equations of motion are integrated with fourth-order Runge–Kutta in 1 ms steps; the energy-drift readout shows how far the total energy has moved from where it started; in our tests it stays under a millionth over 30 seconds of chaotic swinging. The tests also check that small swings follow the two textbook normal modes, ω² = (g/l)(2 ∓ √2). | With small starting angles the motion is regular and the three stay together. Start the upper arm above about 90° and they part within seconds. | Tested: energy drifts by under a millionth over 30 s of chaotic swinging at 1 ms steps, small swings follow the two normal modes ω² = (g/l)(2 ∓ √2), and starts 0.001° apart end up far apart within 20 s (packages/mechanics/test/pendulum.test.ts). | Related: Pendulum period · Kepler orbit · Projectile motion - Link with settings: https://mechanismlab.pages.dev/double-pendulum/?a1=120&a2=-10&diff=-3 - [Engine piston simulator: crank, connecting rod and four strokes](https://mechanismlab.pages.dev/engine-piston/): Change the crank and connecting rod and watch a piston engine run through its four strokes: stroke, rod angle and piston motion, with the formula. - Inputs: Crank radius r (any unit) `r` 60–140 (default 100); Rod length l (same unit) `l` 180–480 (default 320); Engine speed (rpm) `rpm` 6–60 (default 30) - Outputs: Stroke (2r); Rod ratio l/r; Max rod tilt; Time in lower half; Now - The formula: x = r cos θ + √(l² − r² sin² θ) | x is the distance from the crankshaft to the piston pin, θ the crank angle from the top. With an endlessly long rod this would be a pure sine wave (x = l + r cos θ). A real rod tilts by up to arcsin(r/l), which pulls the piston down further near the top and less near the bottom. So the piston moves faster through the top half and lingers in the bottom half. Make the rod shorter to see the effect grow. | Valve timing here is simplified: each valve opens for exactly half a turn. Real engines open valves early and close them late to help the gas flow. | Tested: the rod keeps its length and the piston stays on the cylinder axis, stroke = 2r, the speed formula matches the numerical derivative, and the piston is past mid-stroke before 90° (packages/mechanics/test/crank.test.ts). | Related: Torque to horsepower · Four-bar linkage · Cam and follower - Link with settings: https://mechanismlab.pages.dev/engine-piston/?r=100&l=320&rpm=30 - [Float valve (ballcock): how a cistern knows when to stop filling](https://mechanismlab.pages.dev/float-valve/): How a cistern float valve shuts off: buoyancy on the float, multiplied by the arm, closes the inlet against the supply pressure. - Inputs: Float diameter (mm) `d` 60–150 (default 110); Lever ratio (float arm ÷ valve arm) `ratio` 4–20 (default 10); Supply pressure (bar) `bar` 0.5–10 (default 3); Inlet hole (mm) `seat` 1.5–6 (default 3) - Outputs: Water pushing the valve open; Float must push up; Shut-off - The physics: Buoyancy (Archimedes): F_b = ρ g V, the weight of the water the float pushes aside. A sphere of radius R sunk to depth h displaces V = π h² (3R − h) ÷ 3. • The water pushing the valve open: F_seat = p × A, the supply pressure times the area of the hole (π d² ÷ 4). • The lever: moments about the pivot balance when (F_b − float weight) × float arm = F_seat × valve arm. A long arm and a small hole let a light float hold back mains pressure. | If the float fully under water still can't beat the supply, the cistern overflows: the readout then gives the highest pressure this float can shut. Float and arm weigh 50 g in this model; water is 1000 kg/m³ and g = 9.81 m/s². Tested: the moments balance at the computed shut-off depth, and the sphere volume formula against slicing the sphere numerically (packages/mechanics/test/fluids.test.ts). - Link with settings: https://mechanismlab.pages.dev/float-valve/?d=110&ratio=10&bar=3&seat=3 - [Four-bar linkage simulator: Grashof rule and coupler curves](https://mechanismlab.pages.dev/four-bar-linkage/): Change the four link lengths and watch a four-bar linkage move: Grashof type, transmission angle and the coupler curve, with links to 3D print. - Inputs: Crank b (mm) `b` 15–60 (default 30); Coupler c (mm) `c` 40–160 (default 100); Rocker d (mm) `d` 30–150 (default 90); Ground a (mm) `a` 60–160 (default 100); Pen offset (mm) `across` -60–60 (default 30); Crank speed (rpm) `rpm` 5–60 (default 20) - Grashof's rule: s + l ≤ p + q | Call the shortest link s, the longest l and the other two p and q. Some link can turn a full circle only if s + l ≤ p + q. Which link is the shortest then decides the motion: the crank shortest gives a crank-rocker (the crank spins, the rocker swings), the ground shortest a double-crank (both spin), the rocker shortest a rocker-crank and the coupler shortest a double-rocker. If s + l > p + q nothing turns fully and every link swings. Here the crank is driven, so when it can't turn fully it swings between the two angles where the coupler and rocker line up. - Link with settings: https://mechanismlab.pages.dev/four-bar-linkage/?b=30&c=100&d=90&a=100&across=30&rpm=20 - [Gear generator: involute spur gears as SVG, DXF or a template](https://mechanismlab.pages.dev/gear-generator/): Make a matching pair of involute spur gears for 3D printing, laser cutting or CNC: teeth, module, pressure angle, backlash and bore; SVG or DXF in mm. - Inputs: Gear A teeth `za` 12–120 (default 20); Gear B teeth `zb` 12–120 (default 40); Module (mm) `m` 0.5–6 (default 2); Pressure angle (°) `alpha` 0–2 (default 1); Backlash (mm) `j` 0–0.5 (default 0.15); Bore A / B (mm) `bore` 0–20 (default 5) - Using the files: SVG and DXF are in millimetres at true size: import them into your CAD, slicer or laser software without scaling. Each gear has its outline, a bore circle and a centre mark. • Print 1:1 opens a template sized in millimetres. Print at 100% ("actual size"), then measure the 50 mm scale bar to check your printer didn't resize it. • Centre distance is (z A + z B) × module / 2. Mount the axles exactly that far apart. • Backlash thins every tooth by that much at the pitch circle so the gears don't bind. For 3D-printed gears 0.1–0.2 mm is a common starting point; machined gears need less. - Link with settings: https://mechanismlab.pages.dev/gear-generator/?za=20&zb=40&m=2&alpha=1&j=0.15&bore=5 - [Gear ratio simulator: teeth, speed and torque | Mechanism Lab](https://mechanismlab.pages.dev/gear-ratio/): Change the tooth counts, stages and input speed, and watch real involute gears turn: live output speed, torque and direction, with the formulas. - Inputs: Driving gear teeth `z1` 18–40 (default 18); Driven gear teeth `z2` 18–96 (default 54); Stages `stages` 1–3 (default 1); Input speed (rpm) `rpm` 2–40 (default 20) - Outputs: Ratio per stage; Overall speed ratio; Output speed; Output torque; Output turns; Contact ratio - The formulas: ω_2 = ω_1 × z_1 / z_2 per stage, multiplied across stages | Where two gears touch, their teeth move at the same speed: v = ω_1 r_1 = ω_2 r_2. The pitch radius is proportional to the number of teeth (r = m·z/2 for module m), so the speeds are in the inverse ratio of the teeth. | T_out = T_in × (z_2 / z_1)^stages (no friction) | Power is torque × speed, and an ideal gear neither makes nor loses power, so whatever speed you give up comes back as torque. Real spur gears lose a little to friction at each mesh. | Each meshing pair turns in opposite directions, so the output direction flips with every stage. With several stages, the next small gear is fixed to the same axle as the big gear before it, in a different layer. | ε = (√(r_a1 ² − r_b1 ²) + √(r_a2 ² − r_b2 ²) − a·sin α) / (π m cos α) | The contact ratio ε is the average number of tooth pairs touching. Above 1, a new pair takes over before the last one lets go, so the motion is smooth. Gears with fewer than 18 teeth at 20° (2 ÷ sin² 20° = 17.1) need their tooth roots cut back (undercut), so the sliders start at 18. | Tested: with backlash the teeth never overlap, the speed ratio, centre distance and contact ratio, and every tooth … - Link with settings: https://mechanismlab.pages.dev/gear-ratio/?z1=18&z2=54&stages=1&rpm=20 - [Geneva drive: continuous turning into stop-start steps](https://mechanismlab.pages.dev/geneva-drive/): A Geneva drive turns steady rotation into steps: the slotted wheel jumps one slot per crank turn and rests in between. Change the number of slots. - Inputs: Slots `n` 3–8 (default 4); Crank speed (rpm) `rpm` 5–60 (default 20) - Outputs: Step per turn; Moving; Resting - The geometry: With centre distance c and n slots, the pin circle radius is r = c sin(π/n), so the pin enters each slot along the slot: no knock. • The wheel moves while the crank turns 180° − 360°/n, so it moves for (n − 2) ÷ 2n of each turn and rests for the rest: 25% moving with 4 slots. • Wheel angle while engaged: φ = atan2(r sin α, c − r cos α), α the crank angle from the line of centres. | Tested: tangential entry, one slot per turn and the moving share, for 4, 5, 6 and 8 slots (packages/mechanics/test/classics.test.ts). The locking disc is drawn as a simple circle. - Link with settings: https://mechanismlab.pages.dev/geneva-drive/?n=4&rpm=20 - [Go-kart gear ratio calculator: top speed from sprockets and rpm](https://mechanismlab.pages.dev/go-kart-gear-ratio-calculator/): Enter your clutch and axle sprocket teeth, engine rpm and tyre diameter to get the gear ratio and top speed, plus a table of speeds for other axle sprockets. - Inputs: Clutch sprocket teeth `clutch` 5–30 (default 12); Axle sprocket teeth `axle` 20–120 (default 60); Engine rpm (max) `rpm` 500–20000 (default 3600); Rear tyre diameter (inches) `tyre` 5–30 (default 11) - How it works: Gear ratio = axle teeth ÷ clutch teeth. A 60-tooth axle sprocket with a 12-tooth clutch is 5:1: the engine turns five times per wheel turn. • Wheel rpm = engine rpm ÷ ratio. • Top speed (mph) = wheel rpm × π × tyre diameter (inches) × 60 ÷ 63,360. For 3,600 rpm, 12/60 and an 11-inch tyre that is 23.6 mph. | This is the speed the gearing allows at that rpm, on a tyre of that size. Real top speed is also limited by power, weight, drag and the track, and tyres grow a little at speed. Bigger axle sprockets (or smaller clutch sprockets) give more acceleration and a lower top speed. Formulas tested against hand calculations. | Tested: 3,600 rpm with a 12-tooth clutch, 60-tooth axle and 11-inch tyre gives 23.56 mph, against a hand calculation (packages/mechanics/test/drive.test.ts). | Related: Speed from gear ratio · Sprocket ratio calculator · Chain length calculator - Link with settings: https://mechanismlab.pages.dev/go-kart-gear-ratio-calculator/?clutch=12&axle=60&rpm=3600&tyre=11 - [Hydraulic press calculator: Pascal's law, force and travel](https://mechanismlab.pages.dev/hydraulic-press/): Pascal's law in action: a small piston pushes a big one. Get the force multiplication, the oil pressure and how far the ram moves for each pump stroke. - Inputs: Pump piston diameter (mm) `pump` 10–50 (default 20); Ram diameter (mm) `ram` 40–200 (default 100); Push on the pump (N) `force` 50–500 (default 200) - Outputs: Force multiplied by; Ram force; Oil pressure; Ram travel - The physics: Pascal's law: p = F₁ ÷ A₁ = F₂ ÷ A₂, so F₂ = F₁ × (A₂ ÷ A₁) = F₁ × (D₂ ÷ D₁)². • No free lunch: the oil pushed out of the pump fills the ram, A₁ s₁ = A₂ s₂, so the ram moves (D₁ ÷ D₂)² as far. Work in, F₁ s₁, equals work out, F₂ s₂. | Ignores seal friction and the weight of the oil. Tested: force times travel is the same on both sides (packages/mechanics/test/fluids.test.ts). - Link with settings: https://mechanismlab.pages.dev/hydraulic-press/?pump=20&ram=100&force=200 - [Idler gear: same ratio, opposite direction | Mechanism Lab](https://mechanismlab.pages.dev/idler-gear/): Add idler gears between a driver and a driven gear and watch the direction flip while the speed ratio stays the same. Change every tooth count. - Inputs: Driver teeth `a` 18–40 (default 16); Idlers `n` 0–3 (default 1); Idler teeth `i` 18–40 (default 24); Driven teeth `b` 18–40 (default 32) - Outputs: Output ÷ input speed; Output turns - Why: At each mesh the pitch-circle speeds are equal, so each gear's speed is the previous one's × (its teeth ÷ this gear's teeth), with the direction reversed. Multiply along the row and every idler's teeth cancel: output ÷ input = (−1)^meshes × driver teeth ÷ driven teeth. Tested for idlers of different sizes (packages/mechanics/test/classics.test.ts). - Link with settings: https://mechanismlab.pages.dev/idler-gear/?a=16&n=1&i=24&b=32 - [Kepler's second law simulator: equal areas in equal times](https://mechanismlab.pages.dev/kepler-orbit/): A planet on an elliptical orbit sweeps equal areas in equal times. Change the eccentricity and watch it race near the Sun and crawl far out. - Inputs: Eccentricity × 100 `e` 0–95 (default 60); Seconds per orbit `p` 4–30 (default 12) - Outputs: Fastest ÷ slowest speed; Farthest ÷ nearest - The maths: Kepler's equation M = E − e sin E gives where the planet is at any time (M grows steadily with time; E is solved by Newton's method). • Position from the Sun: x = a(cos E − e), y = b sin E, with b = a√(1 − e²). • Speed at closest approach ÷ speed farthest out = (1 + e) ÷ (1 − e), the same as the ratio of the distances. | Tested: Kepler's equation is solved to 10⁻¹², and twelve equal time slices sweep equal areas to 10⁻⁶ (packages/mechanics/test/classics.test.ts). The wedges on screen are those twelve slices. - Link with settings: https://mechanismlab.pages.dev/kepler-orbit/?e=60&p=12 - [Lead screw calculator: steps per mm, speed and torque](https://mechanismlab.pages.dev/lead-screw-calculator/): Lead screw pitch and starts give the lead; add your stepper’s steps and microsteps for steps/mm (3D printer, CNC), travel speed and torque. - Inputs: Thread pitch (mm) `pitch` 0– (default 2); Starts `starts` 1– (default 4); Motor steps per turn `steps` 1– (default 200); Microsteps `micro` 1– (default 16); Screw rpm (optional) `rpm` 0– (default 300); Load force (N, optional) `force` 0– (default 100); Screw efficiency (%) `eff` 1–100 (default 40) - The formulas: Lead = pitch × starts: a screw with 2 mm pitch and 4 starts moves the nut 8 mm per turn. Steps per mm = motor steps per turn × microsteps ÷ lead, so 200 × 16 ÷ 8 = 400. Travel speed = rpm × lead. | Torque comes from balancing work: one turn puts in torque × 2π and moves the load by one lead, so torque = force × lead ÷ (2π × efficiency). Efficiency depends on the thread, nut material and lubrication; the 40% default is only a placeholder, so use your screw's datasheet value. The result doesn't include the torque to accelerate the load or to overcome preload. | Tested: a T8 screw with 2 mm pitch and 4 starts has an 8 mm lead and needs 400 steps/mm at 200 steps × 16 microsteps (packages/mechanics/test/maker.test.ts). | Related: Rack and pinion · Worm drive · 3D print cost calculator - Link with settings: https://mechanismlab.pages.dev/lead-screw-calculator/?pitch=2&starts=4&steps=200µ=16&rpm=300&force=100&eff=40 - [Lens equation calculator: image distance and magnification](https://mechanismlab.pages.dev/lens-equation-calculator/): Thin lens equation for converging and diverging lenses: where the image forms, how big, which way up, and whether it is real or virtual, with the rays. - Inputs: Lens `type` one of 1 (converging), 2 (diverging) (default 1); Focal length (cm) `f` 2–40 (default 10); Object distance (cm) `d` 1–100 (default 30); Object height (cm) `h` 1–10 (default 2) - Outputs: Image distance; Magnification; Image height; Lens power - The formulas: Thin lens equation: 1 ÷ f = 1 ÷ d_o + 1 ÷ d_i, so d_i = f d_o ÷ (d_o − f). • Signs (real is positive): f is positive for a converging lens and negative for a diverging one. A positive d_i is a real image on the far side, which you can catch on a screen; a negative one is a virtual image on the object's side, seen by looking through the lens. • Magnification: m = −d_i ÷ d_o; image height = m × object height. A negative m means upside down. • Power: P = 1 ÷ f with f in metres, in dioptres (the unit on glasses prescriptions). | A thin lens in air, rays close to the axis, and no aberrations. An object at the focal point sends parallel rays out, so no image forms. Inside the focal length a converging lens gives a virtual, upright, bigger image; a diverging lens always gives a virtual, upright, smaller one. Tested: the equation against tracing the two rays for converging and diverging lenses, and both of those statements over the whole range of distances (packages/mechanics/test/science.test.ts). - Link with settings: https://mechanismlab.pages.dev/lens-equation-calculator/?type=1&f=10&d=30&h=2 - [Moment of inertia calculator: rectangle, tube and I-beam sections](https://mechanismlab.pages.dev/moment-of-inertia-calculator/): Second moment of area, section modulus, area and radius of gyration for rectangles, box sections, round bars, tubes and I-beams, with the formulas. - Inputs: Shape `shape` one of 1 (rectangle), 2 (box), 3 (round bar), 4 (tube), 5 (I-beam) (default 5); Width (mm) `b` 10–300 (default 100); Depth or diameter (mm) `h` 10–600 (default 200); Wall or flange thickness (mm) `t` 1–50 (default 10) - Outputs: Section; Second moment of area I; Section modulus Z = I ÷ c; Area; Radius of gyration - The formulas: Definition: I = ∫ y² dA, every bit of area times the square of its distance from the bending axis. • Rectangle b wide, h deep: I = b h³ ÷ 12. Box with wall t: the outer rectangle minus the hole, (b h³ − (b − 2t)(h − 2t)³) ÷ 12. • Round bar of diameter d: I = π d⁴ ÷ 64. Tube: π (d⁴ − (d − 2t)⁴) ÷ 64. • I-beam with flanges and web all t thick: the b × h block minus the two side gaps, (b h³ − (b − t)(h − 2t)³) ÷ 12. • Section modulus Z = I ÷ c, with c the distance to the outer edge: bending stress is M ÷ Z. Radius of gyration r = √(I ÷ A). | Bending about the horizontal axis through the centre. Round shapes use the depth as the diameter and ignore the width. The I-beam here has sharp corners and one thickness throughout; rolled steel sections have fillets and thicker flanges, so take their values from the maker's tables. Tested: every shape's formula against integrating y² over the shape slice by slice, to one part in a million (packages/mechanics/test/science.test.ts). - Link with settings: https://mechanismlab.pages.dev/moment-of-inertia-calculator/?shape=5&b=100&h=200&t=10 - [Pendulum period calculator: exact vs small-angle formula](https://mechanismlab.pages.dev/pendulum-period/): The exact period of a pendulum at any swing angle, compared with the textbook T = 2π√(L/g). Watch both swing side by side and see the error grow. - Inputs: Length (cm) `L` 10–300 (default 100); Swing (°) `amp` 1–175 (default 60) - Outputs: Exact period; Small-angle formula; Difference - The formula: Exact: T = 4√(L/g) · K(sin(θ₀/2)), where K is the complete elliptic integral of the first kind, computed here with the arithmetic–geometric mean. Small-angle: T₀ = 2π√(L/g). Point mass, light rod, no friction, g = 9.81 m/s². | Tested: K matches its power series, and the exact period matches a direct simulation of the swing at 30°, 90° and 150° to 0.2 ms (packages/mechanics/test/classics.test.ts). The orange pendulum is simulated from the equation of motion; the grey one follows the small-angle formula. - Link with settings: https://mechanismlab.pages.dev/pendulum-period/?L=100&=60 - [Planetary gear simulator: sun, planets, ring and carrier](https://mechanismlab.pages.dev/planetary-gears/): Pick the teeth, the number of planets and which part is held, and watch a planetary gearset turn: speeds from Willis’ equation and which sets fit. - Inputs: Sun teeth `zs` 18–40 (default 24); Planet teeth `zp` 18–30 (default 18); Planets `n` 2–6 (default 3); Held part `held` 0–3 (default 0) - The formula: (ω s − ω c) / (ω r − ω c) = −z r / z s | This is Willis' equation. Seen from the carrier, the gears are an ordinary train: the sun drives a planet, the planet drives the ring, and the ring turns the other way at z s /z r of the sun's speed. Hold one part (set its ω to 0) and the equation gives the other two: | • Ring held, sun in, carrier out: ω c = ω s × z s / (z s + z r). The biggest reduction. • Carrier held, sun in, ring out: ω r = −ω s × z s / z r. Reversed. • Sun held, ring in, carrier out: ω c = ω r × z r / (z s + z r). • Two locked together: everything turns at the same speed, 1: 1. - Link with settings: https://mechanismlab.pages.dev/planetary-gears/?zs=24&zp=18&n=3&held=0 - [Pressure relief valve: set pressure from spring and seat](https://mechanismlab.pages.dev/pressure-relief-valve/): How a spring-loaded pressure relief valve works: set pressure from spring rate, preload and seat diameter, and how far the pressure rises above it at full lift. - Inputs: Spring rate (N/mm) `k` 0.5–20 (default 2); Spring preload (mm) `pre` 2–15 (default 6); Seat diameter (mm) `seat` 3–15 (default 5); Full lift (mm) `lift` 1–5 (default 2) - Outputs: Set pressure; Pressure at full lift; Above set at full lift - The physics: Set pressure: p_set = k x₀ ÷ A, the spring's preload force over the seat area. • Full lift: to open all the way the spring compresses by the lift as well, so the pressure must rise to k (x₀ + lift) ÷ A. A stiff spring with little lift keeps that overshoot small. | Real relief valves add features this static model leaves out (such as a larger area for the escaping flow to push on, so they snap open), and safety valves are sized and certified to standards: don't set a real one from a calculator. Tested: the set pressure against a hand calculation, and lift that rises linearly above it and stops at full lift (packages/mechanics/test/fluids.test.ts). - Link with settings: https://mechanismlab.pages.dev/pressure-relief-valve/?k=2&pre=6&seat=5&lift=2 - [Projectile motion calculator with air resistance | Mechanism Lab](https://mechanismlab.pages.dev/projectile-motion-calculator/): Range, peak height, flight time and impact speed from launch speed, angle and height, with air drag or without, simulated and drawn to scale. - Inputs: Launch speed (m/s) `v` 1–60 (default 30); Launch angle (°) `angle` -45–85 (default 35); Launch height (m) `h` 0–50 (default 1); Drag coefficient × 100 (0 = no air) `cd` 0–100 (default 50); Ball diameter (mm) `d` 20–300 (default 74); Ball mass (g) `m` 1–5000 (default 145) - Outputs: Range; Range with no air; Highest point; Time in the air; Lands at; Terminal speed - The physics: No air: x = v cos θ · t, y = h + v sin θ · t − ½ g t². From the ground the range is v² sin 2θ ÷ g; from a height h the flight lasts t = (v sin θ + √((v sin θ)² + 2 g h)) ÷ g. • With air: drag pushes against the motion with F = ½ ρ C_d A v², where A = π d² ÷ 4 is the ball's cross-section. There's no formula for the path, so it is integrated with fourth-order Runge–Kutta in steps of 2 ms or less. • Terminal speed: falling straight down, drag balances weight at v_t = √(m g ÷ (½ ρ C_d A)). | Air density ρ = 1.227 kg/m³, from NASA Glenn's standard-atmosphere model at sea level ( Earth atmosphere model), and g = 9.81 m/s². NASA gives a sphere's drag coefficient as anywhere from 0.07 to 0.5 depending on the flow ( Shape effects on drag); 0.5 is the default here. Spin, wind and a drag coefficient that changes with speed are left out. Tested: with no air the simulation matches the formulas above to a micrometre; with air it doesn't change when the time step is halved, the ball's energy only ever falls, and a straight drop follows the exact v_t tanh(g t ÷ v_t) curve (packages/mechanics/test/science.test.ts). - Link with settings: https://mechanismlab.pages.dev/projectile-motion-calculator/?v=30&angle=35&h=1&cd=50&d=74&m=145 - [Pulley RPM calculator: speed, ratio and pulley size](https://mechanismlab.pages.dev/pulley-rpm-calculator/): Driven pulley rpm from both pulley diameters and the motor speed, with the ratio and belt speed, or the pulley size you need for a target rpm. - Inputs: Driver pulley diameter (mm or in) `d1` 0– (default 100); Driver speed (rpm) `rpm` 0– (default 1750); Driven pulley diameter (same unit) `d2` 0– (default 250); Target rpm (optional) `want` 0– - The formula: A belt that doesn't slip moves at the same speed round both pulleys, so driver rpm × driver diameter = driven rpm × driven diameter. The driven speed is driver rpm × D₁ ÷ D₂, and the pulley needed for a target speed is D₁ × driver rpm ÷ target rpm. Belt speed is π × D₁ × rpm. | Use the same unit for both diameters. For V-belts and toothed belts use the pitch diameter, where the belt actually runs, rather than the outside diameter. A belt can slip a little under load, which makes the driven pulley turn slightly slower than this. | Tested: 100 mm at 1,750 rpm driving 250 mm gives 700 rpm, against a hand calculation (packages/mechanics/test/maker.test.ts). | Related: Belt length calculator · Gear ratio · Torque to horsepower - Link with settings: https://mechanismlab.pages.dev/pulley-rpm-calculator/?d1=100&rpm=1750&d2=250 - [Rack and pinion calculator: travel per turn and rack speed](https://mechanismlab.pages.dev/rack-and-pinion/): Pick the module, pinion teeth and speed to see how far the rack moves per turn and how fast, with the pinion and rack animated to scale. - Inputs: Module (mm) `m` 1–4 (default 2); Pinion teeth `z` 18–40 (default 18); Pinion speed (rpm) `rpm` 1–60 (default 10) - Outputs: Pitch radius; Travel per turn; Rack speed - The formula: Pitch radius r = m × z ÷ 2. • Travel per turn = 2πr = π × m × z, the same as the rack's tooth pitch (π m) times the number of teeth. • Rack speed = travel per turn × rpm ÷ 60. | Tested: travel per turn equals π m z for every slider setting (packages/mechanics/test/classics.test.ts). Teeth are drawn as simple blocks at the true pitch, not exact involute profiles. - Link with settings: https://mechanismlab.pages.dev/rack-and-pinion/?m=2&z=18&rpm=10 - [RC circuit calculator: time constant, charging and discharging](https://mechanismlab.pages.dev/rc-circuit-calculator/): RC time constant, time to 99% charge, starting current and stored energy from resistance, capacitance and voltage, with the curve animated. - Inputs: Resistance (kΩ) `R` 0.1–1000 (default 10); Capacitance (µF) `C` 1–1000 (default 100); Supply (V) `V` 1–24 (default 9) - Outputs: Time constant τ = RC; Time to 99%; Current at the start; Energy stored when full; Charge when full - The formulas: Time constant: τ = R × C (ohms × farads = seconds). • Charging from empty: V_C (t) = V_s (1 − e^−t/τ). Time to reach a fraction f of the supply: t = −τ ln(1 − f), so 99% takes about 4.6 τ. • Discharging from V_0: V_C (t) = V_0 e^−t/τ. • Current at the start: V_s ÷ R. Stored when full: charge Q = C V_s and energy ½ C V_s ². | Ideal parts: no leakage in the capacitor and no resistance in the supply or wires. The animation charges for 5 τ, then discharges for 5 τ, and runs that in 6 seconds however long it really takes. Tested: the formulas against stepping the circuit equation dV/dt = (V_s − V) ÷ RC numerically (packages/mechanics/test/science.test.ts). - Link with settings: https://mechanismlab.pages.dev/rc-circuit-calculator/?R=10&C=100&V=9 - [Siphon calculator: flow speed, flow rate and how high it can go](https://mechanismlab.pages.dev/siphon/): How a siphon works: flow speed and flow rate from the drop, the pressure at the crest, and the highest crest a siphon can get water over. - Inputs: Outlet below the surface (m) `drop` 0.1–3 (default 1); Crest above the surface (m) `rise` 0.1–12 (default 2); Tube bore (mm) `tube` 5–30 (default 12) - Outputs: Exit speed; Flow; Pressure at the crest; Highest crest that works - The physics: Speed (Bernoulli from the still surface to the outlet): v = √(2 g h), where h is how far the outlet is below the surface. Flow = v × tube area. • Pressure at the crest: p = p_atm − ρ g z − ½ ρ v², where z is the crest's height above the surface. It can't go below zero, so with no flow the crest can be at most p_atm ÷ (ρ g) ≈ 10.3 m above the surface, and less in practice because water starts to boil at very low pressure. | Ideal flow: friction in a real tube lowers the speed, most in long or narrow tubes. Standard atmosphere 101.325 kPa. Tested: the crest pressure and the height limit (packages/mechanics/test/fluids.test.ts). - Link with settings: https://mechanismlab.pages.dev/siphon/?drop=1&rise=2&tube=12 - [Snell's law calculator: refraction angle and critical angle](https://mechanismlab.pages.dev/snells-law-calculator/): Light crossing from one medium to another: the refraction angle from Snell's law, the critical angle for total internal reflection, and how much is reflected. - Inputs: Index of the first medium (n₁) `n1` 1–2.5 (default 1); Index of the second medium (n₂) `n2` 1–2.5 (default 1.5); Angle of incidence (°) `angle` 0–89 (default 40) - Outputs: Refraction angle; Critical angle; Share reflected; Bent by - The physics: Snell's law: n₁ sin θ₁ = n₂ sin θ₂, with both angles measured from the perpendicular to the surface (the dashed line). • Critical angle: going from a higher index to a lower one, θ_c = arcsin(n₂ ÷ n₁). Beyond it sin θ₂ would have to exceed 1, so there is no refracted ray: total internal reflection. • How much reflects (Fresnel equations, unpolarised light): the average of R_s = ((n₁ cos θ₁ − n₂ cos θ₂) ÷ (n₁ cos θ₁ + n₂ cos θ₂))² and R_p = ((n₁ cos θ₂ − n₂ cos θ₁) ÷ (n₁ cos θ₂ + n₂ cos θ₁))². Head on it is ((n₁ − n₂) ÷ (n₁ + n₂))², and it rises to 100% at grazing angles. | Smooth surfaces, no absorption, light of one wavelength. Snell's law is also the path that takes light the least time between two points (Fermat's principle). Tested: the law against finding that quickest path numerically, the critical angle and total internal reflection, and the Fresnel reflectance head on and at grazing incidence (packages/mechanics/test/science.test.ts). - Link with settings: https://mechanismlab.pages.dev/snells-law-calculator/?n1=1&n2=1.5&angle=40 - [Speed from gear ratio: road speed in every gear from rpm](https://mechanismlab.pages.dev/speed-from-gear-ratio/): Road speed in every gear from engine rpm, gearbox ratios, final drive and tyre size. For cars, motorbikes and anything with a gearbox. - Inputs: Engine rpm `rpm` 100–20000 (default 3000); Gear ratios (comma separated) `gears` (default 3.6, 2.1, 1.4, 1.0, 0.8); Final drive ratio `final` 0.5–10 (default 3.5); Tyre diameter (mm) `tyre` 200–1500 (default 650) - The formula: Overall ratio = gear ratio × final drive. The engine turns that many times for each turn of the wheels. • Wheel rpm = engine rpm ÷ overall ratio. • Speed (km/h) = wheel rpm × π × tyre diameter (mm) × 60 ÷ 1,000,000; divide by 1.609 for mph. | Example: 3,000 rpm in a 0.8 top gear with a 3.5 final drive on a 650 mm tyre is 131.3 km/h. This ignores clutch or torque-converter slip and tyre growth. Formulas tested against hand calculations. | Tested: 3,000 rpm in a 0.8 top gear with a 3.5 final drive on a 650 mm tyre, against a hand calculation (packages/mechanics/test/drive.test.ts). | Related: Go-kart gear ratio calculator · Bike gear calculator · Torque to horsepower - Link with settings: https://mechanismlab.pages.dev/speed-from-gear-ratio/?rpm=3000&gears=3.6%2C%202.1%2C%201.4%2C%201.0%2C%200.8&final=3.5&tyre=650 - [Spring–mass–damper simulator: natural frequency and damping ratio](https://mechanismlab.pages.dev/spring-mass-damper/): A mass on a spring with a damper: natural frequency, damping ratio, period and settling time, and the motion over time, underdamped, critical or overdamped. - Inputs: Mass (kg) `m` 0.1–10 (default 1); Spring stiffness (N/m) `k` 10–5000 (default 400); Damping (N·s/m) `c` 0–200 (default 4); Pulled down by (mm) `x0` 1–100 (default 50) - Outputs: Natural frequency; Damping ratio ζ; Period of the swings; Settles within 2% in; Critical damping - The physics: Equation of motion: m ẍ + c ẋ + k x = 0. • Natural frequency: ω_n = √(k ÷ m), f_n = ω_n ÷ 2π. A stiffer spring or a lighter mass oscillates faster. • Damping ratio: ζ = c ÷ (2 √(k m)). Critical damping is c = 2 √(k m), where ζ = 1. • Underdamped (ζ < 1), released from x₀ at rest: x(t) = x₀ e^−ζω_n t (cos ω_d t + (ζω_n ÷ ω_d) sin ω_d t), with ω_d = ω_n √(1 − ζ²). The swings shrink inside e^−ζω_n t, which falls to 2% after ln 50 ÷ (ζ ω_n). • Critical and overdamped (ζ ≥ 1): no swinging; x(t) is a sum of decaying exponentials and never crosses the rest position. Its settling time is found by solving x(t) = 2% of x₀. | A linear spring, a viscous damper (force proportional to speed) and no gravity offset (the rest position already includes the spring's stretch under the weight). Tested: the exact solutions against step-by-step integration (fourth-order Runge–Kutta) with no damping, light damping, critical damping and heavy damping, that the motion only crosses rest when ζ < 1, and that heavy damping returns more slowly than critical (packages/mechanics/test/science.test.ts). - Link with settings: https://mechanismlab.pages.dev/spring-mass-damper/?m=1&k=400&c=4&x0=50 - [Spring rate calculator for coil springs (wire size and coils)](https://mechanismlab.pages.dev/spring-rate-calculator/): Spring rate of a helical compression spring from wire diameter, outside diameter, active coils and the wire's shear modulus, in N/mm and lbf/in. - Inputs: Wire diameter (mm) `d` 0– (default 2.5); Outside diameter (mm) `od` 0– (default 25); Active coils `n` 0– (default 8); Shear modulus G (GPa) `g` 0– (default 79.3) - The formula: k = G × d⁴ ÷ (8 × D³ × n), where d is the wire diameter, D the mean coil diameter (outside diameter minus one wire diameter), n the number of active coils and G the wire's shear modulus. With d and D in mm and G in N/mm² (GPa × 1,000), k is in N/mm. | The default G of 79.3 GPa is music wire: AJ Designer lists 11.5 × 10⁶ psi, which is 79.3 GPa. Other spring steels and stainless differ, so use your wire maker's figure. Rate rises with the fourth power of the wire diameter, so measure it carefully. Checked against AJ Designer's worked example (G 11.5 × 10⁶ psi, d 0.1 in, D 1 in, 10 coils gives 14.375 lbf/in). | Source: AJ Designer, suspension spring rate. Mountain-bike shock springs are usually chosen from rider weight and sag instead; this page is for a spring you can measure. | Tested: against AJ Designer’s worked example: G = 11.5 × 10⁶ psi, 0.1 in wire, 1 in coil and 10 active coils give 14.375 lbf/in (packages/mechanics/test/maker.test.ts). | Related: Spring–mass–damper · Check valve · Pendulum period - Link with settings: https://mechanismlab.pages.dev/spring-rate-calculator/?d=2.5&od=25&n=8&g=79.3 - [Sprocket ratio calculator: motorcycle gearing and top speed](https://mechanismlab.pages.dev/sprocket-ratio-calculator/): Front and rear sprocket teeth, primary and gear ratio, engine rpm and tyre size give road speed and final drive. See what changing a sprocket by a tooth does. - Inputs: Front sprocket (teeth) `front` 1– (default 15); Rear sprocket (teeth) `rear` 1– (default 45); Engine rpm `rpm` 0– (default 9000); Rear tyre size `tyre` (default 180/55ZR17); Primary ratio `primary` 0– (default 1); Gear ratio `gear` 0– (default 1); New front (optional) `nfront` 1–; New rear (optional) `nrear` 1– - The formula: Final drive = rear teeth ÷ front teeth. Overall reduction = primary × gear × final drive, so the wheel turns engine rpm ÷ overall times a minute, and road speed = wheel rpm × tyre circumference. The tyre diameter comes from its size: for 180/55-17 that's 17 × 25.4 mm of rim plus two sidewalls of 180 × 55%, 629.8 mm in all. | Changing sprockets changes road speed at a given rpm by (new front ÷ new rear) ÷ (old front ÷ old rear) − 1. Your bike's primary and per-gear ratios are in its service manual. Results are theoretical: tyres grow at speed and squash under load, and an engine may not reach a given rpm in top gear. | Tested: tyre sizes 120/70-17 (599.8 mm) and 180/55ZR17 (629.8 mm), and 15/45 sprockets with a 1.5 primary in a 1.0 gear at 9,000 rpm, against hand calculations (packages/mechanics/test/maker.test.ts). | Related: Go-kart gear ratio calculator · Speed from gear ratio · Chain length calculator - Link with settings: https://mechanismlab.pages.dev/sprocket-ratio-calculator/?front=15&rear=45&rpm=9000&tyre=180%2F55ZR17&primary=1&gear=1 - [Tank drain time calculator: Torricelli's law | Mechanism Lab](https://mechanismlab.pages.dev/tank-drain-time/): How long a tank takes to empty through a hole in the bottom: Torricelli's law, the falling flow, the time to half the depth and to empty. - Inputs: Tank diameter (cm) `D` 10–100 (default 30); Hole diameter (mm) `hole` 2–30 (default 10); Starting depth (cm) `h` 10–200 (default 50); Discharge coefficient (%) `cd` 50–100 (default 100) - Outputs: Time to empty; Time to half the depth; Flow at the start - The physics: Torricelli's law: the jet speed is v = √(2 g h) for a depth h above the hole. • The level: the tank loses what the hole lets out, A dh/dt = −C_d a √(2 g h), which gives h(t) = (√h₀ − (C_d a ÷ A) √(g ÷ 2) t)². • Time to empty: t = (A ÷ (C_d a)) √(2 h₀ ÷ g). The depth halves after 1 − 1/√2 ≈ 29% of that time. | C_d = 100% is an ideal hole; real holes let out less (the jet narrows just outside a sharp-edged hole), so set it lower to match a tank you've timed. Tested: the formula against integrating the level step by step (packages/mechanics/test/fluids.test.ts). - Link with settings: https://mechanismlab.pages.dev/tank-drain-time/?D=30&hole=10&h=50&cd=100 - [Torque to horsepower calculator (and horsepower to torque)](https://mechanismlab.pages.dev/torque-to-horsepower-calculator/): Convert torque and rpm to horsepower and kW, or power and rpm back to torque, in N·m or lb·ft. Shows why torque and horsepower cross at 5,252 rpm. - Inputs: Convert `mode` one of torque (Torque → power), power (Power → torque) (default torque); Torque `torque` 0– (default 300); Unit `tunit` one of nm (N·m), lbft (lb·ft) (default nm); Power `power` 0– (default 150); Unit `punit` one of kw (kW), hp (default kw); rpm `rpm` 0– (default 4000) - The formulas: Power = torque × angular speed. In metric, kW = N·m × rpm × 2π ÷ 60,000 (about N·m × rpm ÷ 9,549). In imperial, one horsepower is 33,000 ft·lbf per minute, so hp = lb·ft × rpm ÷ 5,252 (33,000 ÷ 2π = 5,252.1). So when torque is in lb·ft and power in hp, the two numbers are equal at 5,252 rpm. | Horsepower here is mechanical (imperial) horsepower: 550 ft·lbf per second, 745.7 W. | Tested: hp = lb·ft × rpm ÷ 5,252.11, so at 5,252 rpm horsepower and lb·ft are equal (packages/mechanics/test/maker.test.ts). | Related: Engine piston · Speed from gear ratio · Pulley RPM calculator - Link with settings: https://mechanismlab.pages.dev/torque-to-horsepower-calculator/?mode=torque&torque=300&tunit=nm&power=150&punit=kw&rpm=4000 - [Venturi meter calculator: Bernoulli, flow speed and pressure drop](https://mechanismlab.pages.dev/venturi-meter/): Water speeds up through a narrowing and its pressure drops: Bernoulli in a venturi meter, with both speeds, the pressure drop and the manometer reading. - Inputs: Flow (litres per second) `q` 0.2–5 (default 2); Pipe diameter (mm) `D` 30–100 (default 50); Throat diameter (mm) `d` 10–60 (default 25) - Outputs: Speed in the pipe; Speed in the throat; Pressure drop; Manometer difference - The physics: Continuity: Q = A₁ v₁ = A₂ v₂, so halving the diameter makes the water four times faster. • Bernoulli: p + ½ ρ v² stays the same along the flow, so p₁ − p₂ = ½ ρ (v₂² − v₁²). • Reading the meter: the water columns differ by Δh = Δp ÷ (ρ g); turned round, Q = A₂ √(2 Δp ÷ (ρ (1 − (A₂ ÷ A₁)²))). | Ideal flow (no friction); real meters are calibrated with a discharge coefficient a little below 1. The throat can't be wider than the pipe (the page caps it 5 mm smaller), and the drawn columns are capped to fit while the readout gives the real difference. Tested: energy per litre is the same in pipe and throat, and the inverse formula gives back the flow (packages/mechanics/test/fluids.test.ts). - Link with settings: https://mechanismlab.pages.dev/venturi-meter/?q=2&D=50&d=25 - [Voltage divider calculator: output voltage, current and load](https://mechanismlab.pages.dev/voltage-divider-calculator/): Two resistors split a voltage: the output, the current and the power in each resistor, and how much a load connected to the output pulls it down. - Inputs: Supply (V) `vin` 1–24 (default 12); R1, top (kΩ) `r1` 0.1–100 (default 10); R2, bottom (kΩ) `r2` 0.1–100 (default 4.7); Load on the output (kΩ, 0 = none) `rl` 0–1000 (default 0) - Outputs: Output voltage; Without the load; Current from the supply; Power in R1; Power in R2; Output resistance - The formulas: Unloaded output: V_out = V_in × R2 ÷ (R1 + R2). • With a load R_L: it sits in parallel with R2, so use R2 ∥ R_L = R2 R_L ÷ (R2 + R_L) in place of R2. • Current and power: I = V_in ÷ (R1 + R2 ∥ R_L); each resistor dissipates P = I² R. • Output resistance: the divider behaves like a source of V_out behind R1 ∥ R2 = R1 R2 ÷ (R1 + R2). A load ten times that pulls the output down by 1 ÷ 11, about 9%. | Ideal resistors and an ideal supply (no internal resistance). A divider is fine for setting a reference or reading a sensor into a high-impedance input; it isn't a power supply, because the output falls as soon as the load draws real current. Tested: the output against Kirchhoff's current law at the output node, and power in equals power out, for loaded and unloaded dividers (packages/mechanics/test/science.test.ts). - Link with settings: https://mechanismlab.pages.dev/voltage-divider-calculator/?vin=12&r1=10&r2=4.7&rl=0 - [Water pressure at depth calculator: p = ρ g h | Mechanism Lab](https://mechanismlab.pages.dev/water-pressure-at-depth/): Water pressure at any depth from p = ρ g h: gauge and absolute pressure for fresh water or any fluid density, and the force on a small disc. - Inputs: Depth (m) `depth` 0–100 (default 10); Fluid density (kg/m³) `rho` 700–1300 (default 1000) - Outputs: Pressure from the water; Absolute (plus the air above); Force on a 25 mm disc - The physics: Hydrostatic pressure: p = ρ g h, the density of the fluid times g times the depth. It is the weight of a column of fluid one unit of area across. • Absolute pressure: add the air pressure on the surface, p_abs = p_atm + ρ g h. In fresh water every 10.3 m adds about one more atmosphere. • Force: F = p × A. The same pressure on a bigger area pushes harder, which is why dam walls and aquarium glass get thicker towards the bottom. | Assumes the fluid doesn't compress (true to well under 1% for water at these depths) and g = 9.81 m/s²; standard atmosphere 101.325 kPa. Tested: 10 m of fresh water gives 98.1 kPa, the weight of the column above one square metre (packages/mechanics/test/fluids.test.ts). - Link with settings: https://mechanismlab.pages.dev/water-pressure-at-depth/?depth=10&rho=1000 - [Will it float? Buoyancy calculator (Archimedes' principle)](https://mechanismlab.pages.dev/will-it-float/): Will it float or sink, and how much sits under the surface? Archimedes’ principle from the object and fluid densities, and the net force if it sinks. - Inputs: Object density (kg/m³) `obj` 50–2000 (default 600); Fluid density (kg/m³) `fluid` 700–1300 (default 1000) - Outputs: Share under the surface; It; Fully under, net force - The physics: Archimedes' principle: the upward force is the weight of the displaced fluid, F_b = ρ_fluid g V_under. • Floating: it settles where F_b equals its weight, ρ_object g V, so the share under is V_under ÷ V = ρ_object ÷ ρ_fluid. • Sinking: if the object is denser than the fluid, even fully under the push isn't enough. It still feels lighter by the weight of the fluid it displaces: net force (ρ_object − ρ_fluid) g V. | For an object of one density all through (a hollow boat counts its average density, hull and air together). Tested: the displaced fluid weighs exactly as much as the floating object (packages/mechanics/test/fluids.test.ts). - Link with settings: https://mechanismlab.pages.dev/will-it-float/?obj=600&fluid=1000 - [Worm drive calculator: ratio, lead angle and self-locking](https://mechanismlab.pages.dev/worm-drive/): Worm starts, wheel teeth, module and worm diameter give the reduction ratio, the lead angle and whether the drive self-locks for a given friction. - Inputs: Worm starts `starts` 1–4 (default 1); Wheel teeth `teeth` 20–80 (default 40); Module (mm) `m` 1–5 (default 2); Worm diameter (mm) `d` 10–60 (default 30); Friction μ × 100 `mu` 3–30 (default 10) - Outputs: Ratio; Lead angle; Self-locking? - The formulas: Ratio = wheel teeth ÷ worm starts. • Lead = starts × axial pitch (π m); lead angle λ: tan λ = lead ÷ (π × worm diameter). • Self-locking (the wheel can't turn the worm) when tan λ is below the friction coefficient μ. This is the usual rule of thumb; real drives can still creep under vibration, so don't rely on it as a brake. | Tested against hand calculations (packages/mechanics/test/classics.test.ts). - Link with settings: https://mechanismlab.pages.dev/worm-drive/?starts=1&teeth=40&m=2&d=30&mu=10 ## Optional - [Privacy policy | Mechanism Lab](https://mechanismlab.pages.dev/privacy/): Mechanism Lab privacy policy. - [Terms of use | Mechanism Lab](https://mechanismlab.pages.dev/terms/): Mechanism Lab terms of use.