Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Commit e001146

Browse files
committed
added TSS to power_metrics
1 parent 3312959 commit e001146

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/phpFITFileAnalysis.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,6 +1749,9 @@ public function powerMetrics($functional_threshold_power)
17491749
$power_metrics['Intensity Factor'] = $power_metrics['Normalised Power'] / $functional_threshold_power;
17501750
$power_metrics['Training Stress Score'] = (count($this->data_mesgs['record']['power']) * $power_metrics['Normalised Power'] * $power_metrics['Intensity Factor']) / ($functional_threshold_power * 36);
17511751

1752+
// TSS is IF^2*100*Ride Duration in hours.
1753+
$power_metrics['Training Stress Score'] = round(($power_metrics['Intensity Factor'] * $power_metrics['Intensity Factor']) * 100 * (count($this->data_mesgs['record']['power']) / 3600));
1754+
17521755
// Round the values to make them something sensible.
17531756
$power_metrics['Average Power'] = (int)round($power_metrics['Average Power']);
17541757
$power_metrics['Kilojoules'] = (int)round($power_metrics['Kilojoules']);

0 commit comments

Comments
 (0)