# Alternative load calculation for mountainbiking

**URL:** <https://forum.intervals.icu/t/alternative-load-calculation-for-mountainbiking/72320>\
**Category:** Feature Requests\
**Created:** [22 July 2024 18:43 UTC](https://forum.intervals.icu/t/alternative-load-calculation-for-mountainbiking/72320 "2024-07-22T18:43:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![david](https://forum.intervals.icu/user_avatar/forum.intervals.icu/david/32/30189_2.png) [@david](https://forum.intervals.icu/u/david)\
**Post date:** [23 July 2024 03:35 UTC](https://forum.intervals.icu/t/alternative-load-calculation-for-mountainbiking/72320/2 "2024-07-23T03:35:58Z")

</div>

It is possible to calculate training load using a custom activity field and also update the intensity and load on the activity. Under the ride timeline chart choose “Custom” and “Add Field”. Name it MTBLoadCalc or similar and paste this on the script tab:

```auto
{
  let fixed_watts = icu.streams.fixed_watts
  let ans
  if (fixed_watts) {
    let tot = 0, n = 0
    for (let v of fixed_watts) {
      if (v) {
        tot += v
        ++n
      }
    }
    if (n > 0) {
      ans = tot / n
      if (icu.activity.type === 'MountainBikeRide') {
        //console.log("ftp", icu.activity.icu_ftp)
        let intensity = ans / icu.activity.icu_ftp
        //console.log("intensity", intensity)
        let hours = icu.activity.moving_time / 3600.0;
        //console.log("hours", hours)
        let load = intensity * intensity * hours * 100.0;
        //console.log("load", load)
        icu.activity.icu_training_load = Math.floor(load + 0.5)
        icu.activity.intensity = Math.floor(intensity * 100 + 0.5)
      }
    }
  }
  ans
}

```

You can see it is calculating the average power excluding zeros and returning that. However it also updates intensity and icu\_training\_load on the activity as a side effect … you need to re-analyse existing activities to get the new load calculation.

---

_[View the full topic](https://forum.intervals.icu/t/alternative-load-calculation-for-mountainbiking/72320)._
