Automatic CdA and Crr estimation in Aerolab

1,234 views
Skip to first unread message

Ale Martinez

unread,
Aug 24, 2012, 10:36:08 AM8/24/12
to golden-che...@googlegroups.com
I am cross-posting this http://bugs.goldencheetah.org/issues/685 since this list has more activity and I would like to know the opinions of the users, not just the developers, with respect to this feature. I've been playing around with a feature like this, here is the idea:

1) You set the altitude to known values, other than zero, for several points in the ride (minimum three), in the following example there are 5 point with altitude set to 6m (the 5 little green bars in the graph), corresponding approximately to the same point in a 1.5km circuit:

the segments between each point with non-zero altitude, 4 in this case, are used to estimate the CdA/Crr values which "best-fit" these segments using an energy balance equation, for better results is convenient to vary the velocity between the segments, here is the result using the previous example:

The button "Estimate CdA and Crr" does the calculation and updates the corresponding Aerolab values so the graph is updated, the process is almost instantaneous since it doesn't requiere iterative approximations. After modifying the Eoffset the result looks like this:

I would like if this feature could be useful, comments are welcomed.

Thanks, Ale.


ian spivack

unread,
Aug 24, 2012, 12:45:32 PM8/24/12
to golden-che...@googlegroups.com
I think that would be a very helpful feature. I am going to start to do some testing but have also gotten a bit hung up on finding a suitable course. The instructions are ok:
but it would be nice if they were more complete with a description of what i would want to find for a course and distance. I see it says to find at least 10m of elevation gain for 1 run, but i have read on other forums that the course should be around 1km long and you should do a few laps for about a total time of 15-20 min to get 1 data point of Crr and CdA. Also some examples of expected Crr and CdA would help to make sure you are in the right ballpark. Moving the sliders is not that big of a deal to me but having better instructions and maybe a few more examples would be much more helpful.
Thanks,
Ian

Ale Martinez

unread,
Aug 24, 2012, 1:53:05 PM8/24/12
to golden-che...@googlegroups.com
Ian, the Chung's paper linked in that page has several useful recommendations near the end.
WRT expected values, the range is large in both cases:
Crr: on good road surfaces you could see values as low as 0.004 or less with good tires and latex tubes to values on the order of 0.007 or higher with poor tires and butil tubes. If the surface is rough all values would be higher, if it is very smooth (think an indoor velodrome), lower. Pressure of inflation also plays an important, and non-obvious, role.
CdA: depending on position, body size and equipment it could be as high as 0.4 (big guy, hoods position on road bike) to around 0.2 for a smaller guy with a very optimized position in a full-aero equipped time trial bike.
Long time ago I've written a little piece but it is in spanish: http://www.amtriathlon.com/2011/04/cda-chung-aerolab.html.
Hope it helps, Ale.

Ale Martinez

unread,
Aug 24, 2012, 2:43:51 PM8/24/12
to golden-che...@googlegroups.com
I've just attached a patch with the code used to produce these screen-captures, the algorithm used is commented there, but a global description could be useful here for discussion, so here we go:

The basic idea is to start with a number of "segments" with the following information:
 - initial altitude and velocity
 - final altitude and velocity
 - power, velocity and headwind at intermediate points (if headwind is not present, zero is assumed).
this segments are defined by points where altitud is non-zero (zero altitude is considered as no data), in the limit case in which all points have altitude non-zero each recording interval would be considered a "segment", but I have not tested this case since I not have such file to do the test.

With this information and assuming no breaking, no change in position nor in the surface, air density, mass, etc. we can compute an energy balance equation for each segment:

 - Energy Loss = Energy Gain

where Energy loss is the sum of Aerodinamic and Rolling Resistance losses and Energy Gain is the sum of power supplied by the rider (minus transmission loss) times the duration of the interval plus Potential and Kinetic energy variation:

 Aero-Loss + Rolling-Loss = sum(Eta * Power * Duration) + DeltaPE + DeltaKE

using the standard approximation of a global CdA and Crr and knowing air density (Rho), total mass (Mass), we have (using Distance = v*dt):

 Aero-Loss = sum(0.5 * Rho * HeadWind**2 * Distance * CdA)
 Rolling-Loss = sum(Mass * g * Distance * Crr)

