Hello
I am following the medical litterature on atherosclerosis and endurance sports. Lately, the belgian teams from the Master@Heart study have published a paper with real data from wearables. They have used the eTrimp training load score in their paper in Circulation (NCT03711539)
Thanks to LLM, I have created a new field called eTRIMP to compare my data with the study population data.
The JS code is as follows
(function () {
// 1. Récupération du flux de fréquence cardiaque (corrigé en “heartrate”)
let hrStream = streams.get(“heartrate”);
if (!hrStream || !hrStream.data) return null;
let hrData = hrStream.data;// 2. Récupération des paramètres de l’athlète (ou valeurs par défaut)
let maxHr = athlete.max_hr || 180;
let restHr = athlete.resting_hr || 50;
let hrReserve = maxHr - restHr;let totalEtrimp = 0;
// 3. Boucle sur chaque point du flux (enregistré à 1 Hz = 1 seconde)
for (let i = 0; i < hrData.length; i++) {
let hr = hrData[i];
if (!hr || hr <= restHr) continue;// Calcul de l'intensité relative (fraction de la réserve cardiaque) let fraction = (hr - restHr) / hrReserve; // Attribution du coefficient de zone (Z1=1 à Z5=5) let weight = 1; if (fraction >= 0.90) weight = 5; // Zone 5 (Max / Anaérobie) else if (fraction >= 0.80) weight = 4; // Zone 4 (Seuil) else if (fraction >= 0.70) weight = 3; // Zone 3 (Tempo) else if (fraction >= 0.60) weight = 2; // Zone 2 (Endurance fondamentale) else weight = 1; // Zone 1 (Récupération) // Chaque point représente 1 seconde, soit 1/60ème de minute totalEtrimp += weight * (1 / 60);}
// Retourne la valeur finale arrondie à une décimale
return Math.round(totalEtrimp * 10) / 10;
})();
does it sounds good to you ?