Skip to content

Integrate TRIMP per-sample instead of session-average - #4858

Open
cagnulein wants to merge 1 commit into
masterfrom
fix/trimp-integrate-per-sample
Open

Integrate TRIMP per-sample instead of session-average#4858
cagnulein wants to merge 1 commit into
masterfrom
fix/trimp-integrate-per-sample

Conversation

@cagnulein

Copy link
Copy Markdown
Owner

Summary

  • The Bannister TRIMP formula in qfit::save was applied once using the whole-session average HR, instead of being accumulated sample-by-sample.
  • Because exp() is convex, a single average-HR pass systematically underweights any workout with HR variability (intervals, surges, sprints) compared to the true per-minute integration — which is how Garmin devices themselves compute training load.
  • This is a likely contributor to reports of Garmin Connect's Endurance Score not reflecting real effort for activities uploaded via QZ (see user report: "QZ app - Endurance Score in Garmin Connect").
  • Verified against real debug logs/FIT files from 4 test rides (30/30/60/75 min): the new per-sample integration reduces to the same result as before for near-constant-HR sessions, but will score higher for sessions with HR spikes (e.g. one test ride hit 171bpm against a configured max of 162 — a spike the old average-based formula effectively ignored).

Test plan

  • Record a steady-effort indoor ride and confirm Training Load/Aerobic TE in the FIT file are unchanged from before (regression check for constant-HR sessions)
  • Record an interval/variable-effort ride and confirm Training Load/Aerobic TE now score higher than a steady ride with the same average HR
  • Upload both to Garmin Connect and confirm Acute/Chronic Load and Endurance Score look consistent with the actual effort

🤖 Generated with Claude Code

The Bannister TRIMP formula was applied once using the whole-session
average HR, but exp() is convex: a single average-HR pass systematically
underweights any workout with HR variability (intervals, surges) versus
a proper per-minute accumulation, which is how Garmin devices compute it.
This under-reported training load/effect for variable-intensity rides,
likely contributing to reports of Endurance Score not reflecting real
effort when uploaded via QZ.
@stale

stale Bot commented Aug 16, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix This will not be worked on label Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant