Swimming hydrodynamics simulator. Four stroke styles are modelled using a thrust-drag ODE: m·dv/dt = F_thrust(t) − F_drag(v) where F_thrust oscillates with the stroke cycle and F_drag = ½·ρ_water·Cd·A·v². Each stroke has a different frontal area, drag coefficient, peak thrust and stroke rate. The terminal (steady-state) velocity is reached when average thrust equals average drag. Front crawl is fastest due to its low drag area and continuous thrust profile. Breaststroke has the highest drag and lowest efficiency. An external streamlining slider scales all Cd values, modelling tech-suit effect.
This simulation races four swimming strokes — front crawl, breaststroke, butterfly and backstroke — down a 50 metre lane to show how drag and propulsion set each one's speed. Each swimmer obeys a one-dimensional thrust-versus-drag equation of motion, m·dv/dt = F_thrust(t) − ½·ρ·Cd·A·v², integrated with a fixed 0.01 second time step. The thrust pulses as a half-rectified sine wave tied to the stroke rate, so propulsion arrives in beats just as it does in real swimming.
The streamlining slider scales every stroke's drag coefficient between 50% and 100%, modelling the effect of a low-friction tech suit, while the swimmer-mass slider (50–100 kg) changes how quickly each body accelerates toward its steady speed. The live metrics panel and on-lane bars report instantaneous velocity, terminal velocity and effective Cd. The same physics governs competitive swimming, where reducing frontal area and drag matters far more than raw strength.
What does this simulation show?
It animates four swimmers, one per stroke, accelerating from rest along a 50 metre pool. Each lane displays the swimmer's current speed, a velocity trace, and a bar comparing present speed to that stroke's terminal velocity, so you can see which stroke is fastest and why.
What is the equation behind it?
Each swimmer follows Newton's second law in one dimension: m·dv/dt = F_thrust(t) − F_drag(v), where the drag term is the quadratic fluid-drag law F_drag = ½·ρ·Cd·A·v². Here ρ is water density (1000 kg/m³), Cd the drag coefficient, A the frontal area and v the speed.
Why is front crawl the fastest stroke?
Front crawl combines the lowest frontal area (about 0.14 m²) and lowest drag coefficient (Cd ≈ 0.28) with a fast, nearly continuous alternating-arm rhythm. Lower drag means a higher terminal velocity for the same thrust, so the crawler reaches the wall first.
The streamlining slider multiplies every stroke's drag coefficient by a factor from 0.5 to 1.0, simulating how much a tech suit cuts drag; the readout shows the equivalent percentage reduction. The mass slider sets each swimmer's body mass from 50 to 100 kg, which changes acceleration but not the final terminal velocity.
Terminal velocity is the steady cruising speed where average thrust balances average drag. With half-rectified sinusoidal thrust the cycle-averaged force is thrustPeak/π, so v∞ = √((thrustPeak/π) / (½·ρ·Cd·A)). It is shown as v∞ on each lane and on the right-hand bar.
Terminal velocity depends only on the balance between thrust and drag, neither of which contains mass. A heavier swimmer accelerates more slowly because m appears in dv/dt = (F_thrust − F_drag)/m, but once forces balance the steady speed is identical. Mass therefore alters how long the build-up takes, not the cruise speed.
Real strokes propel the swimmer only during the pull phase, not the recovery. The model captures this by taking the positive half of a sine wave, max(0, thrustPeak·sin(phase)), whose frequency follows the stroke rate in cycles per minute. This produces the surge-and-glide pattern visible in the velocity trace within each lane.
The drag coefficients, frontal areas, peak thrusts and stroke rates are physically plausible, illustrative values rather than measured biomechanical data. The quadratic drag law and force balance are genuine fluid dynamics, so the comparative ranking and trends are sound, but exact speeds should be treated as a teaching approximation, not race predictions.
Breaststroke has the highest drag of the four, with a large frontal area (about 0.22 m²) and a high drag coefficient (Cd ≈ 0.65), plus the slowest stroke rate. Even though its peak thrust is large, the steep quadratic drag penalty caps its terminal velocity well below the other strokes.
It demonstrates that in water reducing drag often beats adding power: shaving the drag coefficient with a tech suit or better body position raises terminal velocity more reliably than brute force. The same thrust-minus-quadratic-drag balance describes cyclists, swimmers and any body cruising steadily through a fluid.