where the sum() is over all the recording intervals in the segment (a first order approximation to the integral). The other terms are as expected:

  DeltaPE = M * g * (initialAlt - finalAlt)
  DeltaKE = 0.5 * M * (initalVel**2 - finalVel**2)

So, if we have N segments, we have N equations of the form:

  X1 * CdA + X2 * Crr = Egain

where the unknowns are CdA and Crr, with two of them we could have an "exact" solution, but in general should be better to have more an look for the best-fit solution. In matrix form we have:

 X * [ CdA ; Crr ] = Egain

pre-multiplying with X transpose (X'):

 X' * X [ CdA ; Crr ] = X' * Egain

lets call A = X' * X and B = X' * Egain:

 A * [ CdA ; Crr ] = B

and we have a 2x2 system which is solved to have the best fit CdA and Crr.

If the solution pass some consistency checks, Aerolab values are updated so the change is visible in the graph. 

Caveat: the one-interval-per-segment with full altitude data has not been tested, perhaps this would need to be "smoothed" using more than one interval per segment, would be interesting to do some testing but I don't have the corresponding data.

Ale.

Robert Chung

unread,
Aug 25, 2012, 4:08:27 AM8/25/12
to golden-che...@googlegroups.com, Andy Froncioni


On Friday, August 24, 2012 4:36:08 PM UTC+2, Ale Martinez wrote:
 I've been playing around with a feature like this, here is the idea:


Ale:

I like this very much. It's actually quite close to how I use my own VE calculations when I do laps. Basically, my work flow goes like this:

1. I look at the data to zoom in on the "test" section (that is, I usually ride out to the test venue and then ride back home so I have to "snip" out the irrelevant parts).
2. I either know the "lap length" or, when someone sends me a file, I try a couple of trial values just so I can identify the laps.
3. Once I get the laps, I have a routine that "overlays" the laps so I can fit them "globally," after re-setting the start point for each lap at the same elevation.
4. If I happen to know the true elevation at certain points, I use them to check the solution.

At some early point in the development of Aerolab I thought we could add a "lap length" or "number of laps" slider and then the overlays would be drawn based on that. There's also a case where you do a straight out-and-back, so the elevations should be a mirror image. I had thought that it might be possible to reflect or mirror the VE around a specified point. Obviously, if you know the true elevation change at the start and turnaround, that would help in getting the (CdA,Crr) pairs sorted out.

So, I like what you've done *a lot* and I think it would be very helpful.

Ian: I'll try to add some guidelines to the Aerolab write-up.

Robert Chung

unread,
Aug 25, 2012, 5:07:22 AM8/25/12
to golden-che...@googlegroups.com


On Friday, August 24, 2012 8:43:51 PM UTC+2, Ale Martinez wrote:
The basic idea is to start with a number of "segments" with the following information:

BTW, this is the basis for my estimates of the precision of the estimates themselves: once one has the "lap length" then not only is there a segment from the start to the end of each lap, there's a segment that begins 1 second after the start and continues for a distance of "lap length"; and a segment that begins at 2 seconds and continues for a distance of "lap length"; and so on. Each of those segments has net elevation gain of zero and a range of elevation over the segment that is exactly the same as all other segments, so you really have a lot more than just 4 or 5 segments to use. Of course, there's a lot of serial correlation between the estimates but that's a standard time series kind of problem (and empirically the serially correlated estimates seem to be well-fit by an AR(1) process (we know this from looking at the autocorrelation and partial autocorrelation functions)), which we know how to handle. 

Robert Chung

unread,
Aug 25, 2012, 6:04:55 AM8/25/12
to golden-che...@googlegroups.com, Andy Froncioni


On Saturday, August 25, 2012 10:08:27 AM UTC+2, Robert Chung wrote:

So, I like what you've done *a lot* and I think it would be very helpful.

I should add that doing this automatically depends on getting the "lap length" just right. If you're off by a bit then the CdA and Crr will be biased -- but the automatic estimates will generally be close. Then with my own code I fiddle with the laps a bit so that the overlays line up properly, and this will generally improve the (CdA,Crr) estimates a bit more. So I still like the idea of sliders; the "automatic" calculations get me into a pretty small ballpark before I start having to use them but it's handy to have them for fine-tuning. 
Reply all
Reply to author
Forward
0 new messages