Bike Power

calculation of energy consumption under various bicycling conditions
(based on a C-program by Ken Roberts which I found here)

grade of hill = % headwind = km/h
weight: cyclist + machine = total 90 kg
rolling friction coeff = race:0.004...MB:0.012 BM rate = W/kg
air resistance coeff = (, ) racing crouch:0.167...standing:0.356
efficiency: transmission = % human = %
number of table entries: increment in table:
give start :

kph = velocity [kilometers per hour]
F_kg = total force resisting forward motion [kilograms]
P_a = power output to overcome air resistance [Watts]
P_r = power output to overcome rolling friction [Watts]
P_g = power output to climb grade [Watts]
P_t = power loss due to drivetrain inefficiency [Watts]
P = P_a + P_r + P_g = total power output [Watts]
hp = total power output [horsepower]
heat = C - (P + BM) = power wasted due to human inefficiency [Watts]
BM = basal metabolism [Watts]
C = total power consumption [Watts := Joules per second]
Cal/hr = total power consumption [dietary Calories per hour]
Cal/km = total power consumption [dietary Calories per kilometer]