Documentation

Climbing Model Documentation

Overview

In Flat Terrain Pace mode, RaceCraft prices climbs with a Minetti grade factor on each checkpoint leg — not a manual climbing-ability setting. Segment pace is the athlete's flat-terrain race pace multiplied by that factor, then by terrain, skill, and fatigue.

Climbing ability is not a planner input. Older saved plans may still send climbing_ability; the GAP solver ignores it and keeps a 'moderate' default only for payload compatibility.

Current UI Behavior

  • The manual climbing ability selector has been removed from the side panel.
  • RaceCraft shows a Required Climbing Rate card in the guidance area for both Flat Terrain Pace mode and Target Time Mode.
  • This value is the on-climb vertical speed implied by the plan, not race-average VAM. Time on climb is estimated from the same split-leg Minetti weights Flat Terrain Pace mode uses, so flats and descents do not dilute the number:
required_vertical_speed_mh = total_elev_gain / climbing_time_hours
  • It is displayed in m/h or ft/h depending on the active unit system and is comparable to the beginner (~400 m/h) through vertical-specialist (~1,500 m/h) on-climb bands.

Flat Terrain Pace mode: Minetti grade factor

Why not net elevation

Minetti cost is convex. Using net elevation (gain − loss) on a rolling kilometre (50 m up, 50 m down) yields grade 0 % and paces the leg as flat. That systematically understates work on trail ultras, where checkpoint-to-checkpoint legs are usually rolling.

Split-leg reconstruction

Each checkpoint leg is split in proportion to vertical work:

d_up   = D × G / (G + L)
d_down = D × L / (G + L)
|grade| = (G + L) / D

Pure climbs and pure descents reduce to a single grade. A net-zero rolling kilometre becomes two equal ramps. The segment factor is the distance-weighted Minetti GAF of those portions.

Grade Adjustment Factor

Reference: Minetti AE et al. (2002) J Appl Physiol 93:1039–1046.

C(g) = 155.4·g⁵ − 30.4·g⁴ − 43.3·g³ + 46.3·g² + 19.5·g + 3.6
GAF  = C(g) / C(0)     with C(0) = 3.6

g is gradient as a decimal fraction, clamped to ±40 %. GAF > 1 is harder than flat; GAF < 1 is easier (gentle descent).

Descents take a quarter of the saving

Minetti measures metabolic cost, and downhill is where metabolic cost stops being the limit: braking is eccentric work, so quadriceps load, footing and nerve cap the speed long before oxygen does. Passed through at 1:1 the curve prices a 15 % road descent at 0.51 — a 6:00/km athlete running 3:12/km downhill, and a 50 km / 2500 m course in 5h59 where the additive model said 8h20.

So a sub-1.0 factor keeps only DESCENT_CREDIT_SHARE (0.25) of its saving:

GAF = 1 − (1 − C(g)/C(0)) × 0.25     when C(g) < C(0)

The shape survives — a gentle descent is still the cheapest ground, and −30 % is still dearer than −15 % — but the benefit holds to about 14 % (the scaled curve bottoms out at 0.874, at a gradient of −18.1 %), in line with measured self-selected downhill speeds. Climbs are untouched.

Gradient Raw Shipped
−30 % 0.684 0.921
−20 % 0.500 0.875
−15 % 0.510 0.877
−10 % 0.598 0.899
−5 % 0.763 0.941
+10 % 1.658 1.658
segment_pace = flat_race_pace × distance_weighted_GAF × terrain × fatigue × skill

The pace is capped at 2.5× the flat-terrain input.

Required Climbing Rate

After the plan is built, the guidance card reports on-climb VAM so athletes can sanity-check the plan against familiar climbing bands. It is derived from the plan, not a control that changes the plan.

Reference bands (on-climb, and gradient-aware)

These are the bands shown on the card - interpretation, not a dropdown:

Level Suggested rate at 25 % Interpretation
Beginner ~400 m/h Cautious, inexperienced or difficult terrain
Recreational ~550 m/h Sustainable, modest climbing ability
Trained ~700 m/h Regular trail runner with reasonable climbing fitness
Strong ~900 m/h Well-trained mountain runner
Elite ~1,200 m/h Exceptional climbing ability
Vertical specialist ~1,500 m/h Highly specialised, usually short or favourable climbs

VAM is not a property of an athlete on its own. At a fixed effort it rises with steepness, because less of the distance is horizontal. The familiar 400–1500 m/h figures describe steep mountain ascents, so the card re-expresses them at the plan's own mean climbing gradient (CLIMB_BAND_REFERENCE_GRADIENT, 25 %) before showing them:

VAM(g) = 60000 · g / (GAP · GAF(g))        so a band scales by R(g) / R(0.25)
R(g)   = g / GAF(g)

The athlete's GAP cancels out of that ratio, so band membership is gradient-invariant: one athlete reads the same band whatever the course's steepness. That is the property the card needs, and the test suite asserts it directly against the real pacing function.

The invariant holds up to about a 20 % mean climbing gradient. Past that the 2.5× pace cap binds before the grade factor does — GAF crosses 2.5 at roughly 20 % — so the plan climbs faster than the model priced it and the reading drifts up through the bands. The athlete's GAP cancels out of that boundary too, so it is the same for everyone, and no real course has a mean climbing gradient above it.

The invariant is also exact only for a uniform climb. The bands are scaled at the plan's mean climbing gradient, and vertical speed is not linear in gradient, so a course that mixes gentle and steep climbs reads a little lower than a uniform one with the same mean. With pure Minetti pacing, one athlete reads 1.11× the Trained rung on a uniform 10 % climb, 1.09× on half 5 % and half 15 %, and 1.07× on 2 % and 18 %.

