Delete old alternative TSS calculation system
This commit is contained in:
parent
40c56fb7ee
commit
d274ea69a9
|
|
@ -2,7 +2,6 @@ import { Workout } from "../ast";
|
|||
import { averageIntensity } from "./averageIntensity";
|
||||
import { normalizedIntensity } from "./normalizedIntensity";
|
||||
import { totalDuration } from "./totalDuration";
|
||||
import { tss } from "./tss";
|
||||
import { tss2 } from "./tss2";
|
||||
import { zoneDistribution } from "./zoneDistribution";
|
||||
|
||||
|
|
@ -19,8 +18,7 @@ Total duration: ${(duration.seconds / 60).toFixed()} minutes
|
|||
Average intensity: ${(avgIntensity.value * 100).toFixed()}%
|
||||
Normalized intensity: ${(normIntensity.value * 100).toFixed()}%
|
||||
|
||||
TSS #1: ${tss(intervals).toFixed()}
|
||||
TSS #2: ${tss2(duration, normIntensity).toFixed()}
|
||||
TSS: ${tss2(duration, normIntensity).toFixed()}
|
||||
|
||||
Zone Distribution:
|
||||
${zones.map(({ name, duration }) => `${(duration.seconds / 60).toFixed().padStart(3)} min - ${name}`).join("\n")}
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
import { Interval } from "../ast";
|
||||
import { Duration } from "../Duration";
|
||||
|
||||
// Training Stress Score formula from Training and Racing with a Power Meter:
|
||||
//
|
||||
// TSS = (s * W * IF) / (FTP * 3600) * 100
|
||||
//
|
||||
// s - duration in seconds
|
||||
// W - power in watts
|
||||
// IF - intensity factor (power / FTP)
|
||||
|
||||
const steadyTss = (duration: Duration, intensity: number): number => {
|
||||
return ((duration.seconds * intensity * intensity) / 3600) * 100;
|
||||
};
|
||||
|
||||
const rangeTss = (duration: Duration, from: number, to: number): number => {
|
||||
let score = 0;
|
||||
const step = new Duration(1);
|
||||
for (let i = 0; i < duration.seconds; i += step.seconds) {
|
||||
const intensity = from + (to - from) * (i / duration.seconds);
|
||||
score += steadyTss(step, intensity);
|
||||
}
|
||||
return score;
|
||||
};
|
||||
|
||||
const intervalTss = ({ duration, intensity }: Interval): number => {
|
||||
if (intensity.start === intensity.end) {
|
||||
return steadyTss(duration, intensity.value);
|
||||
} else {
|
||||
return rangeTss(duration, intensity.start, intensity.end);
|
||||
}
|
||||
};
|
||||
|
||||
export const tss = (intervals: Interval[]): number => {
|
||||
return intervals.map(intervalTss).reduce((a, b) => a + b, 0);
|
||||
};
|
||||
|
|
@ -245,8 +245,7 @@ Total duration: 24 minutes
|
|||
Average intensity: 60%
|
||||
Normalized intensity: 74%
|
||||
|
||||
TSS #1: 17
|
||||
TSS #2: 22
|
||||
TSS: 22
|
||||
|
||||
Zone Distribution:
|
||||
15 min - Z1: Recovery
|
||||
|
|
@ -265,8 +264,7 @@ Total duration: 43 minutes
|
|||
Average intensity: 79%
|
||||
Normalized intensity: 84%
|
||||
|
||||
TSS #1: 48
|
||||
TSS #2: 51
|
||||
TSS: 51
|
||||
|
||||
Zone Distribution:
|
||||
10 min - Z1: Recovery
|
||||
|
|
@ -285,8 +283,7 @@ Total duration: 45 minutes
|
|||
Average intensity: 36%
|
||||
Normalized intensity: 71%
|
||||
|
||||
TSS #1: 21
|
||||
TSS #2: 37
|
||||
TSS: 37
|
||||
|
||||
Zone Distribution:
|
||||
35 min - Z1: Recovery
|
||||
|
|
@ -305,8 +302,7 @@ Total duration: 62 minutes
|
|||
Average intensity: 74%
|
||||
Normalized intensity: 81%
|
||||
|
||||
TSS #1: 62
|
||||
TSS #2: 68
|
||||
TSS: 68
|
||||
|
||||
Zone Distribution:
|
||||
22 min - Z1: Recovery
|
||||
|
|
@ -325,8 +321,7 @@ Total duration: 79 minutes
|
|||
Average intensity: 69%
|
||||
Normalized intensity: 78%
|
||||
|
||||
TSS #1: 69
|
||||
TSS #2: 81
|
||||
TSS: 81
|
||||
|
||||
Zone Distribution:
|
||||
42 min - Z1: Recovery
|
||||
|
|
|
|||
Loading…
Reference in New Issue