Tuesday, August 3, 2010

CP model parameters from maximal power curve: introduction

GoldenCheetahThe critical power model is a very simple approach to estimating the amount of power one can produce in a given activity for different durations. For example in my experience it is most often applied to cycling. What I describe here I implemented in GoldenCheetah, an open source power data management program written in C++.

The model's assumption is there are two components to power:
  1. an anaerobic work component: The body has a certain amount of anaerbic fuel which it can use to produce power. Spending that fuel in a short time results in more average power, spending it over more time results in less average power. For steady anaerobic power, the product of the power and the duration it can be sustained equals the anaeronic work capacity (AWC) for the given individual at the given time.
  2. aerobic power: In addition to anaerobic power, there is a certain amount of "aerobic" power which can be sustained indefinitely.
Obviously this model breaks down at both short and long times. At short times, for example less than a minute, it becomes impossible to reach an anaerobic power high enough to "spend" the entire AWC. On the other hand for long efforts the aerobic power is no longer sustainable. Despite this, for efforts from around 2 minutes up to around 30 minutes the model does a fairly good job while still being simple enough for doing calculations in your head while on the bike with a bit of practice.

For example, if my CP = 260 W, and AWC = 20 kJ, if I'm riding for 200 seconds, the model predicts I can sustain 100 W over my CP, or 360 W.

But the question is then what values to use for CP and AWC. There exist a large number of web apps and spreadsheets to do the simple calculation: given a power derived from a short-time test (for example 5 minutes) and a longer-time test (for example 20 minutes) it's simple to fit a slope and intercept to work done versus 1/interval length to get CP and AWC.

But the problem is these spreadsheets require you to have a maximal effort at each of two precisely defined durations. This is difficult in practice: you need to guess what effort is sustainable for the target duration, and hope you can hold that effort for the full duration and no further. If you start too hard, you'll run out of steam before the finish (unable to sustain even CP), while if you start too slowly, you may end up finishing with too much left in the tank.

Suppose I go out and try to hold 300 watts, which is over my critical power. I'm not sure at the start how long I'll be able to keep it going: maybe 10 minutes, maybe 20. But at some point, no matter how hard I try to motivate myself, i am done. Then a few days later I go out and try to sustain 400 watts. That obviously doesn't last as long. Now I have a set of data comprising high powers for short durations (up to the duration of my latter effort), then moderate powers for durations of to that of the first effort. Since neither of these efforts was truly uniform, there is are different max sustained powers for each possible effort duration.

Or more typically I may go out and ride hard or race and hard efforts are randomly distributed among recovery segments. Certain durations end up with relatively high maximal powers, while others end up with relatively low maximal powers. The following plot shows an early example from my days of power meter use.

typical maximal power data

One approach which has been taken with data such as these is to do a regression: for each duration, determine the maximum work done during that duration (as opposed to maximal power), then over some set of durations (for example, from 3 minutes to 30 minutes) fit a line. The slope is then CP, the intercept AWC. However, a regression results in some data falling above the regression line, others below. Yet by definition no points should fall above the curve. The CP model represents the best possible effort for each duration, not a typical effort.

regression of maximal power data

So instead the goal is to come up with a line which touches the data at two or more points but above which none of the points lie. Think about it this way: suppose the values of maximum work done for each time duration form a surface, and I drop a meter stick onto that surface. It rests against the surface, likely at two points. The goal is to find the two points.

The following example shows how the same set of data can yield either of two fits. So the solution to the problem I pose is not intrinsically unique. I need to make some sort of assumptions to choose between the two. In one case, the fit results in a higher AWC and lower CP, in the other case, a lower AWC and higher CP. This is a pathological example, of course, and given a reasonably rich data set, the ambiguities will be far more subtle.

multiple solution example

I'll describe my algorithm next time.

No comments: