xGAP and xPower

Thank you for the feedback, I now understand the sticking point of this other thread you’ve been commenting on and understand that the step of averaging needs to happen before taking the area under the curve and that this is the main criticism of Coggan’s NP → TSS calculation. Essentially, even though you can see NP as a stream/graph, this information is useless as the calculated average NP for the whole activity isn’t the average line across this stream, so there was no point in making these custom streams.

Instead, I’ve made a few different load calculations in addition to Piotrek’s suggested formula in the previous thread

xLoad or xTSS (average xpower expressed as a load)

  • simply instead of normalising over 30 sec, it is over 25

{
watts = streams. Get(“fixed_watts”).data
w25 = icu.stats.calcMovingAvg(watts, 25)
tss = 0
for (let i = 0; i < w25.length; i++) {
w = (w25[i]/icu.sportSettings.ftp)**2;
tss += w
}
tss = tss/36
//activity.icu_training_load = tss
}

I’ve also tried with Skiba’s GOVSS, below, but it didn’t give very many meaningful deviations in data compared with the TSS calculation above (Note this assumes an accurate FTP and does not actually do Skiba’s first step according to his PDF)

{
watts = streams. Get(“fixed_watts”).data
w120 = icu.stats.calcMovingAvg(watts, 120)
tss = 0
for (let i = 0; i < w120.length; i++) {
w = (w120[i]/icu.sportSettings.ftp)**2;
tss += w
}
data = tss/36
}