Custom Data Tracks

by old_man_biking

Downloads: 1,805 (5) • Reviews: 0

Version:

3.0.5980

Updated:

May 15, 2016

Custom Data Tracks plugin: Formulas pool

Custom Data Tracks plugin: Formulas pool

Postby old_man_biking » Mon Oct 06, 2014 3:12 am

The last version of Custom Data Tracks plugin has introduced a new feature: calculated tracks
This allows you to add your own tracks to SportTracks by giving a formula how to calculate the track points.
For some more details see here: http://sporttracks-plugins.com/SportTra ... n/new.html

Did you already create track formulae that might be of interest for others?
Please post them in this thread. Please give a brief description what this track is for and give the formula.

Cheers,
OMB
old_man_biking
Donated!
Donated!
 
Posts: 6513
Joined: Mon May 28, 2007 8:07 am
Location: Munich, Germany

Re: Custom Data Tracks plugin: Formulas pool

Postby rogerpgvg » Mon Oct 06, 2014 5:41 pm

Running pace is strongly affected by uphill and downhill gradients. It is often useful to take into account or “correct” for gradient, for example, when determining whether you gradually slowed down on a hilly course, to estimate what your time would have been if the course had been flat or when calculating running efficiency. There are several ways of correcting for gradient, but as far as I know, the most detailed analysis of how running pace is affected by grade was done by Kay (2012) http://www.lboro.ac.uk/microsites/maths ... /11-38.pdf, who analysed the pace of elite hill runners on a variety of up- and downhill courses. This analysis resulted in an equation that predicts pace from gradient. Using the new “calculated tracks” functionality in the Custom Data Tracks plugin, I have created several tracks that use Kay’s formula. Hopefully some are useful for other runners too. I realise the formulas below look rather complex, but they can just be copied and pasted into Custom Data Tracks.

To calculate a “grade-corrected pace”, I use the following formula derived from Kay (2012):

1/(1707*1/{DataPoint.SmoothedSpeed}/(5656*{DataPoint.SmoothedGrade}/100+32209*Math.Pow({DataPoint.SmoothedGrade}/100, 2)-3211*Math.Pow({DataPoint.SmoothedGrade}/100, 3)-43635*Math.Pow({DataPoint.SmoothedGrade}/100, 4)+1707)) > 7.5 ?
7.5 :
1/(1707*1/{DataPoint.SmoothedSpeed}/(5656*{DataPoint.SmoothedGrade}/100+32209*Math.Pow({DataPoint.SmoothedGrade}/100, 2)-3211*Math.Pow({DataPoint.SmoothedGrade}/100, 3)-43635*Math.Pow({DataPoint.SmoothedGrade}/100, 4)+1707)) < 0 ?
0 :
1/(1707*1/{DataPoint.SmoothedSpeed}/(5656*{DataPoint.SmoothedGrade}/100+32209*Math.Pow({DataPoint.SmoothedGrade}/100, 2)-3211*Math.Pow({DataPoint.SmoothedGrade}/100, 3)-43635*Math.Pow({DataPoint.SmoothedGrade}/100, 4)+1707))


Settings: Type: Speed/Pace, Smoothing: 19s

I use a smoothing of 19 s because I have the same smoothing for my ST Speed/Pace. Kay’s (2012) formula is based on hill races by elite runners, but I find that it also does quite a good job of correcting for grade if you are not an elite runner. (It assumes that as a non-elite runner, you are, let’s say, twice as slow as an elite, regardless of the gradient.) The grade-corrected pace removes variability in pace due to up and downhills, which can be useful, for example, to check whether you slowed down over the course of a run, taking into account that you’d be slower on up than downhills.

We can also calculate a “grade difficulty index”:

{DataPoint.SmoothedGrade} > 62.5 ?
(0.1707+0.5656*62.5/100+3.2209*Math.Pow(62.5/100,2)-0.3211* Math.Pow(62.5/100,3)-4.3635*Math.Pow(62.5/100, 4))/0.1707/({Activity.AverageSpeed}/{DataPoint.SmoothedSpeed}) :
{DataPoint.SmoothedGrade} < -62.5 ?
(0.1707+0.5656*-62.5/100+3.2209*Math.Pow(-62.5/100,2)-0.3211* Math.Pow(-62.5/100,3)-4.3635*Math.Pow(-62.5/100, 4))/0.1707/({Activity.AverageSpeed}/{DataPoint.SmoothedSpeed}) :
(0.1707+0.5656*{DataPoint.SmoothedGrade}/100+3.2209*Math.Pow({DataPoint.SmoothedGrade}/100,2)-0.3211* Math.Pow({DataPoint.SmoothedGrade}/100,3)-4.3635*Math.Pow({DataPoint.SmoothedGrade}/100, 4))/0.1707/({Activity.AverageSpeed}/{DataPoint.SmoothedSpeed})


Settings: Type: Custom, Smoothing: 0s

The graph for the grade difficulty index is not of any interest, but the “grade difficulty index Avg” data field that you can get under Settings, Custom Data Tracks Plugin, Custom Activity Detail pages, Data Fields is. Essentially, it tells you how hard the hills in the course were, overall. If the grade difficulty index value is 1, then the course is perfectly flat (or the difficulty of the uphills is cancelled out by the easiness of the downhills). The higher the grade difficulty value, the harder the course. For downhill courses that are not too steep, you get a value lower than 1. To make sure that Custom Data Tracks uses a sufficient number of decimal places in subsequent calculations using the grade difficulty index, I’d set the number of decimal places to at least 3 under Logbook, Properties, Custom Data Fields. Also, because subsequent formulas use the grade difficulty index, you first need to get the grade difficulty index for an activity before you can calculate the subsequent tracks. In the Activity Reports or Daily Activity view, do edit, Custom Data Tracks, Force Recalculation of Calculated Tracks.

We can also calculate a “grade-corrected distance”. This gives you an estimate of how far you would have run in the same time if the course had been completely flat, so it is a useful way of comparing the difficulty of longer flat courses with shorter hillier courses.

{Activity.CDF["Grade difficulty index Avg."]}*{Activity.Distance}/1000

Settings: Type: Custom, Smoothing: 0s

Replace 1000 in the formula by 1609 if you want the distance in miles rather than km. Again, the graph isn’t interesting, but you can get an average value under Settings, Custom Data Tracks Plugin, Custom Activity Detail pages, Data Fields.

And if you are interested to know what your estimated time would have been if the course had been flat, then you can calculate that too:

Math.Round(({Activity.Time}/{Activity.CDF["Grade difficulty index Avg. [Difficulty relative to 0 grade]"]})/60-0.4999999)+(({Activity.Time}/{Activity.CDF["Grade difficulty index Avg. [Difficulty relative to 0 grade]"]})%60)/100

Type: Custom, Unit: min.sec, Smoothing: 0s

Set the number of decimal places under Logbook, Properties, Custom Data Fields to 2. The time will then be in minutes and seconds, so 72.50 means 72 minutes and 50 seconds.

Finally, we can calculate a measure of efficiency: How far do we run per heart beat? Obviously, distance/heart beat would be affected by whether we run up or downhill, which is probably not what we want. We therefore calculate a “grade-corrected efficiency” using grade-corrected pace:

1/(1707*1/{DataPoint.SmoothedSpeed}/(5656*{DataPoint.SmoothedGrade}/100+32209*Math.Pow({DataPoint.SmoothedGrade}/100, 2)-3211*Math.Pow({DataPoint.SmoothedGrade}/100, 3)-43635*Math.Pow({DataPoint.SmoothedGrade}/100, 4)+1707)) > 7.5 ?
7.5*60/{DataPoint.HeartRate} :
1/(1707*1/{DataPoint.SmoothedSpeed}/(5656*{DataPoint.SmoothedGrade}/100+32209*Math.Pow({DataPoint.SmoothedGrade}/100, 2)-3211*Math.Pow({DataPoint.SmoothedGrade}/100, 3)-43635*Math.Pow({DataPoint.SmoothedGrade}/100, 4)+1707)) < 0 ?
0 :
1/(1707*1/{DataPoint.SmoothedSpeed}/(5656*{DataPoint.SmoothedGrade}/100+32209*Math.Pow({DataPoint.SmoothedGrade}/100, 2)-3211*Math.Pow({DataPoint.SmoothedGrade}/100, 3)-43635*Math.Pow({DataPoint.SmoothedGrade}/100, 4)+1707))*60/{DataPoint.HeartRate}


Settings: Type: Custom, Unit: m/heart beat, Smoothing: 19s


You should expect to see that your efficiency goes down when you get more tired, for example, at the end of a long run. It may also be useful to compare grade-corrected efficiency between races to get an impression of your fitness (but remember that efficiency is generally higher for short than long courses).

I have attached a document in which I describe in more detail how I derived the formulas and how to calculate some additional tracks. My maths is a bit rusty, so worth checking whether I haven’t made any errors.
Attachments
GradeCorrectedPace.zip
(48.98 KiB) Downloaded 289 times
rogerpgvg
 
Posts: 100
Joined: Mon May 27, 2013 12:14 pm

Re: Custom Data Tracks plugin: Formulas pool

Postby rogerpgvg » Thu Oct 16, 2014 11:50 am

If you have both the Custom Data Tracks and Training Analysis plugins, you can get correlations with distance to see whether, over the course of an activity, there was a systematic increase or decrease of speed, heart rate, cadence, efficiency, etc.

First, I create a calculated track which I call “Distance”: {DataPoint.Distance}/1000 (unsmoothened). The graph is very uninteresting, but using the Training Analysis plugin, you can now get correlations with distance: Go to Training Analysis in the drop-down menu in Daily Activity or Activity Reports, click on the “correlations" tab, in the drop-down menu for the correlation graph select x-axis = Distance, y-axis = whichever track you’d like to get a correlation for. For example, it shows that the marathon below was very badly paced:
distancepacecorr.PNG
distancepacecorr.PNG (44.96 KiB) Viewed 6471 times

Very nice how the two plugins work together.
rogerpgvg
 
Posts: 100
Joined: Mon May 27, 2013 12:14 pm

Re: Custom Data Tracks plugin: Formulas pool

Postby tndmbkr » Sun Jan 25, 2015 7:39 am

TRIMP is a method of quantifying an activity in its entirity.
It is calculated as the product of the Training Volume and the Training Intensity
A limitation of this method of calculation is that it does not differentiate between the intensity levels of training.
For that reason it is a pity that ST does not calculate a TRIMP for every split.

From where I live it is half an hour ride to my training ground.
And my TRIMP is very often a mixture of low intensity volume activities and high intensity activities.
I want to know how much TRIMP can be assigned to the phases with low or high intensity training.

Of course I can split my activity in a low and a high intensity phase.
But CDT can be of help too.

I created a Custom Calculated track which I call TRIMPps:
(DataPointHR-AthleteHistoryRestingHR)/(AthleteHistoryMaximumHR-AthleteHistoryRestingHR)*0.64*
Math Pow(2.718281828459,(DataPointHR-AthleteHistoryRestingHR)/(AthleteHistoryMaximumHR-AthleteHistoryRestingHR)*1.92)


In the chart of this custom datatrack I select a low/high intensity phase,
and I multiply this average TRIMPps value by the duration of my selection (in minutes),
on a desktop calculator.
Next I can compare this value by the TRIMP for the activity at large, as calculated by TA.

Together with the formula provided by rogerpgvg, I get a nice insight in the structure of my TRIMP for the entire activity.
Last edited by tndmbkr on Fri Mar 06, 2015 4:41 am, edited 1 time in total.
tndmbkr
 
Posts: 233
Joined: Wed Jan 11, 2012 2:39 am
Location: Rotterdam

Re: Custom Data Tracks plugin: Formulas pool

Postby tndmbkr » Fri Mar 06, 2015 4:39 am

ST can provide us with data how much time we have spend in each HRzone for the entire activity
ST can also provide us with the average HR for every split
But we need CDTplugin to figure out how much time we have spend in each HRzone per split.

I think this is valuable information supplementary to this STchart
Image

{DataPoint.HeartRate}>120 && {DataPoint.HeartRate}<135 ?
1 :
0


When you select a split, the CDTchart will tell you immediatetely, how much percent of the time you have spend in that particular HRzone.

You will have to make a CDTformula for every HRzone.
tndmbkr
 
Posts: 233
Joined: Wed Jan 11, 2012 2:39 am
Location: Rotterdam


Return to Custom Data Tracks

Who is online

Users browsing this forum: No registered users and 0 guests

cron