Play
Choose a course. Drag the power handle (or type watts), then press Ride. Power can change live, or press Stop, adjust, and resume. Stop freezes the simulation clock, speed and battery together; it never gives free recovery. Keyboard: space pause / ride, ↑ / ↓ ±25 W, shift + arrows ±100 W, C critical power, 0 coast.
The objective is the lowest simulated finish time. Coasting at 0 W is not pausing: you keep moving under gravity, rolling resistance and air resistance. A ghost replays a steady-CP reference or a completed personal best. Ghosts do not give drafting benefits. Local results are informal practice, not a secure classroom leaderboard.
A battery, but not a literal battery
W′ is an estimate of the finite work capacity available above critical power. Above CP, the excess power spends W′. Below CP, the depleted part recovers exponentially. At CP the balance is unchanged. The warning turns on below 20%.
P > CP: dB/dt = −(P − CP)
P < CP: dB/dt = (W′ − B) / τ(P)
Default: τ(P) = α W′ / (CP − P)
Alternative: τ(P) = α [546 exp(−0.01(CP − P)) + 316] s
The default is the Skiba differential model. The alternative uses the empirical 2012 recovery time constant in a local, piecewise recovery model; it is not the original history-integral implementation. That empirical alternative has a near-CP discontinuity: it predicts some recovery just below CP, while exactly CP has none. Do not interpret that as a physiological pacing trick. Individual recovery differs and these parameters are not fitted to your physiology. This simplified model omits longer-term fatigue, nutrition and heat. W′ is not synonymous with a directly measured anaerobic energy store.
Depletion is a game rule
In Stop & recover, reaching zero applies an instantaneous game brake and holds position. The lost kinetic energy is tracked separately. The race clock continues and effort is zero until the selected 20% or 50% unlock level. Pedaling then resumes at 330 W in manual mode. Power controls show 0 W and are disabled during recovery; power resets to 330 W at unlock. Coast & recover turns off pedaling but retains normal bicycle motion. Real riders are not compelled to stop simply because a W′ estimate reaches zero.
Power → acceleration → motion
m dv/dt = Fdrive − Fdrag − Froll − Fhill
Fdrive = min(η Ptarget / v, Fmax)
Fdrag = ½ ρ CdA (v + wind) |v + wind|
Froll = Crr m g cos θ; Fhill = m g sin θ
ds/dt = v; sin θ = dh/ds
The road coordinate is distance along the road, not horizontal distance. Elevation uses shape-preserving cubic interpolation, with its derivative used for the slope. A 600 N default drive-force limit removes the power/speed singularity at rest. During the first moments of a launch, actual power is lower than requested; both mechanical work and W′ use actual output. At 100% drivetrain efficiency this matches the wheel-power convention of your MATLAB demo. With η < 1, CP and W′ are interpreted at the upstream power-meter location.
Motion and battery are integrated with fixed 0.025 s fourth-order Runge–Kutta steps. Depletion, unlock and finish events are resolved within a step. This is a forward-only point-mass model: no gear/cadence dynamics, wheel inertia, cornering, traction slip or drafting. Coasting to zero on a hill means stopping, not rolling backward. The scene exaggerates elevation and the bicycle size for visibility.
Two ways to compare strategies
Manual: pause at any point and choose the next power. The telemetry records actual power, W′ and speed versus time. Planner: expand “Draw your power plan” and paint an 80-block target profile versus distance. Preview computes its finish without entering the leaderboard; enabling the plan lets you watch it ride. The climb/recover preset is a heuristic, not an optimizer. Every preview starts from rest at the beginning.
Your supplied terrain
The default Stone Mountain U course is a GPX-derived 11.66 km loop, resampled at approximately 10 m with light elevation smoothing. Its segment boundaries are approximate; distance and climbing may differ from Strava. The original recorded road remains available in the course menu.
The 7.60 km course comes from matlab-cycling/terrain.csv: 1,521 smoothed elevation samples from your uploaded archive, with no latitude or longitude included. Rider defaults are retained from cycling_demo.m. The game is not a replay of your measured ride: it starts from rest, adds W′ limits, and uses your chosen power. The MATLAB file declared a 600 N force cap without actually applying it; this game applies the cap.
Sources
Martin et al. (1998), Validation of a Mathematical Model for Road Cycling Power.
Skiba et al. (2012), Modeling the Expenditure and Reconstitution of Work Capacity above Critical Power.
Skiba et al. (2015), Intramuscular Determinants of the Ability to Recover Work Capacity above Critical Power.
Welburn et al. (2026 issue; online 2025), W′ Reconstitution Modelling During Intermittent Exercise Performed to Task Failure. Equations 3–6 and individualization limitations.
Caen et al. (2021), W′ Recovery Kinetics after Exhaustion: A Two-Phase Exponential Process Influenced by Aerobic Fitness.
Offline and on your website
This file contains its own code and terrain. It makes no network requests during play. Upload the HTML to a static website to publish it. Save a challenge JSON to share the exact course, physics and power plan. Results stay in this browser’s local storage where supported; CSV downloads let students submit trials. Browser storage can be cleared or blocked, so export important results.