Added SWOLF activity and interval fields

There was an enquiry about calculating SWOLF for swims. I did a bit of googling and it seems SWOLF is calculated per 25m (strokes + seconds). So for the whole activity the SWOLF calculation looks like this:

{
let strokesPerSec = activity.average_cadence / 60
let strokes = activity.moving_time * strokesPerSec
let swolf = (strokes + activity.moving_time) * 25 / activity.icu_distance
swolf
}

I have added public custom activity and interval SWOLF fields using this calculation. You can search for SWOLF:

6 Likes

Hi David,
Thank you for SWOLF. This method is generally ok, but it’s not accurate. It’s because average cadence per second rounding. The difference between real SWOLF and the code above is not so huge (2-3%) but in swimming it makes game change - just like bike power meters :slight_smile:

This could be perfectly solved by extracting total_strokes from fit file:
SWOLF = (activity.total_strokes + acivity.moving_time) / activity_lengths * (25 / activity.pool_length)

This method also incudes normalized pool lenght. Sometimes swim session are in 20m or 50m pool lenght, so there need to be normalization to 25m at the end.

totals strokes can be find here:

2 Likes

Unfortunately total_strokes is on the length records in the file I looked at (your swim from 9th Feb). What I don’t understand is how swimming cadence is calculated. One of your lengths from that swim:

total_elapsed_time = 56.469
total_strokes = 47
avg_swimming_cadence = 56

How can avg_swimming_cadence be 56? Strokes per minute = (47 / 56.469) * 60 = 49.93.

I took other lengths and also there are differences in average swimming cadence. I’ll google it and will try to find out why there are differences.

Ok, figured out.
it’s like Garmin cadence “Zero averaging” cadence feature set to OFF.
So when you flip at the end of each pool length, you are starting first stroke after some seconds after underwater, and then starts strokes. so average strokes not including those uderwater zeros.

1 Like

Hi, Can’t find SWOLF?

You need to click “Custom” under the activity timeline chart and then the search button:

It’s a field that is calculated for each activity. You can also click “Fields” and the search button to add it as an interval field.

1 Like

Hi David,

i want to see the total_strokes in my diagrams.

I used this code:
{
let strokes = activity.total_strokes
strokes
}

But nothing showing. What’s wrong here?

Thanks!
Marc

It would be nice if this was also a chart shown on the activity. I also have some swim activities (likely the ones including drills) where this current value doesn’t populate.

1 Like