25 % is what makes the ladder self-consistent with this model. At 25 % the six bands imply flat-equivalent paces of 12:35, 9:09, 7:12, 5:36, 4:12 and 3:21 per km — a Beginner rung that reads as hike-level pace, a Vertical-specialist rung at elite skyrunning pace — matching the interpretations above. Read at 10 %, the raw ladder needs a 2:25/km athlete to reach the top rung — 25 km/h up a 1-in-10 — so every plan on ordinary terrain used to read worse than the ladder's bottom rung (#594).

Plan's mean climb Beginner Recreational Trained Strong Elite Vertical specialist
5 % 183 252 320 412 549 687
10 % 288 395 503 647 863 1,078
15 % 347 477 607 781 1,041 1,301
25 % 400 550 700 900 1,200 1,500

/api/calculate returns the resolved ladder as summary.climbing_rate_bands alongside summary.mean_climbing_gradient, so the Minetti curve lives in one language rather than being reimplemented in JS. Imperial display converts the resolved figures to ft/h.

A pure-climb route (no descents) equals gain / moving_hours. Rolling routes are higher than that race-average figure because only uphill time sits in the denominator.

What the reading includes. The bands are pure Minetti: a fresh athlete on smooth ground. In Flat Terrain Pace mode the plan's rate is the athlete's predicted on-climb speed, so it also carries terrain, fatigue and wind, and those can move the same athlete a whole band. On UTA100 at a 6:30/km flat pace over ten checkpoint legs, one athlete reads 1.10× the Trained rung on smooth trail, 1.01× with fatigue on, 0.97× on technical terrain, and 0.89× with both — the last on the Recreational side. A lower band on a long or technical plan says the course is harder, not that the athlete is weaker. In Target Time mode the rate is simply the one the target implies.

Terrain and fatigue

After the grade factor, Flat Terrain Pace mode still applies:

  1. Terrain efficiency — local penalty for trail type, scaled by technical skill
  2. Skill efficiency — small form bonus (0–3 %)
  3. Fatigue — cumulative effort vs fitness-level FOP

Those controls are Flat Terrain Pace mode only. In Target Time mode they are hidden (fatigue, fitness, wind) or greyed out (technical skill), because the segment solver meets the stated finish time from elevation and terrain alone. The separate required manual pace uses the fixed defaults described below.

Estimated GAP and required manual pace

Target Time shows two distinct measures:

  • Estimated GAP removes gradient alone from the planned moving paces. For each leg, divide its unrounded moving time by the split-leg grade factor, sum these flat-equivalent times, then divide by total route distance. Stops are excluded; surface difficulty remains included. This is RaceCraft's estimate, rather than a claim of numerical parity with other activity platforms.
  • Required Flat Terrain Race Pace is the input to copy into manual mode. The forward model is inverted using fixed defaults: terrain on, Strong skill (0.5), fatigue on, Recreational fitness, wind on with Mixed exposure. Previous manual settings and athlete profiles do not affect this result. Wind is projected onto each candidate's still-air forward schedule with one loaded forecast, so speed and forecast-hour binding match the manual calculation.

The Pacing panel explains the settings needed to reproduce the target. Matching settings and checkpoint stops should reproduce the finish total within pace rounding; updated forecasts can also change it. Segment paces can differ because Target Time retains its independent segment allocation. Targets outside the manual/model limits do not claim equivalence. The manual input is explained as expected race pace on flat, runnable ground and is not repeated as Estimated GAP. Terrain adjustment defaults to on for new plans; saved explicit choices remain.

Payload compatibility

  • Requests may still include climbing_ability (string). Flat Terrain Pace mode does not read it.
  • Save/load/export emit 'moderate' so older plan shapes keep loading.
  • elev_gain_factor on very old plans is not a live control; the backend defaults the unused field to 'moderate'.

Legacy additive model

adjust_pace_for_elevation() still implements the earlier additive vertical-speed model (horizontal_time + climb_time − descent_savings). Target Time mode uses it only to fill the display-only Elev Pace column. It is not the Flat Terrain Pace mode engine and is not driven by a UI selector.

Its descent half is still live with it, and still worth getting right (#599). The gradient bands live in the module-level DOWNHILL_SPEED_MULTIPLIERS constant — retune descent speed there, not in the function. calculate_downhill_multiplier() reads that constant, sorted by gradient_max rather than by declaration order, with the steepest band catching anything past the last threshold:

Gradient Base multiplier
0–5 % 1.05×
5–10 % 1.15×
10–15 % 1.20×
>15 % 1.10× (forced to slow down)

The result is then capped by terrain, from 100 % on road down to 50 % on scrambling, and nudged by technical skill. tests/test_downhill_multiplier.py keeps this honest: a golden table pins the multiplier values, and further tests pin the band selection, the table's shape, and the fact that the constant — not a hardcoded ladder — supplies the numbers.

Wind hour-binding uses adjust_gap_pace_for_segment() (the Minetti path) for its still-air schedule, so forecast hours line up with the plan /api/calculate actually produces.

Future Enhancements

Potential improvements:

  1. Custom Vertical Speed: Allow users to input exact vertical speed value
  2. Altitude Adjustment: Reduce vertical speed at higher elevations
  3. Climb Length Factor: Efficiency changes on very long vs short climbs
  4. Temperature Impact: Heat/cold affecting climbing performance
  5. Surface Type: Different vertical speeds for trail vs road climbs

Summary

  • Flat Terrain Pace mode climbing cost is Minetti on split gain/loss, not a climbing-ability dropdown
  • Rolling terrain cannot cancel to flat
  • Required Climbing Rate is on-climb VAM compared to 400-1500 m/h bands
  • climbing_ability remains on the payload for old saved plans only