## Thursday, July 29, 2010

### VeloNews aero wheel ranking formula

In the September 2010 VeloNews Magazine, which I just got in the mail today, there's a review by Zack Vestal of six aero wheel pairs Check out the magazine for all the numbers. The topic of this blog post is the rating system. That system is to rank each of the six wheels from 1 to 6 in the following categories, then to average those rankings to get a final score:
1. Aerodynamic drag
2. weight
3. front wheel stiffness
4. rear wheel stiffness
5. rear wheel rotational inertia
6. front wheel rotational inertia
Rotational inertia describes how hard it is to change the rotation rate of an otherwise stationary wheel. For a given unit mass, its contribution to weight is obviously proportional to the mass, while the contribution to rotational inertia is proportional to the mass multiplied by the square of the distance of that mass from the axis of rotation. So mass at the rim contributes more to rotational inertia than mass at the hub.

First, note that three of these rankings depend on mass, while only one depends on aerodynamics. The implication is keeping wheels light is three times more important than making them cut smoothly through the wind. Does this make sense?

The wheels are ranked at a 10 degree yaw angle for the wind (the wind coming typically at an angle 10 degrees off head-on). At this yaw angle, the aero wheels (front wheel only) saved between 18 and 33 watts relative to a "standard" 32-spoke wheel, a spread of 15 watts, at 30 mph. At 25 mph, a more typical time trial speed, the spread would be 9 watts. So I'll use that as the relevant number. Note this neglects the rear wheel, which will add even more to the difference depending on how effectively the wheel drafts the frame.

Now to the effect of mass on power due to accelerations. Suppose a rider has to slow from 25 to 20 mph every minute, then accelerate back. Sure, there's also "micro-accelerations" from nonuniform pedal stroke or small undulations in terrain, but inertia reduces the magnitude of these fluctuations (a heavier bike or wheel moves at a more constant speed), so we should only count the accelerations from forced decelerations (typically due to safety cornering or changing speed to match another rider). That's 0.374 W/kg from these accelerations.

Rotational inertia from the wheels varies by approximately 134 kg-cm² for rear wheels and 90 kg-cm² for front wheels, which for a rolling radius of 33.4 cm, yields an effective inertia difference of 120 grams for the rear and 80 grams for the front. So in this example, the power cost from these accelerations every 60 seconds from 20 to 25 mph varies among the wheels, based on their rotational inertia differences, by approximately 0.045 W for rear wheels and 0.030 W for front wheels.

Total mass varies among the wheelsets by 357 grams. This also affects the energy required to accelerate: the effect of total mass of the acceleration on the wheels (357 grams of inertia difference) is bigger than the effect of rotational inertia differences (200 grams of inertia difference). So it's already wrong the rotational inertia was counted as more important. Add in that total mass affects climbing power and rolling resistance power and total mass is clearly more important in this case than rotational inertia.

So we start with the power for accelerating out of our hypothetical corners: 0.13 W. Then assume a average speed of around 25 mph with a CRR = 0.33% (Kraig Willett recommends using a number around 50% higher than Al Morrison measures on rollers, so I assume a typical-excellent rolling resistance measured at 0.25%). With the mass difference of 357 grams, this yields a power difference from rolling resistance of 0.13 W as well. So the variation among the wheels in power due to total mass becomes 0.26 W, half from acceleration, half from rolling resistance.

Then there's an effect from net and gross climbing. Obviously this is course-dependent. I'll assume a course with only gradual climbing and descending, so speed lost on uphills from heavier mass is regained on downhills (to first order). Therefore I assume the primary effect of heavier mass is on rolling resistance and on accelerations. Rolling terrain is trickier to model.

Then there's stiffness. Stiffness affects cornering, perhaps. This, it seems, is more of a speed thing than a power thing. I don't have any sort of reasonable model for how stiffness affects speed, nor am I sure it actually has any significant effect. In the article it's stated "our heaviest tester thought the (least stiff wheels tested) were plenty stiff for his powerful sprint". In light of this, it's fairly surprising stiffness was counted in the results twice as heavily as aerodynamic drag. In any case, I'll stick for the purposes of this blog to aero drag, mass, and rotational inertia.

So we get the following for the power cost from the variation among the tested wheels:
1. front wheel rotational inertia: 0.030 W
2. rear wheel rotational inertia: 0.045 W
3. total mass: 0.26 W
4. aerodynamic drag @ 25 mph: 9 W
VeloNews counts each of these components equally. But it's clear that even cursory analysis shows they're not even close: aerodynamic drag is more than an order of magnitude more important.

Obviously for a hill climb time trial things would be different: mass takes on larger importance. But it's physically impossible from these numbers that the relationship between mass and rotational inertia can flip. Unless, as I previously suggested, the total bike is being limited to a UCI-mandated 6.8 kg total mass, something which rarely applies to riders in the United States.

Also, for a criterium, for example, accelerations may happen more than once per minute. Still, you can see from the huge difference between the aero power difference and the inertial power differences that rotational inertia will match aerodynamics in importance only in a pathological case. Indeed, even at the World Championship level, riders in sprint events on the track use disk wheels or other deep dish wheels due to the relatively larger importance of aerodynamics. And on the road, sprints typically start from a relatively high speed, so acceleration takes on lesser importance.

So how would I improve things? Instead of using ranking, VeloNews should have come up with a set of scale factors for each test result, then summed the normalized ratings. For example, I might think that 200 grams of mass is as important as 60 grams of rotational inertia which is as important as ‒0.02 mm/N of compliance which is as important as 1 watt of aerodynamic drag. Come up with whatever numbers you want based on sound, physics-based criteria. Then sum 'em up and only rank the wheels at the end. This will more closely correlate ranking with speed.

## Tuesday, July 27, 2010

### Fall 2010 Golden Gate Bridge bike lane closure

This morning, I was distressed to see this story in the SF Examiner:

During a four-month period beginning in November, cyclists will be banned from the westside walkway — normally designated for bike riders — due to a construction project that entails the seismic retrofitting of the bridge cable’s main anchorage, which straddles both sidewalks on the northern part of the span.
The first phase of the seismic work, which is scheduled to last four months, will shut down the western sidewalk. Cyclists will be added into the busy mix of walkers, tourists and sightseers during the weekends and weekday evenings. Normally, cyclists are allowed on the western sidewalk during weekdays before 3:30 p.m.

There could be no clearer violation of City Charter 8A.115:

"Decisions regarding the use of limited public street and sidewalk space shall encourage the use of public rights of way by pedestrians, bicyclists, and public transit, and shall strive to reduce traffic and improve public health and safety."

I didn't make up this law: it's been on the books for almost 11 years.

Doing push-ups
across the bridge could become unsafe if heavy bike traffic were diverted to the pedestrian side.

The solution? Simple: close the western-most vehicular lane during periods of popular bike + pedestrian use and dedicate that to bicycle use. Then pedestrians can keep the eastern walkway.

Hardly complicated. Remove this fence on the southern side, then this fence on the northern side. Then put a fence between what is presently the westernmost vehicular lane and the lane adjacent. The partitioning of lanes into northbound and eastbound is dynamic so neither vehicular directly will be preferentially affected.

That's better!

More congestion for drivers? Of course (although congestion can always be mitigated with an increased toll, which would reduce or even reverse the impact on mass transit, which is exempt). It's the law: you can't put the burden of projects like this on the preferred transportation modes of walking and bicycling.

## Wednesday, July 21, 2010

### Rating Climbs: summary

Okay, for the record, here's a summary of the three candidate methods:
1. The Fiets/Summerson formula: net climbing² / net distance (each reference uses a different normalization factor to make the result unitless). This is good because it can be applied to an broad ensemble of riders. Nobody may agree on what's steep, but everyone agrees to some extent steeper deserves to be rated higher. This formula has the advantage of being trivial to calculate in your head, especially if you are given average grade and are willing to make the approximation that climbing / distance = average grade.
2. My simple formula: net climbing × (1 + [ 12.5 × net climbing / distance ]²). Note during this series of blog posts I've upped the coefficient on climbing due to feedback I've received on the tradeoff between steepness and altitude gained in perceived difficulty of the Low-Key Hillclimbs. This formula is also fairly easy to calculate in your head.
3. The method I described in the preceding blog post. This method was also tuned from my initial description. Forget about calculating this one in your head!

