Bicycle CdA and rolling resistance

optimistx

New member
Joined
Oct 17, 2014
Messages
5
I try in real time to estimate CdA (= the coefficient of air resistance times the reference area) and the coefficient of rollign resistance, when driving a bicycle straight ahead on an asphalt road in calm weather, and not pedalling.

There is an Arduino microprocessor connected to a magnetic pulse sensor (reed switch) in the front wheel of the bicycle, giving the time, when the front edge of the magnet passes the sensor. Once for each revolution of the wheel. The time resolution is in e.g. one microsecond or better.

In a test drive I have got an ascending series of time measurements in consequtive wheel revolutions, expressed in seconds, with the resolution of one microsecond, e.g.:

t0, t1, t2, t3 (time measurements 1)

The time intervals are differences of the above measurements.

The travelling distance sr during one wheel revolution is assumed to be known, in meters, with sufficient accuracy:

sr (distance measurement of one revolution 2)


Assume that the forces to be considered are described with the equation:

F = m * a = -(my +sin(alpha)) * m * g - CdA * rho * (v ^2) /2 (equation 1)

where

F = total force affecting the rider and the bicycle (in newtons)
m = total mass of the rider and the bicycle (in kilograms, eg. 100.0 kg)
a = acceleration (in meters per second ^2)
my = UNKNOWN coefficient of rolling resistance (dimensionless , e.g. 0.01)
alpha = the angle of the road, going up is positive (in radians)
g = acceleration of the gravity at the location (e.g. 9.81 m/s^2)
CdA = UNKNOWN coefficient (in square meters)
rho = density of the air (in kg/m^3, e.g. 1.23 kg/m^3)
v = velocity of the bicycle (in m/s)

Divide the equation (1) by m and for simplicity's sake introduce UNKNOWN variables A and B:

A = -(my + sin(alpha)) * g (equation 2)

The unit of A is m/s^2

B = -CdA * rho / (2 * m) (equation 3)


The unit of B is 1/meter


a = A + B * v^2 (equation 4)


dv/dt = A + B * v^2

dt = (1/ ( A + B * v^2)) dv (equation 5)

Let us consider only the case where A and B are both strictly negative, the bicycle is decelerating on a level or uphill road. The equation 5 can be integrated symbolically.

So we get time t as a function of v, A and B, and integration constant Ct :

t = (-1/sqrt(A*B)) * atan(sqrt(B/A) * v) + Ct (equation 6)

Set v = v0 at time t = 0 and solve Ct:

Ct = (1/sqrt(A*B)) * atan(sqrt(B/A) * v0) (equation 7)

Ct gives the time in seconds to a complete stop from the initial speed of v0. Ct >=0.

From the above equations 6 and 7 we calculate velocity v as a function of time t and parameters A and B:

v = sqrt(A/B) * tan(sqrt(A*B) *( Ct - t)) (equation 8)

Assume s is the distance travelled (not speed!). Then

ds/dt = v

Integrating both sides we get:

s + Cs = (1/B) * ln(cos (sqrt(A*B)* (Ct - t))) (equation 9)

Set s= 0 at t=0 above to calculatae Cs:

Cs = (1/B) * ln(cos (sqrt(A*B) * Ct )) (equation 10)

Cs is the distance in meters travelled from the initial speed of v0 to the complete stop. Cs >= 0, because B <0.

From the above we can get the formulas for all 12 the functions between time t, distance s, velocity v, acceleration a. The formulas have A and B as unknown parameters. They contain also the initial speed v0.

Now finally my question:

How to calculate accurately A and B, when few (3 or 4) time and distance measurement pairs (t0, 0*sr), (t1,1*sr),(t2, 2*sr), ... are known?


When I substitute each of the measurement pairs to the equations 9 and 10 in turn, the nonlinear equation group with unknown variables A and B seems too difficult for me to solve symbolically. Or can you give a hint how to solve it?

Newton's gradient method ("the steepest ascent") is an option to solve the problem numerically, but that might be an awkward method and overkill, if there is a more elegant method. Is there? If yes, where to find it?

---

I have compared this to a simpler problem:

acceleration = dv/dt = A = constant (equation 11)

(compare that with equation 4, if assuming B = 0)

which leads to:

a * t^2 /2 + v0 * t + s0 = s (equation 12)

One can substitute 3 time and distance measurement pairs to equation 12 and solve the resulting linear equations with Gauss method accurately to get acceleration a and velocity v at the measured points in time t0, t1, t2.

Input data (t0, 0*sr), (t1, 1*sr), (t2, 2*sr) were generated programmatically with microsecond and micrometer precision using the equation 12. Then parameter A was
solved with Gauss method. The numerical results were satisfactory.

---

When I approximate momentaneous speed and acceleration at t0, t1, t2 using the average speed and acceleration during time intervals [t0, t1], [t1, t2] or [t0, t2] I get too much error in A and B. Therefore, I am searching a symbolical or otherwise accurate method to calculate A and B.

If a method to calculate parameters A and B from a short sample set of time values is found, the method is applied to new sample sets in the microprocessor to continuously filter and update those parameters during bicycle riding and show them on the display.

I hava a feeling that there might be a simple and elegant approach to solve this common problem, but in spite of ample searching I could not find such.

If more information is needed I am happy to try to provide it promptly. Thanks in advance.
 
Last edited:
Would
https://www.physicsforums.com/threads/determination-of-airdrag-coefficient.598448/
be of any use.

Is there a possibility that you could fairly well predict stop time (Ct) and distance (Cs) from your measurements?

Edit: Or possibly
http://racechair.ae.illinois.edu/Coastdown.html
might be of help.

Thanks for your kind answer.

I assume you have (in my opinion valuable) idea to calculate unknown coefficients A and B from the equations (7) and (10) in my previous post.

Ct and Cs can be predicted fairly well, if the inclination of the road or floor, and the coefficient of the rolling resistance are strictly constant during the rolling (in completely calm air). But unfortunately it is nearly impossible to find such a location here (in Helsinki Finland) with a long enough stretch, even inside big buildings. The people in the second link of yours admitted after all that they did not succeed in determining the CdA well, although they had an exceptional opportunity to use a long building (no wind, almost level surface, +-0.1 % inclination variations).

Therefore, I still try to search a method where we utilize only a stretch of 3...5 revolutions of the wheel to calculate A and B.

Edit:

The Bosch link is interesting. . At first glance it seems to (implicitely) use the same formulas as above. Two passes, one in high speed and one in low speed, give the possibility for more accuracy, and may become necessary here too. Although I'll try to utilize one pass only, if at all possible. Using averages instead of momentaneous values has caused problems with the accuracy for me, but I'll check that once more.
 
