Skip to content

[Feature]: Add VO2max calculation #2248

Description

@aheider

Are you willing to submit a PR?

No, but I can help test

What problem does this solve?

We have everything in the system to calculate VO2max, but miss the formula.
Consider the screen that shows the training sessions like biking or running with GPS and heart rate data.
Now imagine, among them there is a specific session where you pushed to your limits.
Further imagine there would be a button to define this session as "consider for VO2max estimation".
Upon pressing this, the web service (or even the browser in Javascript) calculate the VO2max as follows on the selected data:

  1. The Scenario & Hilly Example Data

Let's assume a 15-minute steady uphill climb segment on a road.
• Runner's Personal Metrics:
o Maximum Heart Rate ((HR_{max})): 190 bpm
o Resting Heart Rate ((HR_{rest})): 60 whom
• Segment Workout Data (Hilly):
o Duration: 15 minutes (900 seconds)
o Distance: 2,500 meters (2.5 km)
o Elevation Gain: 125 meters (via GPS / Barometer data)
o Average Heart Rate during this segment ((HR_{workout})): 168 bpm


  1. Step-by-Step Hilly Calculation
  • Step 1: Calculate Speed and Slope (Grade)

First, we calculate your forward speed and how steep the hill actually was.
• Speed:
(\text{Speed}=\frac{2.5\text{\ km}}{(15/60)\text{\ hours}}=10\text{\ km/h})
Convert this to meters per minute for the formula:
(\frac{10,000\text{\ m}}{60\text{\ min}}=166.67\text{\ m/min})
• Slope Grade (%):
(\text{Grade}=\frac{\text{Elevation\ Gain}}{\text{Distance}}=\frac{125\text{\ m}}{2,500\text{\ m}}=0.05\rightarrow \mathbf{5%}\text{\ grade})
Step 2: Estimate Oxygen Cost with Elevation Included
The complete ACSM formula for calculating oxygen demand (VO₂) while running on an incline is:
(VO_{2}=(\text{Speed}\times 0.2)+(\text{Speed}\times \text{Grade}\times 0.9)+3.5)
Let's plug in your metrics:

  1. Horizontal Component: 166.67 × 0.2 = 33.33
  2. Vertical Component: 166.67 × 0.05 × 0.9 = 7.50
  3. Basal Metabolic Rate: 3.5

Now add them all together:
(VO_{2}\text{\ Demand}=33.33+7.50+3.5=\mathbf{44.33}\text{\ ml/kg/min})
(Note: If the slope were flat (0% grade), your VO₂ demand for 10 km/h would only be 36.83. Moving upward increased your actual exertion demand to 44.33).

Step 3: Calculate Heart Rate Scaling Factor

Now look at how close to your physical ceiling your heart rate (168 bpm) was working to push you up that hill.

  1. Maximum capacity range: 190 - 60 = 130 bpm
  2. Current effort range: 168 - 60 = 108 bpm
  3. Divide maximum by current effort:

(\text{Scaling\ Factor}=\frac{190-60}{168-60}=\frac{130}{108}\approx \mathbf{1.2037})

Step 4: Calculate the final Estimated VO₂max
Scale your calculated uphill energy consumption up to your theoretical maximum cardiac output:
(VO_{2}max=VO_{2}\text{\ Demand}\times \text{Scaling\ Factor})
(VO_{2}max=44.33\times 1.2037\approx \mathbf{53.4}\text{\ ml/kg/min})


  1. Summary comparison: Hilly vs. Flat Assumption

If you completely ignored the GPS elevation data and assumed you were running on flat ground, the math would severely miscalculate your fitness: [1]
• Wrong Calculation (Assuming Flat): It looks like you ran at 10 km/h with a very high heart rate of 168. The flat formula gives a VO₂ demand of only 36.83. Multiplied by the scaling factor, your estimated VO₂max would incorrectly drop to 44.3 ml/kg/min.
• Correct Calculation (Factoring 5% Elevation): The formula understands you were climbing a hill. Your estimated VO₂max stays accurate at 53.4 ml/kg/min.
[1]

Can we please add this?

Describe the feature you'd like

Calculate VO2max and add to health connect

Which area does this relate to?

Exercise tracking, Body metrics

How important is this to you?

Nice to have

Alternatives you've considered

Calculating by hand and saving the VO2max as raw value.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions