I am thinking about developing a pace effectivity metric for mountain/hill time trials.GC has an efficiency index that is average speed by average power but I am not sure about the exact formula. I don't think that it captures what I have in mind.
What I would like the metric to account for is:- Physiological cost of effort is measured in TSS (perhaps altitude adjusted)
- Gain is measured by the speed (km/h).- The relationship between speed and power depends on the slope.- The effectivity is calculated given a fixed amount of stress spent for the interval.Does anybody know whether I am just reinventing the wheel? Has this been done before?If not, here are some further thoughts I have on this.
Take a look at Run Efficiency Combined Hill and Wind Effect
{
relevant { isRun && Data contains "P" && Data contains "L" && Data contains "S" && XDATA("DEVELOPER", "AIR*POWER", sparse); }
# value { (((((Average_Speed/3.6)/(Average_Power/Athlete_Weight))/((16.667/xPace)/(Average_Power/Athlete_Weight)))-1) + (((Average_Speed /3.6)/(Average_Power /Athlete_Weight)) / ((Average_Speed/3.6)/((Average_Power - mean(xdata("DEVELOPER", "Air Power")))/Athlete_Weight))-1))*100;}
value { (((((Average_Speed/3.6)/( Average_Power/Athlete_Weight ))/(mean(xdata("EXTRA", "GAP"))/(Average_Power/Athlete_Weight )))-1) + ((((Average_Speed /3.6)/(Average_Power/Athlete_Weight ) )
/ ((Average_Speed/3.6)/( (Average_Power - mean(xdata("DEVELOPER", "Air Power")))/Athlete_Weight)))-1))*100;}
mean(smooth(samples(POWER), sma, backward, 30)^4)^(1/4)
but, since run "power" tends to be heavily filtered by the "measuring" devices, the smoothing part is likely unnecessary.
Thank you for your ideas. To answer Ale's question, I think I am looking for pretty much the metric that Pepe suggested but for cycling.I now crunched the calculus a bit and came up with the following metric:1/mu = (c1(t) + c2 V(t)^2) 2 P(t)^3/NPwhere- V(t) is the speed at time t (perhaps smoothed)- P(t) is the power at time t (perhaps smoothed)- NP is the normalized power over the entire interval/activity and can be replaced by xPower or even omitted- c1(t) = m g (sin(theta(t)) + Cr rho)- c2 = 3/2 rho CdA- m is the mass of rider + bicycle- g is the gravitational constant- theta(t) is the slope at time t- rho is the air density- CdA is the drag coefficient times frontal areaExplanation: To obtain the formula, I maximized the average steady state speed of a cyclist given a constraint on TSS (calculated as (integral P(t)^4dt )^2/FTP).I accounted for rolling resistance, air resistance, and slope. The solution to the optimization problem yields a relation between current speed and power that should be constant over time.mu is the Lagrange multiplier (shadow price of TSS) of the optimization problem. Since the implied mu becomes infinite at zero power, it is better to use 1/mu as the metric.1/mu has units stress/speed (TSS/(km/h)) since the Lagrange multiplier converts the stress constraint into speed.Comparative statics: If you want to hold 1/mu constant, as your speed increases you want to reduce power. If the slope increases, you should decrease speed. I haven't checked whether you should also increase power (which would make sense).
I have more or less managed to create a script that creates the xdata time series. It works for some activities but crashes GC for other activities. Probably I need to include some further checks on data length and availability, etc..
Any comments are very welcome! I am also thinking about adding some smoothing after fixing the bugs. Just what smoothing would work well here? The steeper the hill, the lower the effect of past power/speed on current speed, suggesting slope-dependent smoothing of speed -- that would be a mess.
Ale and Pepe, thank you for all the hints! Sorry for not being clear about the cycling vs running metric.I revised the formula a bit (minimization of time given fixed course and optimizing over the segment speeds with a fixed gradient).Here the new formula:1/mu = Power(t)^3 * (4(c1 Speed(t) + 3 c2 Speed(t)^3)-Power(t)) / (72*NP^2*FTP)where c1 = Total Weight * Grav. Acc. * (Cr + sin(atan(slope))) and c2 = 1/2 rho CdAThe pacing strategy can be obtained by calculating 1/mu for the average gradient (let's say 10%) and target Power=NP (let's say 280W). This gives the target 1/mu to hold for all gradients.It works fairly well at first sight, for example at a system weight of 78kg in an all-out time trial at 280W for one hour with an average gradient of 10% it roughly suggests the following pacing strategy: 16%: 296W, 10%: 280W, 5%: 240W, 0%: 162WThere are still some theoretical issues. I am not sure whether TSS is really the right constraint of effort to use. Clearly over a short course W'bal is the right constraint. I am also unsure about how meaningful TSS are over long efforts as a constraint.
Any comments are very welcome!
I figured out that using RiegelPower (or any other constraint on NP) yields the same time series as mu above up to a factor of NP/FTP. That's reassuring if RiegelPower is something people have used in the past.
The next goal is indeed to plot it as a user chart to get a feel for what the model says about some paced activities. Then I will build a Connect IQ data field to try using it in real time.
I still cannot figure out why the code does not work sometimes (even on activities it did work on before). I am using the python that is embedded in GC and have all the checks on data availability added. Still, sometimes GC crashes when running the code. I read the "working with python" special topics manual and don't see its recommendations conflicting with the code.