Last edited:
Just some random thoughts:
If we let A B = D, then B = D / A
and distance, Ct and Cs equations can be written as
s = (A/D) ln( cos( D1/2 (Ct-t) ) ) - Cs
Ct = (1/D1/2) atan( D1/2 v0 )
Cs = (A/D) ln( cos( D1/2 Ct) )
and for convenience define
e(t) = ln( ( cos( D (Ct - t) ) )
f(t) = s(t) + Cs
Now rewrite the distance equation as
A e(t) - D f(t) = 0
or, if we consider e(t) and f(t) independent of A and D, we can do the standard error analysis and arrive at A and D, i.e.
E = \(\displaystyle \Sigma\space (A\space e_j\space - D f_j)^2 \)

Now take the partial derivative wrt to A and D, set them to zero and get a system of two equations in A and D.

So then the scheme would be 'guess at' an Aold and Dold, compute Ct, Cs, ej=e(tj), and fj=f(tj) using those two values [note that s(tj) = sj is part of your actual data]. With those data points, which are independent of the Anew and Dnew, use the error equation to compute an Anew and Dnew.

Sometimes it helps to use a 'relaxation coefficient', that is compute what the Anew would be, then form \(\displaystyle \Delta_A\) = Anew - Aold and make the actual Anew = Aold + rA * \(\displaystyle \Delta_A\). Similarly for Dnew. Typically r is positive and less than one, but it doesn't have to be.

How to get the first A and D? Maybe using the old values from the previous data set if you are doing this on a moderately regular basis. Yes, but what about the very very first A and D? Well maybe the negligible air resistance solution for A and a moderate cross sectional area and wind speed for B to compute the D = A*B

This may be worse than or better than a method of steepest decent or whatever but if one could play with it, possibly it might work out.
 
Last edited:
Thank you for your "random thoughts". I'll study and test them a little later.
--

The method quoted earlier from a Handbook of Bosch might originate from lecture notes in pdf-format here:
Vehicle Design, Hathaway.pdf
The notes have some more thorough information of the background.

I generated programmatically data for the equation

acceleration = A + B * velocity^2

in 23 points in time, momentaneous values. They correspond a distance of 5 revolutions of the 20 " diameter wheel between values. The parameter A = -0.1000000 m/s^2 and B = -0.0020000 /m

Then the average values of velocity, velocity^2 and acceleration were reconstructed from the time intervals in a spreadsheed program.
The results are shown in the image.

It is seen that the reconstructed values differ significantly, some percent, from the original values used for the generation.

Generated values at each point in time (not interval) in columns A-FCalculated average values in time intervals
#A[m/s^2]=-0,10000000B[1/m]=-0,00200000
#v0[m/s]=7,00#distance[m]=7,30000000
#tol=0,00010000
pulses[m]t

[TD]dt[us][/TD]
[TD]v[m/s][/TD]
[TD]a[m/s^2][/TD]
[TD][/TD]
[TD]aver v[/TD]
[TD]aver v*v[/TD]
[TD]aver acc[/TD]

[TR]
[TD]1[/TD]
[TD]7,3[/TD]
[TD]1,05855035[/TD]
[TD]1058550[/TD]
[TD]6,79345257[/TD]
[TD]-0,19230200[/TD]
[TD][/TD]
[TD]0,00000000[/TD]
[TD]0,00000000[/TD]
[TD]0,000000[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]14,6[/TD]
[TD]2,14980478[/TD]
[TD]1091254[/TD]
[TD]6,58665194[/TD]
[TD]-0,18676797[/TD]
[TD][/TD]
[TD]6,68954904[/TD]
[TD]44,75006635[/TD]
[TD]0,000000[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]21,9[/TD]
[TD]3,27591077[/TD]
[TD]1126105[/TD]
[TD]6,37938854[/TD]
[TD]-0,18139320[/TD]
[TD][/TD]
[TD]6,48251590[/TD]
[TD]42,02301237[/TD]
[TD]-0,186738[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]29,2[/TD]
[TD]4,43927531[/TD]
[TD]1163364[/TD]
[TD]6,17143012[/TD]
[TD]-0,17617310[/TD]
[TD][/TD]
[TD]6,27490330[/TD]
[TD]39,37441137[/TD]
[TD]-0,181363[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]36,5[/TD]
[TD]5,64261195[/TD]
[TD]1203336[/TD]
[TD]5,96251731[/TD]
[TD]-0,17110323[/TD]
[TD][/TD]
[TD]6,06646535[/TD]
[TD]36,80200190[/TD]
[TD]-0,176142[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]43,8[/TD]
[TD]6,88899947[/TD]
[TD]1246387[/TD]
[TD]5,75235825[/TD]
[TD]-0,16617925[/TD]
[TD][/TD]
[TD]5,85692639[/TD]
[TD]34,30358674[/TD]
[TD]-0,171071[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]51,1[/TD]
[TD]8,18195602[/TD]
[TD]1292956[/TD]
[TD]5,54062171[/TD]
[TD]-0,16139698[/TD]
[TD][/TD]
[TD]5,64597475[/TD]
[TD]31,87703090[/TD]
[TD]-0,166147[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]58,4[/TD]
[TD]9,52553368[/TD]
[TD]1343577[/TD]
[TD]5,32692819[/TD]
[TD]-0,15675233[/TD]
[TD][/TD]
[TD]5,43325496[/TD]
[TD]29,52025946[/TD]
[TD]-0,161363[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]65,7[/TD]
[TD]10,92444128[/TD]
[TD]1398907[/TD]
[TD]5,11083853[/TD]
[TD]-0,15224134[/TD]
[TD][/TD]
[TD]5,21835754[/TD]
[TD]27,23125540[/TD]
[TD]-0,156717[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]73[/TD]
[TD]12,38420606[/TD]
[TD]1459764[/TD]
[TD]4,89183862[/TD]
[TD]-0,14786017[/TD]
[TD][/TD]
[TD]5,00080567[/TD]
[TD]25,00805733[/TD]
[TD]-0,152205[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]80,3[/TD]
[TD]13,91139078[/TD]
[TD]1527184[/TD]
[TD]4,66931900[/TD]
[TD]-0,14360508[/TD]
[TD][/TD]
[TD]4,78003734[/TD]
[TD]22,84875696[/TD]
[TD]-0,147822[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]87,6[/TD]
[TD]15,51389120[/TD]
[TD]1602500[/TD]
[TD]4,44254666[/TD]
[TD]-0,13947244[/TD]
[TD][/TD]
[TD]4,55538101[/TD]
[TD]20,75149615[/TD]
[TD]-0,143565[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]94,9[/TD]
[TD]17,20135386[/TD]
[TD]1687462[/TD]
[TD]4,21062535[/TD]
[TD]-0,13545873[/TD]
[TD][/TD]
[TD]4,32602166[/TD]
[TD]18,71446337[/TD]
[TD]-0,139430[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]102,2[/TD]
[TD]18,98577955[/TD]
[TD]1784425[/TD]
[TD]3,97243801[/TD]
[TD]-0,13156053[/TD]
[TD][/TD]
[TD]4,09095208[/TD]
[TD]16,73588894[/TD]
[TD]-0,135413[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]109,5[/TD]
[TD]20,88242491[/TD]
[TD]1896645[/TD]
[TD]3,72656041[/TD]
[TD]-0,12777451[/TD]
[TD][/TD]
[TD]3,84890090[/TD]
[TD]14,81403812[/TD]
[TD]-0,131511[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]116,8[/TD]
[TD]22,91120479[/TD]
[TD]2028779[/TD]
[TD]3,47112633[/TD]
[TD]-0,12409744[/TD]
[TD][/TD]
[TD]3,59822180[/TD]
[TD]12,94720012[/TD]
[TD]-0,127721[/TD]
[/TR]
[TR]
[TD]17[/TD]
[TD]124,1[/TD]
[TD]25,09898512[/TD]
[TD]2187780[/TD]
[TD]3,20360616[/TD]
[TD]-0,12052618[/TD]
[TD][/TD]
[TD]3,33671526[/TD]
[TD]11,13366872[/TD]
[TD]-0,124038[/TD]
[/TR]
[TR]
[TD]18[/TD]
[TD]131,4[/TD]
[TD]27,48357427[/TD]
[TD]2384589[/TD]
[TD]2,92042004[/TD]
[TD]-0,11705771[/TD]
[TD][/TD]
[TD]3,06132399[/TD]
[TD]9,37170458[/TD]
[TD]-0,120459[/TD]
[/TR]
[TR]
[TD]19[/TD]
[TD]138,7[/TD]
[TD]30,12126578[/TD]
[TD]2637691[/TD]
[TD]2,61620367[/TD]
[TD]-0,11368904[/TD]
[TD][/TD]
[TD]2,76757157[/TD]
[TD]7,65945237[/TD]
[TD]-0,116980[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]146[/TD]
[TD]33,10278798[/TD]
[TD]2981522[/TD]
[TD]2,28224919[/TD]
[TD]-0,11041732[/TD]
[TD][/TD]
[TD]2,44841377[/TD]
[TD]5,99472997[/TD]
[TD]-0,113595[/TD]
[/TR]
[TR]
[TD]21[/TD]
[TD]153,3[/TD]
[TD]36,59310675[/TD]
[TD]3490318[/TD]
[TD]1,90259759[/TD]
[TD]-0,10723976[/TD]
[TD][/TD]
[TD]2,09149951[/TD]
[TD]4,37437019[/TD]
[TD]-0,110298[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]160,6[/TD]
[TD]40,96244446[/TD]
[TD]4369337[/TD]
[TD]1,44111607[/TD]
[TD]-0,10415363[/TD]
[TD][/TD]
[TD]1,67073376[/TD]
[TD]2,79135129[/TD]
[TD]-0,107070[/TD]
[/TR]
[TR]
[TD]23[/TD]
[TD]167,9[/TD]
[TD]47,60433275[/TD]
[TD]6641888[/TD]
[TD]0,76036792[/TD]
[TD]-0,10115632[/TD]
[TD][/TD]
[TD]1,09908503[/TD]
[TD]1,20798790[/TD]
[TD]-0,103830[/TD]
[/TR]



A larger image, if you click this link:
https://lh6.googleusercontent.com/-...W0/w1ny71BxY-4/s838/simulation_of_rolling.png

The basic problem can be reformulated like this: how to calculate accurate "point values" for the acceleration and velocity from the measurements?
 

Attachments

  • simulation_of_rolling.jpg
    simulation_of_rolling.jpg
    12.6 KB · Views: 3
Last edited:
If you do try any of the random thoughts above, make sure you check the equations. For example, the equation for Ct is wrong and should be
Ct = (1/D1/2) atan( - D1/2 v0 / A)

In addition, in going over your equations I believe you may have some signs wrong, i.e. shouldn't speed be
s = -(1/B) * ln(cos (sqrt(A*B)* (Ct - t))) + Cs
 
Last edited:
...

In addition, in going over your equations I believe you may have some signs wrong, i.e. shouldn't speed be
s = -(1/B) * ln(cos (sqrt(A*B)* (Ct - t))) + Cs
I am very happy that you checked the equations so thoroughly! The sign was obviously wrong at least there, perhaps elsewhere are similar errors.

---
In the spreadsheet in my previous post there is also an error: the acceleration values in the rightmost column should actually be "inbetween the rows", half a row above their actual position. Then they correspond better the speedsquared values. The correction can be made by changing the formula for the acceleration on row n to utilize speeds on rows n-1 and n+1 (instead of rows n-1 and n). Then the regression equation

acceleration = -B * v^2 - A

becomes

f(x) = -0.00200497*x - 0.09980458

The exact result should be

f(x) = -0.00200000*x - 0.10000000

The error of B is about 0.25 percent still. Could that be made 0.00 percent?

B is the slope of the red regression line in the image. "Bosch method" calculates the slope using 2 points of the line, one in high speed v and one in low speed. If we determine the slope of the line using 2 points very near each other, the error of B might become huge, when there is noise in the observations. Noise can added to the generated simulation data to test the needed accuracy. I hope that somehow the measured (and filtered) observations could have noise of only few microseconds. To achieve acceptable total errors the calculation errors should also be as small as possible. Acceptable? Perhaps +-1 % of B.

The calculation of the spreadsheet data from generated "point values" (insted of intervals) gives the equation f(x)= -0.00200000*x - 0.10000000 correct to at least 8 decimals, without noise.

---

Edit:
Very strange that now my messages are not accepted immediately as before. When posting, I get a message that the contents should be checked by a moderator first. It has taken several days now since posting. Have I done something against the rules? Too long postings? Something foolish?


It seems to be possible to edit this post.
Several days ago I wrote a somewhat lengthy post to explain to Ishuda and other readers how this problem has been solved in a simple way. But I did not save that to may computer. Therefore, I would still wait that post to appear here some day.
 
Last edited:
There seems to be a good simple method to solve this. We can fit a polynomial of degree N to observations [(t0, s0), (t1, s1), (t2,s2)...]. Derivative of the polynomial gives good point estimates of the speed . Second derivative of the polynomial is the acceleration.
Tests with N = 5 or N=10 worked surprisingly well with generated data with significant noise (e.g errors of more than 1 ms in the time values).
A python program with numpy.polyfit() was used to test:
numpy.polyfit — NumPy v1.8 Manual
A basic text of the methods is e.g. here:
ecl6.pdf

(page 6)

My tests are very preliminary yet, and I'll report here if any unexpected problems arise.
 
Top