So, with each method, here's the ranking of the Low-Key Hillclimbs from 2008-2010, where I've sorted the climbs using the full-profile rating (rfull), but also listed the Fiets/Summerson formula (rfiets) and my "simple formula" (rsimple). In each case I've normalized to Old La Honda, to facilitate comparison. In general, the full-profile rating clearly gives a high weight to climbs with extended steep sections like Alba, Welch Creek, and Bohlman. However, a climb which is relatively steep but with a steady grade, like Soda Springs, fails to score higher with the full-profile rating.

```rank climb                              rfiets   rsimple  rfull
2    Mount_Diablo_(N)                   2.22693  2.29079  2.3154
3    Bohlman-Norton                     1.89235  1.98033  2.30907
4    Kennedy_Trail                      1.90262  1.95956  2.1915
6    Hicks_-_Mt_Umunhum                 1.92388  2.00287  2.1223
14   Bonny_Doon_-_Pine_Flat_Rd.         1.34382  1.37818  1.48754
15   E._Dunne_Ave_(Henry_Coe)           1.25048  1.2993   1.47067
16   Portola_State_Park_-_W._Alpine_Rd. 1.34549  1.3489   1.36768
20   Tunitas_-Star_Hill_-_Swett         1.06779  1.1033   1.15293

## Tuesday, July 20, 2010

### Rating Climbs: testing the new formula

So to summarize, I developed a hillclimb rating algorithm using full profile data, which is the following, where I've made a few tweaks:
1. Preferably interpolate initial profile data to a uniformly spaced mesh. This facilitates smoothing. I use a 10 meter mesh spacing. This step is optional.
2. Smooth the initial profile, as needed, to reduce measurement noise (for example altimetric data from a Garmin Edge 500). I use convolution of a single period of a cosine-squared function with full-width-half-maximum of 50 meters.
3. Calculate a "typical" time for each position point using a heuristic equation: dt/ds = (1 second/14 meters) ln [ 1 + exp(50 g) ], where t is time, s is distance, and g is the derivative of altitude with respect to s.
4. Smooth grade versus time with a smoothing function. I use convolution with a single period of a cosine-squared with full-width-half-maximum of 30 seconds, yielding a smoothed function g*. This operation, if done properly, should reduce the grade at the start and finish of the climb, which reduces the eventual rating of very short climbs like Filbert Street (which gains 18 meters).
5. Find the average value of f(g) = exp(g / g0) with respect to distance.
6. Multiply this by the net altitude gained.

The key parameters in all of this are the smoothing time (I used 30 seconds here) and the scale rate of altitude gain g0. I initially proposed g0 = 10%, but then decided to use g0 = 8% instead. This latter choice placed increased emphasis on steep segments within a longer climb, for example if two climbs have the same net climbing and distance, the one with the more nonuniform grade will benefit from the lower g0.

Note the smoothing time I've changed from 15 seconds to 30 seconds. The choice of 15 seconds had been relatively arbitrary, based primarily on how far one could coast. But 30 seconds is the number used by Andrew Coggan in his power analysis metrics ("Training Stress Score" and "Effective Power"). So it makes sense to try and be consistent with that precedent. Note Coggan uses a square smoothing function rather than a cosine. Cosine is less prone to edge artifacts: the Fourier transform reveals a much more rapid attenuation at high spatial frequencies. But by matching the full-width-half-maximum of the two I yield similar smoothing at lower spatial frequencies.

An interesting aspect of this algorithm is the effect of descents on the final result. The algorithm isn't linear: the rating of two road segments is not the sum of the ratings of those segments. So you can't consider a descent segment in isolation. Rather it must be considered in the context of a full route profile. This is easy to see when the net climb gains zero altitude. You could argue the climbing section and the descending section have equal and opposite impact. But that means the contribution of the climbing segment depends on the details of the descending segment, and vice-versa. This is silly, so the notion that a segment of a total climb has a distinct contribution to the total rating is invalid. A rating is for a whole route, not a sum of parts from that route.

To test the algorithm, I'll consider a set of routes which have the same net climbing and net distance. Thus all of these routes have the same Fiets/Summerson rating, or the same rating using my simple formula, since each of these ratings depends only on net climbing and net distance. Additionally, each of the routes I'll consider has the same gross climbing (and gross descending).

I'll consider a "climb" which gains 300 meters at a climbing grade, then loses 100 meters at a descending grade, then climbs 300 meters at the climbing grade, all in 6 kilometers. Thus net climbing is 500 meters, gross climbing is 100 meters, and gross descending is 100 meters. The average magnitude of the rate of climbing with distance is therefore (gross climbing + gross descending) / distance = 11.7%. However, the climbing may be steeper if the descending is more gradual, or vice-versa.

Here's a representation of some of the profiles used:

I then calculated a rating for each of these profiles. To see if the rating behaves correctly, it's important to first say what "correct" is. It's fairly obvious that the rating should be harder the steeper the climbing portion. True, a more gradual descent provides more recovery than a steep descent ridden at the same speed, but more recovery isn't going to offset the increased difficulty of steeper climbing. Running the numbers yields the following:

As hoped, the rating increases as the grade of the climbing portion increases, while both Fiets/Summerson and the simple formula yield the same rating for all cases. So is this better? Ratings are always subjective, and maybe it could be argued the "merit" of increased climbing grade is cancelled by the "demerit" of a lower fraction of the total distance being uphill. But if rating difficulty is the goal, the full-profile scheme is on target.

## Monday, July 19, 2010

### Rating Climbs: Low-Key Hillclimb rank comparison

I encoded the previously described algorithm in a Perl script, and the results were interesting. Here's a comparison of a ranking of the climbs used in the 2008 through 2010 versions of the Low-Key Hillclimbs. All ratings are normalized to Old La Honda, something of a standard unit in any climb parameter.

First the Fiets formula, sort of the prevailing standard for hill ratings (and also used by John Summerson):
rating = net climbing² / distance

```rank climb                               Fiets/OLH
1    Mount Diablo (N)                    2.22693
4    Hicks - Mt Umunhum                  1.92388
5    Kennedy Trail                       1.90262
6    Bohlman-Norton-On Orbit-Bohlman     1.89235
14   Portola State Park - W. Alpine Rd.  1.34549
15   Bonny Doon - Pine Flat Rd.          1.34382
17   E. Dunne Ave (Henry Coe)            1.25048
20   Tunitas -Star Hill - Swett          1.06779
21   west El Toyonal - Lomas Cantadas    1.05474
22   Old La Honda Road                   1
23   west Bear Gulch Road                0.292306```

Next, the simple rating I described in an earlier post:
rating = net climbing × ( 1 + [ 10 × net climbing / distance ]² )

```rank climb                               rating/OLH
1    Mount Diablo (N)                    2.36806
5    Hicks - Mt Umunhum                  1.83563
6    Kennedy Trail                       1.81136
7    Bohlman-Norton-On Orbit-Bohlman     1.80174
12   Bonny Doon - Pine Flat Rd.          1.43248
14   Portola State Park - W. Alpine Rd.  1.35568
15   E. Dunne Ave (Henry Coe)            1.35277
18   Tunitas -Star Hill - Swett          1.15097
21   west El Toyonal - Lomas Cantadas    1.01946
22   Old La Honda Road                   1
23   west Bear Gulch Road                0.390641```

And next, my newest rating, which uses full profile data, with g0 = 10% (my initial guess at what it should be):

```rank climb                               rating/OLH
1    Mount Diablo (N)                    2.36453
4    Bohlman-Norton-On Orbit-Bohlman     2.04943
6    Kennedy Trail                       1.95249
8    Hicks - Mt Umunhum                  1.90514
12   Bonny Doon - Pine Flat Rd.          1.48414
13   E. Dunne Ave (Henry Coe)            1.45157
17   Portola State Park - W. Alpine Rd.  1.36612
19   Tunitas -Star Hill - Swett          1.16956
22   west El Toyonal - Lomas Cantadas    1.11174
23   Old La Honda Road                   1
24   west Bear Gulch Road                0.36675```

Well, a first observation is all three of these rating systems give fairly similar results. A notable difference is Mt. Hamilton Road, which rates higher under each of my schemes than under the Fiets formula. This is because my systems, for small average grade, always rank a climb at least proportional to total climbing, while the Fiets formula maintains a grade proportionality even for very small average grades.

Another observation is Bohlman does a bit better with my full-profile formula than it does with the simple formula or, to a lesser extent, with Fiets. This is as expected, since the simple formula results in a stronger "dilution" of the super-steep portions with the final kilometers, which are more gradual. You can see Lomas Cantadas also rates a bit higher with the full-profile formula, because like Bohlman, it has some very steep segments.

They all agree, however, that Diablo ranks #1. It's hard to argue with this one.

I then compared the natural logarithms of the ratios of the different ratings of each climb. This gives how consistent the ratings are in how they relatively rate different climbs. The result is the simple formula and the Fiets formula tend to differ by around 10%, while the full-profile formula tends to differ from Fiets by 8.5%. On the other hand, my two formulas tend to differ by only 4.1%. So the conclusion is the simple formula is going to reproduce fairly well a ranking of different climbs produced by the more complex full-profile algorithm.

Anyway, rankings such as these are always going to come with a big dose of subjectivity, and as I noted no two people would agree on what the "proper" ranking is. For example, I discussed this with my girlfriend, and she suggested the formula might under-weight the importance of steepness Soda Springs, she said, clearly should not rank higher than Bohlman or Welch Creek. I tweaked g0 down to 8% to account for this perspective. This implies an extended 8.5% section now rates twice has high as an extended 3% section (before it was an extended 10% section which rated twice as high). Here's what I get:

```rank climb                               rating/OLH
2    Mount Diablo (N)                    2.30759
3    Bohlman-Norton-On Orbit-Bohlman     2.29859
4    Kennedy Trail                       2.18769
6    Hicks - Mt Umunhum                  2.11641
14   Bonny Doon - Pine Flat Rd.          1.48079
15   E. Dunne Ave (Henry Coe)            1.46687
16   Portola State Park - W. Alpine Rd.  1.36471
19   west El Toyonal - Lomas Cantadas    1.19099
20   Tunitas -Star Hill - Swett          1.14852
22   Old La Honda Road                   1
23   west Bear Gulch Road                0.336128```

The steep stuff really rose to the top. The comparison between this rating and other ratings: Fiets = 6.8%, my simple rating = 9.3%, full profile rating with 10% g0 = 5.8%. So it's coming close to the Fiets rating is placing a high importance on grade. However, by using the full profile data it's clear that a climb like Bohlman does better here than it does under Fiets, and even Hamilton does a bit better relative to Old La Honda since with this rating the short descents aren't treated quite as harshly.

I like this one. Maybe I'll stick with it.

## Sunday, July 18, 2010

### Rating Climbs: rating difficulty using full profile data

There's been two principal weaknesses with the methods I've described so far as ratings of difficulty:
1. They neglect the difficulty associated with extended steep sections embedded withing a longer climb. In extreme cases, the optimal rating comes from rating a subset of the total climb, but this obviously neglects the additional difficulty presented by the additional, more gradual climbing.
2. A climb with a short descent which then climbs steeply to make up the altitude lost in that descent rates the same as a climb which is flat for the distance taken up by that segment (the descent followed by the climb to restore the lost altitude). This really affects a climb like Mount Hamilton, which has two significant descents along its path.
I wish to address this. To do so, however, really requires using full profile data. Some have suggested using "maximum gradient" in the formula to account for sections of steepness. But this obviously doesn't work well: a road like Alba which repeatedly pummels the rider with steep gradients would need to rate higher than a road which has a single steep switchback. So the solution is to use the full profile data.

That used to be an issue, as full profile data was rare, but in this era of archived GPS + altimeter data like MotionBased and on-line profile generators like MapMyRide it's fairly easy to get a full representation of altitude versus distance.

Before writing numbers, it's important to decide what the assumptions are. For my rating, I'll use the following observations:
1. Something which gains zero altitude rates zero: it's not "a climb".
2. For the same average steepness, a climb which has more variability in its steepness is harder than one which is more uniform. This isn't always the case, actually, as gradual segments can provide some rest, but I think most of the time most riders agree the rest from the gradual portion fails to fully compensate for the increased steepness of the remaining portion.
3. A series of steep sections which can be climbed in 5 seconds each (like steep switchbacks) are easier than a single steep section of the same total distance and altitude gained.
4. A descending section reduces difficulty relative to a climb which was flat for the same segment.
5. Per unit altitude lost, a steep descent has no more effect than a gradual descent. This is unlike the case for climbing, where a steep climb has more effect per unit climbing than a gradual climb.
Once these observations are written, a formula becomes almost obvious.

For the first observation, it's clear the total rating needs to be proportional to altitude gained. This also takes care of observations 4 and 5.

For the second observation, the rating needs to be proportional to an integral of a function of the local steepness. This function needs to be an increasing function of the local steepness.

For the third observation, the steepness as a function of time needs to be smoothed with a convolution function. Note I use time because physiologically, the body doesn't know anything about distance, it just senses force (which depends on grade) and time. So I need to come with some representation of how long it takes to traverse each segment of road. This will be tricky, which suggests a numerical algorithm. Of course slower riders take more time than faster riders, but riders riding to "survive" may ride the flatter sections slower relative to the steeper sections than a rider who's racing, but this one is worth a credible attempt. One could assume constant power and solve power-speed equations, but that's not how riders typically ride: usually they use higher power on steep climbing than on descents, for example, and if the grade is varying, they'll use shallower segments for a bit of recovery to focus more on the steep arts where the effort pays off more. Of course with GPS data distance versus time may be available already. But that's only for a given rider, and the formula shouldn't depend on who's riding a climb or when.

Next is to determine what the function of steepness should be and how we should integrate it. We'll multiply an integral of this function by the net climbing to get the rating formula. this is perhaps the key question in the whole business, and it causes me difficulty every time I think about it. The most challenging part always comes down to how to give gradual climbing sections the credit they're due while handling descending segments properly.

What I want an integral which has a contribution close to a constant value for gradual climbing sections,  increases sharply with grade for steep segments, but does not increase in magnitude for sharply descending portions.  If that description doesn't scream "exponential", I don't know what does. So the function I propose for the integral is:

f(g) = (1 / L) exp ( g* / g0),

where L is the length of the climb (distance), g* is the smoothed function of rate of climbing with respect to distance and g0 is a characteristically steep grade. I assume the integral is conducted with respect to distance. All that remains is to determine g0. And the best way to do this is to run examples, then check to see if the relative ranking is consistent with experience. A value of 10% would make a 10% climb rank about twice as high as a 3% climb assuming a uniform grade. It then makes a 20% grade rate 5.5 times as high as the 3% grade, and a 30% grade around 15 times higher. This makes 100 meters gained at 30% (climbing over distance) rank the same as 1500 meters gained at 3% (climbing / distance). That seems like a good starting point. So that's what I'll use:

f(g) = (1 / L) exp ( g* / 0.075 ).

Now for the smoothing function. I already noted I wanted to smooth with respect to time, not distance. So I need to relate time to distance and g (the unsmoothed rate of altitude gain with distance).

Obviously for high g, speed is inversely proportional to g, as this is the condition of constant power. For negative g*, speed is probably relatively constant, as safety rather than physics limits the average speed. So I want a function relating time per unit distance which is constant for negative g, but proportional to g for sufficiently positive g. The following function has this behavior:

d t / d s = (1 / vmax)[ 1 + ln | 1 + exp (g/g₁ ) | ],

where t is time, s is distance, vmax is a peak descending speed, and g₁ is a constant constants. A typical value for might be vmax = 14 meters/second (around 50 kph) which yields a speed on the flats of 30 kph. Peak rate of altitude gain is gvmax. Picking g0 = 2% yields a VAM of 1000 meters / hour, a good climbing pace. So I get the following equation:

d t / d s = (1 second / 14 meters) ( 1 + ln | 1 + exp (50 g) | ).

Then there's the smoothing function to use. For example, a sine-squared function with a 15-second full-width-half-maximum (FWHM) will significantly reduce the contribution of steep sections taking up to around 15 seconds to ride. Assuming a rate of ascent of 1000 meters / hour, in 15 seconds a rider can climb around 4.2 meters, which is how far uphill a rider can coast from a starting speed of 32 kph. So both from the perspective of inertia and from the perspective of ATP metabolism (short-term power), it seems this is a decent value to use.

That's basically it, except for one additional step. To this point, I assumed profile data is precisely accurate. Unfortunately, most altimeters, even the GPS + barometric units like the Garmin Edge 500, make small errors in altitude which can result in big errors in grade. So the first step when dealing with data like this is to apply additional smoothing, for example a convolution with respect to distance with FWHM = 50 meters, to the profile. It's better if you use a computer which measures grade directly, most notably the iBike units.

So, in summary, here's the algorithm:
1. Smooth the initial profile with a a convolution function proportional to cos²(π Δs / 100 meters) for ‒50 meters < Δs < 50 meters, unless the data is from a computer with a gradiometer such as an iBike and thus grade data are available directly.
2. Determine the rate of altitude gain over the climb: g as a function of s.
3. Translate this to a function g as a function of t, using the relationship between d t / d s and g already described.
4. Smooth this function with a convolution function proportional to cos²(π Δt / 30 seconds) for ‒15 seconds < Δt < 15 seconds, yielding g* as a function of time, which is then converted back to a function of distance.
5. Integrate with respect to distance (1 / L) exp ( g* / 0.010 ), where L is the length of the climb.
6. Multiply by net climbing.
There it is, the difficulty rating. That wasn't so bad, really, other than that gnarly smoothing operation. If all you have are data every 500 meters or even every kilometer, the smoothing can be skipped (the profile is already smoothed). But otherwise, just a bit of Perl coding will do the trick.

An example next time.

## Saturday, July 17, 2010

### Rating Climbs: comparison of my formula with Fiets/Summerson formula

The magazine Fiets has a formula for climb rating which is proportional to:

rating = net climbing² / distance + (peak altitude - 1000 meters) / 100,

where the altitude term is set to zero if the altitude is less than 1000 meters. I've already noted this altitude part is silly: it allows a flat road to have a positive rating. For the rest of this blog I'll neglect the altitude part. I already mentioned Summerson uses the same climbing and grade dependence as Fiets, although his altitude adjustment is superior.  The magazine actually normalizes this rating by 10 meters, so a climb averaging 10% for 1000 vertical meters, which my representation ranks as 100 meters, would be rated 10 (no units).

Recall my formula is:

rating = net climbing × ( 1 + [10 × net climbing / distance]² )

Now suppose one climb rates 1% higher in the Fiets rating than another. How would the climbs compare in my rating? Well, if they have the same grade and differ by distance, the answer is they will also differ by 1% in my rating: both ratings scale in proportion to distance if the road grade is the same.

But now consider the case where the net climbing is the same, but the road grade differs. For this, it's useful to differentiate the equations. To simplify the writing, I'll make the following definitions:

c : total climbing
g : total climbing / total distance
r : rating

What I'm interested in here is "if I change the grade by 1%, by what percent does the rating change?" This is written numerically as (g / r) ∂ r / ∂ g .

For the Fiets formula, it's obvious:

(g / r) ∂ r / ∂ g = 1.

Since the r is proportional to g, a 1% change in g (with c fixed) results in a 1% change in r.

For my formula, it's a bit more complex:

(g / r) ∂ r / ∂ g = 2 ×(10 g)² / [ 1 + (10 g)²]

The break-even point, at which a change in grade has the same relative effect in both the Fiets formula and my formula, is found by setting this to one (as it is in the Fiets formula). The solution is trivial:

g = 1 / 10 .

So if the climb averages more than 100 meters gained per kilometer traveled, then my formula places greater priority on grade differences. If it averages less than this, then the Fiets formula places greater priority on grade changes.

This is also evident in a numerical comparison. The following plot shows the ratio of the two ratings versus climbing / distance. At 10%, the ratio is flat, as I just described.

A quick numerical comparison from this list: the Mortirolo (1450 meters), one of the most feared steep climbs in the Tour of Italy ranks slightly easier (136.3 meters) than the Stelvio (137.2 meters), perhaps the longest climb used in that same race. The Mortirolo has a higher average grade (10.5% to 7.5%) but the Stelvio climbs substantially more (1841 m to 1300 m). Note I'm again ignoring the altitude term.

With my formula, it's not as close, with the Stelvio a clear leader, 2863 meters versus 2729 meters for the Mortirolo. With the Fiets formula, the ratings differ by only 0.6%, while the advantage to the longer climb grows to 4.9% with my formula. This is consistent with the analysis I presented, however: since most of the difference in the grades is on the low side of 10%, the Fiets formula is placing more emphasis on steepness.

Another example. Here's the climb ratings versus distance yielding the maximum rating for each of the two rating systems. The Fiets formula places more emphasis on grade, so the steeper climbs tend to be ranked relatively higher, the gradual climbs relatively lower, with Fiets than with my formula. This is most notable with Mount Hamilton, which ranks relatively lowly with the Fiets formula. With Hamilton, the climbing is at a relatively modest grade, but the average is reduced even further by the intermediate descents. Another consequence of this strong emphasis on grade is that it is more likely a climb can rank higher by eliminating part of the beginning and/or end to increase the peak grade at the expense of total climbing.

Of course, my choice of 10% as the cross-over point was somewhat arbitrary, based on my personal experience. For someone living in Fort Lauderdale Florida instead of San Francisco, the comfort level with steep roads might be less, and "crossover grade" might be lower. Or if you ride a fixed gear bike, unable to shift to accomodate steep grades, it might also be lower. But I feel 10% is a generally fair choice assuming riders accustomed to the hills with geared bikes. I know in the examples from the Low-Key Hillclimbs I fear Diablo more than shorter and steeper Alba and Soda Springs, which rank comparable to Diablo under Fiets but which rank lower with my formula. So I give the nod, for my own experience, to my formula.

Still, for an ensemble of riders over roads where the grade may vary considerably about the mean, maybe the Fiets formula's simplicity makes sense. Sure, for me a 4% grade may be no tougher than a 2% grade, and for me a 20% grade may be much, much tougher than 15%, but for a relatively untrained rider or one on a fixie, that 4% grade may be much more challenging than the 2%, or for a rider with a broad-span triple chainring drivetrain, the 20% may not be a big deal. So I'm not convinced my formula is generally better, even if for a specific rider (for example, me) on a specific bike (for example, with a 36-50/11-26) it may better capture the realities of how grade affects the challenge of a climb.

## Friday, July 16, 2010

### Rating Climbs: Low-Key Hillclimbs and my simple formula

My last post I showed how to apply a simple difficulty formula to a climb from the 2009 Low-Key Hillclimb series, Bohlman-Norton-Quickert-Kittridge-On Orbit-Bohlman. To summarize, the approach was to find the road segment which maximized the rating, and to use that to rate the net climb. Using the aggregate statistics from what we used for the Low-Key Hillclimb, 593 meters gained over 7.15 km, yielded a rating of 999 meters (the same rating as a very gradual climb gaining that altitude). However, by eliminating the first 160 meters (which are gradual) and the final 1100 meters (which gain only 20 meters altitude) the rating can be improved to 1083 meters, an 8.4% increase.

Here's how the formula rates the climbs from the 2008, 2009, and 2010 Low-Key Hillclimbs. I added in the climb from Kennedy Road, for which we'd applied for a permit last year but were denied. On the x-axis is the altitude gained over the segment used for the rating (which is sometimes less than the full climb length). On the y-axis is the rating calculated for that segment: further up on the plot is considered "more difficult". Ratings and altitude gained have been normalized to Old La Honda Road, the international unit standard for bicycle climbs.

The ratio of the rating to the altitude gained depends on the grade. For sufficiently shallow grades the rating depends only on the altitude gained, so there's a minimum line on the plot below which a rating is mathematically impossible. I've used Old La Honda as a partition between what is a "steep" and what is a "gradual" climb: less than Old La Honda's 7.3% and I consider the climb gradual, steeper and I consider the climb steep.

There are plenty of examples where the rating system ranks higher a climb with less vertical feet gained due to its steepness. The key question is whether these ratings actually reflect the feel of the climb. They key parameter in the rating which affects how steepness influences the rating is that coefficient, for which I chose 10. A higher coefficient and steepness matters more. I suspect no two people would agree on the proper ranking of these climbs, and except for the obvious simplicity of a coefficient of 10, different people would have differing ideas on what the optimal coefficient should be.

A key weakness with the method is it neglects the grade uniformity. Some climbs, like Alba, Quimby, Jamison Creek, Welch Creek, and the Bohlman climbs have exceptionally steep sections which are lost in simply considering the aggregate statistics. To give proper credit to this sort of case I'll propose a formula which uses the full profile data in a later post.

Back to the simple formula: I noted that with Bohlman-Norton the rating was improved by using a subset of the full section of road used by Low-Key. I calculated how for all of the climbs in the plot how the rating of the full climb compared to the rating of the optimal segment. The result was that on average the optimal rating came from using 93.4% of the distance of the road, including 98.1% of the climbing, with the full road length scoring 97.9% the rating of that optimal segment. So had I used only the aggregate statistics from the series, perhaps not having access to full profile data, I'd have scored the climbs on average 2.2% low. Climbs were the rating loss was at least 5% included Kennedy Fire Road (11.7%), Bear Gulch (9.5%), Bohlman-Norton (7.7%), and Metcalf Road (6.1%). On 6 of the 24 climbs the full route was optimal.

So that's enough on this matter. Next I'll look a bit more closely at comparing the Fiets/Summerson formula with my rating.

## Thursday, July 15, 2010

### Rating Climbs: Bohlman-Norton-Kittridge-Quickert-On Orbit-Bohlman

Here's some simple examples of running the proposed formula, which is:

rating = net climbing × (1 + [ 10 × net climbing / distance ]²)

Here's the profile for a climb which was used in the Low-Key Hillclimbs in 2009, Bohlman-Norton-Kittridge-Quickert-On Orbit-Bohlman (for brevity, I'll refer to this as "Bohlman-Norton" from here on):

The obvious question on this route is: is it one climb or two? John Summerson ends the main "climb" at the top of On Orbit Lane, right before the short descent at near mile 2.5, with what follows after corresponding to a second "climb".

For each possible segment length, I then found the segment which maximized the net climbing. This maximizes the rating. The top of On Orbit is often the optimal point to finish the "climb", until the segment length becomes so long that the subsequent descent must be included. It actually turns out to be more beneficial to start the climb at the beginning of the steep section near 1.5 km than to finish it at On Orbit, for some segment lengths. Note for simplicity in calculation I've switched to metric units instead of the imperial units usually used in the Low-Key Hillclimbs:

I then calculated the rating associated with each of these segments

The x-axis shows the length of the road segment used for calculating the rating, while the y-axis shows the rating which results from that segment. Initially, the longer the climb, the more climbing, all of it the relatively steep section up to 4 km (2.5 miles), and the rating increases. But then then the algorithm is forced to accept the descent from On Orbit, dropping the rating. Adding more distance, it includes the climbing beyond On Orbit, and the rating increases again, eventually passing the previous peak which ended at On Orbit summit. Longer than this global optimum and the final rollers at the finish force the rating down again.

Here's the profile again, plotted in metric instead of imperial units, with the segment yielding the optimum rating shaded green. It begins 160 meters after the start of the Low-Key Hillclimb, and ends at On Orbit summit at 4 km.

So what's the conclusion? Basically that it's a better climb including the On Orbit descent and the climbing which follows than it is to end at the On Orbit summit, at least according to the rating scheme. I say "better" instead of "harder" because of course adding distance and climbing is going to make it tougher, but the purpose of the rating is to rate the climb itself, a subtle distinction.

Next I'll look at statistics from a broader set of climbs.

## Wednesday, July 14, 2010

### Rating Climbs: a simple formula

Last post I reviewed some existing ratings for climbs. All fell short. With this in mind, I propose my own rating here.

First, a quick review of my rating philosophy:
1. For simplicity, the rating should be based on net climbing and distance.
2. For sufficiently gradual grades, the rider is assumed to be able to shift to remain in a comfort zone on the climb, and difficulty is then proportional to altitude gained.
3. Beyond a certain grade, climbing becomes much more difficult. It may be possible to construct bicycles which can climb steep grades relatively easily, but the rating is designed for a "typical" fit rider on a typical racing bicycle.
From the description, an obvious candidate for the rating is immediately self-evident for fans of polynomials:

rating = net climbing × (1 + [K × climbing / distance]N)

The only question is then: what value of K, and what value of N?

First, K: K is the distance / climbing at which a climb is twice as steep as it would be were it more gradual, neglecting issues of added distance traveled (which we're not including in "climb difficulty"). When I'm riding, personally I find "really steep" kicks in at around 12%. Think Metcalf at this past Sunday's LiveStrong Challenge. But the key is that climbs with a high average grade typically vary a bit, or even more than a bit, about that average. So a rock-steady 12% average might be less difficult than the "typical" 12% average grade, which has sections at 15% or more, and others at a more modest (but still steep) 7%. So after playing around with ratings a bit and looking at climbs I know well, I determined a rate of climbing of 10% was a good number to use here. In other words, K = 10.

Next, there's the issue of N. N = 1 reduces to the formula used by Summerson (for infinite K). Honestly I don't think that does justice to really steep climbs like Filbert Street in San Francisco. Filbert gains only a bit over 20 meters, but it's a lot tougher than a 40 meter climb at 15%. So next I tried N = 2. That seemed to work well. N = 3 really kicks in the difficulty at steep grades, but didn't do enough for moderate grade roads.  To be honest, I was going to pick N = 3, but after experimenting with some local climbs, I went back to N = 2.

I plot the formula's result for grades up to 30%. Note this is difficulty per unit climbing, not unit distance traveled. To convert to grade you can use high school trigonometry:

grade = (climbing / distance) / √1 - (climbing / distance)²,

or equivalently

Climbing difficulty per altitude gained

This seems to capture things fairly well. It says Filbert Street, the stiff portion of which gains around 18 meters @ 32% actual grade, corresponding to climbing / height = 30.5%, is equivalent to a 5% climb gaining around 150 meters. Well, difficulty on such a steep climb is hard to assess (for example, I might personally find 35% unclimbable), but for a quick-and-dirty rating, not too bad.

So there it is: my proposed formula for ranking the diffulty of climbs:

rating = net climbing × (1 + [10 × climbing / distance]²)

There's still one open question, however: how do I define a climb? Answer: a "climb" is a segment of road which has a higher climbing rating than any overlapping segment of road. What this implies is no "climb" should be rated lower than any subset of that climb. So suppose a climb starts gradually,then is steep for awhile, then levels out, like Metcalf Road.    One should be careful to consider using the steep portion rather than the absolute endpoints of the altitude-gaining segment for the rating.  More on that when I show some examples, but this is a bit of a point of weakness in the rating scheme versus one which used a detailed profile of the climb.  I'll make an attempt at such a rating system in a future post.

## Tuesday, July 13, 2010

### Rating Climbs: some existing formulas

Fillmore Street in San Francisco: short and very, very steep.   Webcor Cycling

The last time I wrote on this topic I described some of the issues with rating climbs. Here I'll describe some of the existing formulas.

First a quick disclaimer. I tend to interchangably use grade and climbing/distance. By grade here I generally mean climbing/distance, even though grade is formally rise over run (not over the hypotenuse).

net distance
Let's start simple. One formula is distance. This seems absurd, but it's one you even hear today from commentators on bike racing. "Road xxx climbs for yyy km." Obviously distance provided difficulty, but we're interested here in the difficulty of climbing, and without considering road grade, distance is a very weak metric.

net climbing
Next is total climbing. As I noted climbing can be measured as net or gross climbing, but for simplicity I'll stick with net climbing. Then the total climbing is the initial altitude subtracted from the final altitude.

This actually is a fairly good metric if you assume the rider has an infinite range of gears, and rides a bike with a sufficiently long wheelbase that lifting the front wheel is never a concern, and the stability isn't affected. Whatever the grade, the rider can move along with a comfortable force on the pedals. From a simple energy perspective, the best way to gain a certain amount of altitude is in the shortest distance possible. Looking just at the climbing component, the energy requires depends only on the weight of the rider and all of his equipment multiplied by this altitude change. Other energy components, like rolling resistance and wind resistance, are less with a shorter path than a longer one.

The issue here is that most riders on racing-style bikes don't have an infinite range of gears, and the wheelbase is short enough that the wheelbase is short enough that less of the weight is supported by the front wheel, making it easier to lift that wheel off the road. Additionally, inertia is less, so the bike doesn't coast as well, making it more important to apply a continuous propulsive force on the pedals without dead spots. And when the bike it tilted upward, the intrinsic stability of the trail is reduced. To understand this latter effect, consider that when you tilt the bike to the right the front wheel wants to rotate into the lean, which will cause the moving bike to be restored towards being upright. But if the bike is vertical (wheels stacked one over the other), this effect is gone; gravity no longer causes the wheel to respond to changes in the bike's "roll". An additional effect is for the trail to provide stability, the bike needs to be moving forward, and thus bikes become less stable when moving very slowly. So considering all of these effects, if the hill gets steep enough, it can become very unpleasant to ride the bike.

climbing² / distance

The issue with this core formula is that it suggests, for example, that a 6% grade is twice the "difficulty" of a 3% grade for the same net altitude gained, which most fit riders would agree is not the case. this comes back to the use of net altitude to rate climbs: as long as the bike has adequate stability, gears are low enough to provide a suitably low pedal force, and the front wheel doesn't lift off the pavement during pedaling, climbing a certain number of vertical feet isn't particularly harder at a steeper grade than a lesser one. It's only when the grade reaches a certain threshold that it causes a problem. And beyond that threshold, it can become a really big problem.

climbing3/2 / distance1/2
John tried to strike a compromise in the formula described in his text (not the one used in generating ratings) by multiplying the square root of the grade by the altitude gained. This mitigates the issue of a 6% grade being rated twice as hard as a 3% grade: instead it becomes only 41% harder. But on the other hand, I think most people would agree that a 30% grade is at least twice as hard, for the same net climbing, as a 15% grade. So the square root doesn't quite do justice to truly steep roads.  It fails to recognize grade becomes an issue only when it gets steep.

ClimbByBike
So to address this more complex formulas have been proposed. John's formulas have the advantage that they have no parameters: altitude and grade are indesputable characteristics of the hill.  The rating doesn't need to "know" anything about rider fitness or gearing or bike geometry.  But sometimes a bit of complexity is merited in the name of accuracy.   Sometimes it's worth making "reasonable" assumptions about these sources of variability.

One such attempt is from Climb By Bike. Their metric is:

(H / D) × 400 m + H² / D + D / 1000 + (T ‒ 1000 m) / 100,

where H is the net climbing, D is the distance, and T is the peak altitude.

This formula has serious issues. First, consider the first term: (H/D) × 400 m. This is independent of how long the climb is. So a climb which gains 2.5 mm in 1 cm of distance scores 100 meters here. Another climb, which gains 100 meters over 2 km, would score only 27 meters total. So the formula suggests that climb of 2.5 mm over 1 cm is close to 4 times as hard as climbing 100 meters over 2 km. That's just plain silly.

Next, the final term. This gives a climb a fixed score simply for the altitude. Same issue: an absurdly easy climb starting from a few thousand meters of elevation could be rated higher than a quite challenging but short climb at sea level.

Both of these issues are due to a fundamental problem: these difficulty components (grade and altitude) should be multiplied with, not added to, terms proportional to altitude gained or distance traveled. A nice rule of thumb is if the climb is twice as long, gaining twice the altitude, the rating should double. These two "bonus" terms don't change with the length of the climb.

A final issue with the formula is it is giving a bonus for distance, which might allow that a climb of lesser grade is rated higher than one of steeper grade for the same net climbing. As I discussed in the previous post, such a road may be harder to ride, but that doesn't mean "the climb" is tougher. So I prefer ratings where a more gradual climb is never ranked harder than a steeper climb for the same net climbing.

The core of this formula is the one used by Summerson: H²/D. The attempt to improve that formula's deficiencies is laudible, but failed.

I'll describe my formulas in the next post on this subject.

## Monday, July 12, 2010

### 2010 LiveStrong San Jose

I've been through this before: ride a hard double century, feel indestructable in the days following, fail to give my body the hard recovery it secretly craves. After Terrible Two three weeks ago, I didn't do anything overtly stupid; I even scaled back from my normal training. But despite this, after the following weekend, I was simply spent. I suspect allergies had a hand to play in this, as well, but then I think one becomes more sensitive to allergies when the adrenal system is overtaxed. And if double centuries are designed to do anything, it's overtax...

At the start of the Livestrong San Jose, I was pleased with the generous support of donors to my ride. I think it helped I'm matching donations with one of my own to the Peninsula Open Space Trust, to whom I feel a huge debt for their work to preserve the lands which make the region between San Francisco and Santa Cruz such a cycling paradise. So the Lance Armstrong Foundation and Open Space were both beneficiaries of my ride today.

At the ride start the positive feeling from everyone was infectious. This had nothing to do with Lance Armstrong's day job: so he happened to race a bike with an affinity for a particular race in France (little did most of us know what Lance was having what was clearly his worst day in that race in 14 years.) Instead it was all about Lance Armstrong's tremendous work towards raising cancer awareness. Lance came to the brink of death and not only survived but went on to physically thrive as so few people can (no snide remarks about doping: a huge number of enormously talented athletes using similar methods were unable to seriously challenge him during his seven-year reign of the Tour). Had there been a Lance Armstrong Foundation in late 1995 and early 1996, when Lance experienced the first symptoms of his disease, what was a close brush with death could have been a much more straightforward treatment. It's shocking, really, that cancer in a man who's body was his principal asset, an asset exposed to daily care and pampering, went so long undiagnosed.

My only riding the preceding 7 days had been trips of a few miles for simple transportation. One thing I've learned is that when your body calls out for rest in a particular way, you listen. Normally I like to wait before riding again until I feel restless: the feeling I have to ride or else I'll go crazy. I wasn't quite there yet, but compared to the suffering of the cancer patients who are the focus of the ride, I had to be there.

Often, though, you're ready for something before you realize it, and once we were riding, I knew I'd be okay. I stayed near the front during the opening twn miles during which we had a rolling police closure. Finally we hit Shannon Road, the first climb of the day, and although I was relatively close to the front (around 20th) I was still a bit too far back to make the first split. I went over the top solo, but was caight on the descent by Yahoo's Jane Despas and Kevin Klein, and Webcor Alto/Velo's Pete Tapscott. We joined Trek-Livestrong's Ben King and (I think) Julian Kyer. My Roaring Mouse teammate Tyler Swartz also ended up in the group and a few more guys I didn't know.

We went well. I took a few pulls but not too many. My lack of riding for seven days, though, took its toll. As we approached the rest stop at mule 29.5, I decided to stop for some food and drink. The others continued on. They'd go on to stop only once during the 100 mile ride, at the mile 40 rest stop.

But from that stop I was able to enjoy myself a bit more. I liked being able to pause at some of the aid stops along the way and thank the volunteers for their wonderful assistance and cheer. I rode for a bit with Linda Jackson and two Team Tibco supporters, but most of the time I was riding alone. Honestly, though, I didn't feel alone at all. I felt the volunteers (500 in all!) and general spirit of the event supported me the entire day.

The highlight of the route is Metcalf Road, a little brute of a climb which averages 12% over much of its 970 vertical feet. I was a bit discouraged because a Third Pillar rider, who'd been riding with a female teammate, passed me on the climb and definitively dropped me. But approaching the top, a volunteer emptied a water-soaked sponge onto my back, providing an invigorating kick against the warming day and the exposed slopes of Metcalf.

From the summit of Metcalf at mile 75, I got to experience wonderful San Felipe Road for the first time (I'd climbed Metcalf once before). Then it was a matter of penetrating sprawling San Jose. I was surprised some of the busier intersections were still controlled by police. The organization of the ride was simply superb.

A bit of an anticlimax jumping from one traffic light to the next approaching downtown. But this didn't temper the joy of crossing the finish line, 5 hours and 15 minutes after I'd started. Not the most blistering pace, but that wasn't the point. It was in every way a wonderful day, a day to celebrate life and health even in the sobering face of so much sickness and death.

So thanks again to all of my supporters. And I encourage more people to consider this ride in years to come. I really hope the issues between Lance Armstrong and Floyd Landis don't hurt the wonderful work the Foundation is doing. It's a breath of fresh air in the fight against cancer, one that was sorely needed, and they have plenty of work left to do.

## Saturday, July 10, 2010

### Rating Climbs: Introduction

There's been a number of formulas proposed for rating the difficulty of cycling climbs. The Tour de France, as do essentially all stage races held anywhere roads go up and down, rates climbs. However, these ratings depend on many factors other than the intrinsic nature of the road itself, for example position in a stage, position of the stage within the overall race, and on the number and nature of other climbs both within the stage and in other stages. The goal of rating climbs isn't to reproduce the ratings used in the Tour de France or any other race. Rather it's to come up with an intrinsic rating which describes how challenging that climb might be, by virtue of its climbing, for a typical fit rider with typical road gears without stopping to rest. Obviously a 200 mile flat road in the heat is challenging, but it has a climb rating of zero, while a 100 meter road gaining 5 meters is substantially easier, but has a climb rating larger than zero. So we're talking here about simply the climbing component of difficulty.

Everyone who rates climbs basically agrees on two things:
1. longer climbs rate higher than shorter climbs, for the same steepness
2. steeper climbs rate higher than more gradual climbs, for the same distance
Okay, so far so good. But after this simple point, there's less agreement.

Another nice feature of ratings is they are linear. In other words, if I have a long climb and I divide it into two segments, the rating of the total climb is the sum of the ratings of the individual climb segments. This may seem obvious, but it actually presents major difficulties. For example, I may know that a climb gains 1000 meters at an average grade of 5%. However, if I divide the climb into two, it isn't necessarily the case each segment also averages 5%. Maybe the first segment averages 6% and the second averages 4%. If the rating of a climb is a linear function of aggregate variables for that climb, for example a sum of coefficients multiplied by total climbing, total descending, and total distance, linearity will apply. But we may want more than this, so linearity may be tough to preserve.

But do you even want to preserve it? Climbing 1000 vertical meters at 10% may be more difficult than ten climbs at 10% of 100 meters each. Legs fatigue, and fatigue makes additional climbing tougher. This effect can be captured with a linear formula, of course, but this adds complexity. So for the purposes of this work, and in general for most of the rating schemes generally used, linearity is abandoned.

Then there's the issue of how descending during a climb should affect its rating. If descending is ignored, then the rating is based on gross climbing. On the other hand, if descending segments cancel commensurate climbing segments, then the rating is based on net climbing. We all agree that climbing up 1000 meters then descending 1000 meters is generally more difficult than riding without gaining or losing any altitude along the way. But a climb rating isn't necessarily rating the difficulty of riding the road. It's rating something different: the merits of that road as a climb. Descents provide a mental and physical break from the effort. So there is justification in using net climbing as opposed to gross climbing. This is what John Summerson does in his Guide to Climbing by Bike series. An additional benefit of net climbing is it is much easier to determine. All you need to know is the starting and ending altitudes of the climb, whereas for gross climbing, you need a detailed profile, preferably with points spaced no further apart than 50 meters or so, to capture even small dips in the road. Determining gross climbing is worth a whole blog post in itself. So virtually all the climb rating schemes use net climbing: it's simply easier to compile a list of ratings from available data, and in the end there's justification for that approach anyway.

Then there's the issue of gearing. Obviously with low enough gears and a bike set up with suitable geometry so the front wheel doesn't lift off the ground during pedaling, even the steepest roads lose their challenge. So for typical ratings, it is assumed a rider on a relatively standard bike with a relatively standard 2×10 drivetrain. Dan Guttierez made a wonderful bike specifically designed to climb Fargo Street in Los Angeles, a road which averages over 30%. Here's a video of him in action with his machine.

I'll discuss some formula options in my next post on the subject.

## Friday, July 9, 2010

### Tour de France stage length statistics by decade

I was watching VeloCenter where Scott and Todd were droning on and on about how long today's stage of the Tour was: 227.5 km (or, using their preferred units, 141 miles). Now I agree that's a long way to race, but anyone who's followed the Tour for any significant number of years knows 227.5 km is hardly extraordinary. Memories of LeMond racing in the 1980's where the long stage was 270, 280, or even 300 km...

So I decided dig into some real statistics. For stage length, I relied on the excellent web site Memoire du Cyclisme. I found these pages easier to mine than Wikipedia. So I wrote a Perl script to download the relevant annual web pages from the site and sweep the HTML for stage lengths.

First, I plot the data for each year using a log-normal plot. The x-axis describes stage length, while the y-axis describes the rank of the stage having that length. Each decade in the plot (only even decades to avoid too much clutter) is then represented by a curve. The median stage has a y-value of zero. So if stages in a given year are longer, the curve for that decade will be further right. I added the plot for this year's Tour as points.

You can see a clear trend leftward. Stages have been getting shorter. But while the long stage this year may be relatively short, the points for 2010 fall generally on the curve for the previous decade (2000-2009).

There's a lot of information in that ranked distance plot: maybe too much. To simplify, I extracted the median stage for each decade, along with the average maximum distance for each decade. Again the trend is clear. The median stage length has been dropping. But more dramatically the truly monster stages from decades past has been diminishing.

A lot of this probably has to do with the changing nature of the Tour. The Tour started to sell newspapers. In news stories, you can't see speed, it's hard to grasp speed with words alone. But distance: that's another matter. Reading of epic journeys as riders travel more than 400 km in a day, starting not long after midnight and finishing just in time for the paper's deadline, is inspiring. People wanted to read each day not only of who won, but more importantly who'd survived.

These days, it's all about television coverage, and television only has so many hours. Make the stages too long, and riders slow down, finish times become less predictable, and the Tour becomes logistically more expensive. So while fans still demand the organizers expose the riders to an adequate amount of suffering, the days of stages over 250 km seem to be over. Want a death march? Check out Race Across America. The Tour is about speed.

So what next? Will the trend continue? Or will the Tour hold firm at its current length. I may be old fashioned, but I like the long stages. The average rider can, with a bit of training, do 200 km in a day. Certainly it makes the Tour more inspiring if the pros do at least a similar distance. It makes the race epic in a way it wouldn't be were the stages more comparable to a typical US race.

## Wednesday, July 7, 2010

### reflections on Tour stages 3 and 4

Last post, I feared the carnage and chaos which awaited stage 3 of the this year's Tour de France.

The consensus among riders has been that the cobbled paths of Paris-Roubaix had no place in the Tour, it being inappropriate to introduce so much randomness and risk-taking into a single stage. On the other hand, the organizers position was riding on cobbles was an important part of the tradition of road racing, and the Tour was a test of the best all-around road racer, not simply the one with the best tried-and-true combination of climbing and time trialing which all too often seems to reduce the Tour to a predictable script.

I've been in the former camp. I empathize with riders who invest their entire season on a good performance here, only to be stuck behind a crash in which they had no part. The pressure to stay ahead of these unavoidable crashes creates a dangerous game of musical chairs, creating still more crashes on the kilometers leading up to the cobbled pavé.

It turned out better than I expected, although this is hardly consolation to Frank Schleck, who's had extremely good form coming into the Tour and was a favorite for the yellow jersey. Frank crashed on the cobbles, fracturing his collarbone, and is out. Former winner Carlos Sastre got caught behind a crash and lost time he could ill-afford to give up. And seven-time winner Lance Armstrong proved luck isn't always on his side by flatting, losing more than a minute to defending champion Alberto Contador. But there were no mass-pileups, only controlled as opposed to unfettered insanity.

Two big reasons for this. One was the dry weather: the cobbles in the rain are absolutely treacherous. The other was what appeared to be responsible behavior by the riders. Going into the cobbles riders weren't taking the suicidal risks to reach the front you sometimes see in the one-day classics. It was as if riders knew their place and allowed the "general classification men" their room.

And while Frank crashed, it was in a relatively small incident, and you could argue his lack of skill riding on the cobbles played a role. Frank has never raced the classic one-day races on similar roads, unlike Lance Armstrong for example, and if such a lack of skill was exposed, than that's racing. And while Lance punctured, perhaps he took a risk in using deep-dish carbon rims, which are considered more puncture-prone than shallower, more flexible aluminum rims. Or perhaps Armstrong failed to use liquid latex in his tires, which could have sealed a leak before too much loss of tire pressure. I don't know. But while surely bad luck is involved in most mishaps, so is preparation for the bad luck.

Lance Armstrong's wheels not what you'd typically expect to see for a visit to the Hell of the North (CyclingNews)

Despite all of this I was against the stage's inclusion in the Tour. Rain in Belgium and France in July is common, so they were lucky to have had the conditions be so favorable.

But we speak with our actions more than our words, and my actions were to stay glued to the computer for 110 km of racing watching live video, getting exposed to numerous Sidi Cycling commercials and even a Swedish commercial for a shotgun (!!!). I hardly feel motivated to go out and purchase a firearm, but delivering views of ads is delivering value to advertisers, and value = money, and money drives the Tour.

In contrast, today's stage was a far more conventional "sprinter's" stage in France. Instead of 110 km, I watched this one for only 5-and-change.

And what did I see in these 5+ kilometers? I frightening series of roundabouts, riders increasingly splitting their way around these circular obstacles, somehow navigating the bends and constrictions without carnage. I simply don't know how they do it. They come into these things taking up the full width of the road, which then splits, narrows, and turns, and they string themselves out mid-turn, narrow at the last moment to avoid traffic-calming protrusions, and rejoin on the opposite end. Absolutely incredible bike-handling coherence. So even these "conventional" stages expose riders to risks, risks which most people would consider insane.

So I doubt the promoters of the Tour regret their decision. It certainly generated enormous attention for the race at a time it is competing against the soccer World Cup for attention. Yet another flat-stage-plus-field-sprint wouldn't have come close.

## Monday, July 5, 2010

### Tour de France: opening stage carnage

Well, within an hour of my previous post, stage 1 of the Tour ended in serial carnage. First Cavendish crashed with Freire and a few other riders, then a mass-pileup took out most of the remaining field, then a forward-moving domino effect eliminated Tyler Ferrar from green jersey competition. For him to make up the ground he lost on Thor Hoshovd would require Thor to suffer some mishap. The #1 rule of the green jersey is you must be in the points every day. This is because the difference between a winning sprint and a medicre sprint is a lot less than the difference between a mediocre sprint and no sprint at all. So Tyler was a big loser on stage 1.

But then came stage 2, which was going to be an interlude between chaos. Instead, there were multiple riders down on the wet descents, including poor Christian Vandevelde who was taken out of GC contention, and may be out of the Tour completely (he went to the hospital after the stage, according to his tweet). The field neutralized to allow the afflicted to get back on, but Christian appears to have been too badly hurt to do so.

Tomorrow: stage 3. I'm guessing a rider protest will turn this into another parade. Two days of carnage is enough. But we'll see.

Tomorrow is also the day Greg LeMond predicted that Armstrong would withdraw, claiming he'd not be with the Tour by the time it entered France. The implication is he'd be afraid of legal action against him following Floyd Landis' claims. But I disagree. Armstrong is responsible for enormous interest in the race, and interest means value to sponsors, and value to sponsors means money enormous quantities of money. Worrying about what happened the better part of a decade ago isn't worth all of that to the Tour or to the UCI. Armstrong gets a pass on this one.

Tomorrow will be interesting, however, no matter what.

added: VeloNews has a good article on what they're calling The Stockeau Massacre. Oil on the wet roads from a crashed television motorbike. Not a good start to the 2010 Tour.

## Sunday, July 4, 2010

### crazy stages in Tour de France

The Tour started yesterday in Rotterdam, the start of 4 crazy days of bike racing.

First, the prologue. This is amazingly the third consecutive Grand Tour (after the tours of Spain and Italy) to start in Holland, and for each, it's rained. A rainy prologue makes for changing conditions, and in this case riders like Christian Vandavelde, Dave Zabriskie, and Bradley Wiggins gambled with an early start time, hoping the weather would worsen for during the traditional start time for the favorites, prime-time at the end of the day. But while early-starter Tony Martin was able to squeak through with good conditions, these others were faced with rain and wet roads, while Armstrong, Contador, and Cancellara enjoyed some of the best conditions of the day starting in the final slots.

Stage 1 is going as I write this. In the Dutch stages in the previous two grand tours, there's been carnage in the streets, as riders were faced with a seeming endless series of traffic circles. Today's stage makes a relative bee-line out of the country, though, ending in Brussels. But despite leaving Holland behind, the riders still face a nasty finish, with two sharp lefts. From MayMyRide:

Stage 1 finish, from MapMyRide

Stage two is a mini Liege-Bastogne-Liege, a Belgian classic characterized by a seemingly endless series of short climbs. Cool: I like seeing some climbs to early on to break up the tired formula of a first week of flat stages.

But the real kicker is stage three. A good description of the stage is VeloNews. This day is described as a "mini Paris-Roubaix". But you simply can't put Paris-Roubaix in the Tour de France: the dynamic of a stage race and a one-day race are too different. In a one-day race, placing is all that matters, and time is irrelevant. With each team, there's typically one guy going for a top place, maybe two, three only in the case of a top Belgian team, the rest of the riders in supporting roles. Guys will give it everything to help, then if they get caught behind crashes, they call it a day and ride it in, or often check out at the next feedzone.

Riders training on the cobbles (VeloNews)

But in a stage race, it's way different. Sure, there's still a bunch of guys looking for placings. But then there's a whole other bunch of guys for whom time is everything, plus guys supporting these "general classification" riders. They all need to be in the front going into the cobbled sectors. But there's simply not room at the front for them all, so you end up with a game of musical chairs where the losers end up battered and broken on the side of the road, or at best eliminated from contention all too early from a race which is a large component of their professional success.

Stage racing has two rules which are designed to promote rider safety and increase the fairness of the results. One is that if a group arrives together at a finish, all riders in the group are given the same time, even if it takes a number of seconds for the group to pass. This prevents guys from having to sprint from the middle or the back of the pack, which could obviously be dangerous, with riders passing each other at full speed with nowhere to go if anything goes amiss. Instead, the leaders sprint, and the remainder predictably and unhurredly follow each other across the line.

The other rule is that a rider who crashes, or is caught behind a crash, in the final 3 km of a stage ending on flat roads is given the time of the group he was with when he crashed. This is designed to reduce the pressure for riders to be near the front of the pack. If the rule were not in effect, then all of the contenders for the overall best time would need to stay up near the front with the sprinters going for the stage placings to avoid the possibility of a crash holding them up on narrow roads. With the rule, while the chance remains that being further back will result in getting injured in a crash developing ahead, the risks of time loss are are at least reduced.

Neither of these rules applies as the field recklessly hurtles toward the critical start of each cobbled sector, however. Riders will be doing anything, taking crazy risks, to get up to the front. Carnage.

I hope a miracle happens and all the riders are able to get through this stage intact. In a profession where the career is so short, where your ability to continue is continuously reevaluated based on your current year's performance, a serious injury which takes you out of the most important race of the year can have profound influence on your ability to continue. It's terrible when riders lose a season or a career due to a stupid crash which simply isn't their fault. And this stage is designed to create such injuries.

Survive the day, however, and it's an impressive route for the Tour this year. I just hope the best riders are still there to see it.

## Thursday, July 1, 2010

### Western States 100 Pacing

A bit more on the Western States 100, held in California near Sacramento this past weekend...

The race is considered to have been extremely tactical by ultramarathon standards. By Duncan Canyon at mile 23.8, a lead group formed of Anton Krupicka of Colorado, Geoff Roes of Alaska, and Kilian Jornet of Spain.  They mostly stayed together until near 45 Geoff fell off the record-shattering pace being set by the other two. Some thought this was a tactical decision but after the race Geoff admitted he simply couldn't keep up.

Anton and Kilian continued to push each other hard, trading the lead, with Kilian going ahead on descents and Anton catching him on climbs. Kilian perhaps made the mistake of doing the race without carrying water, while Anton carried two bottles, and thus Anton was able to make faster transitions through aid stops. Since Kilian didn't want to let Anton get a gap on him, this caused Kilian to rush at rest stops and fall behind on hydration, a critical error over 100 miles.

Finally, around mile 80,  Kilian hit the bottom of his reservoir, had to stop and rest in the shade, and never fully recovered. Anton thought the race was his to lose at this point: he'd broken his main competition. But in doing so, Anton had also suffered himself, and meanwhile Geoff had been running his own pace, and taking by his own estimation more calories than he's usually able to in races (400 kcal/hr). So while Anton was forced to slow his pace on descents to spare his legs, Geoff was flying. Anton had a 15 minute gap at mile 78, but from there Geoff made enormous progress, closing to 3 minutes at mile 85, and catching Anton by mile 90. From there, Anton said he was able to close a bit on Geoff on the climbs, but there simply weren't enough of these, and the rest of the time Geoff was faster. Geoff finished alone in 15:07, with Anton crossing for second 6 minutes later (also shattering the previous course record). Killian finally finished around 57 minutes after Geoff.

First I plot the time versus distance for each of the three leaders, along with a constant pace line. The course profile is hardly uniform, so a uniform pace obviously isn't expected. But still, you can see a clear trend. Each of the three moves out ahead of the constant pace schedule and then holds that gap for awhile. But one-by-one, they fall off that schedule: first Geoff, who recovers at the constant paceline. Then Kilian, who is unable to recover and continues to lose ground until the final 7.7 miles (where he's actually faster than Geoff and Anton). Then finally Anton, who is almost able to follow the winning schedule, falling just short, as I've already described.

Next I look at the time gaps from Geoff, the eventual winner. This plot simply reinforces the previous one. Shown here, Geoff's come-back is dramatic.

I then show the pace (runners quantify pace by its inverse, the time per distance, rather than the distance per time used in all other aspects of the universe...) On the plot I also show Don Lundell's pace here, except scaled by 60%. Don Lundell, one of the owners of Zombie Runner, did Western States on what I'd consider the bare-minimum of training, yet was able to finish strongly, mid-pack, in 176th place after running through the night. Yet despite the very different circumstances, Don's pace after the 60% adjustment isn't that much different from the top three. Don ran under the full moon from approximately miles 65 to 90, and you can see that slowed him a bit relative to the Anton and Geoff, but then he finished strongly. Other than the natural slowing from lack of light, however, Don never faded, despite carrying around 10% of Anton's training miles into the race.

Overall, a fascinating event.   Who in our modern society can even contemplate running 100 miles?   To do that in a week is an impressive feat, in a day incomprehensible.   Yet there it is: the human body is clearly up to the task, if we allow it.