Over time, I have played a bit with an equation to predict how cyclist speed generally varies with terrain. The conventional approach is to assume constant power and predict speed, but riders don't ride constant power except in time trials, really. It's more typical to go harder on climbs, coast on descents, and somewhere in between on flat roads. So using power to predict speed requires a model for power. The added step ends up not adding much value so better to model speed directly, with some acknowledgement of power limits.

The model I came up with was, where g is the sine of the road angle (not the tangent):

v = exp(- 3 g

^{4} ) v

_{max} / [ 1 + ln | 1 + K

_{0} exp( K

_{VAM} g ) | ]

In the limit of infinite g, in the absence of the first exponential, this becomes:

v = v

_{max} / K

_{0} g

which is constant climbing power, neglecting rolling and wind resistance.

In the limit of negative slope, again neglecting the 4-th order exponential, this is:

v = v

_{max}
which is safety-limited descending speed.

The 4th-order exponential handles the slowing which occurs on extremely steep grades, both climbing and descending.

The constants in the above are:

K

_{VAM} = v

_{max} / VAM

_{max}
where VAM

_{max} is a theoretically maximum sustainable rare of climbing and

K

_{0 }= exp(v

_{max }/ v

_{0} - 1) - 1

where v

_{0} is the speed on flat roads.

For corners, I add time, evenly divided going into and coming out of the corner, using:

Δt = (Δs

_{radian} / v

_{max}) ΔΘ (v / v

_{max})

^{2}
where ΔΘ is the change in heading. This says riders tend to lose a certain amount of distance through corners proportional to the square of the ratio of their speed to their maximum safe descending speed and proportional to the angle of the corner. Δs

_{radian} = 2 seconds seems to work fairly well. Note this doesn't do well with instantaneous speed: in the limit of infinite spatial resolution it yields infinite deceleration and acceleration, but is rather focused on modeling directly the effect of the net turn.

For wind, I assume wind affects only flat-road speed, not safe descending speed, and not the limits of climbing speed (wind generally screened on climbs). Wind speed is measured at body-height, not 10 meters, so ground sheer needs to be considered:

v

_{0} = v

_{00} exp(2 s

_{wx} / 3 v

_{00}) exp(-(s

_{w} / 3 v

_{00})

^{2})

where v

_{00} is the flat-road speed without wind and s

_{0} is the flat-road speed with wind. swx is the wind speed in the direction of the rider (tailwind = positive) and sw is the total wind speed.

For fatigue, I assume speed decays during a ride with a ride-dependent rate r

_{fatigue}:

v

_{0}(t) = v

_{0}(0) exp(-r

_{fatigue} t / 2)

VAM

_{max}(t) = VAM

_{max}(0) exp(-r

_{fatigue} t)

where I assume flat-road speed decays half as quickly as max theoretical climbing speed (the latter more sensitive to power loss).

When applying this model, I first apply a smoothing function to the course data (longitude, latitude, and altitude) with respect to distance using a 50 meter smoothing length to reduce the effect of numerical noise, since in practice course data tends to come from electronic instruments of finite resolution. This is especially important with that gnarly 4-th order exponential on g, which will send a rider to a grinding halt if grade gets out of line. Latitude and longitude are smoothed to avoid artificially large cornering penalties.

All of this seems to work fairly well. I compare to ride data and power calculations in

my blog.