Working of swim workout Generator
Swimming is an excellent form of exercise that provides a full-body workout and helps improve cardiovascular health, muscle strength, and endurance. However, creating an effective swim workout can be challenging, especially for beginners who may not know how to structure their training sessions.
To help swimmers design a personalized workout plan, we created a swim workout generator that generates a customized swim workout based on the user’s inputs. In this article, we will explain how the swim workout generator works and the formula it uses to calculate the appropriate workout.
Inputs
The swim workout generator takes three inputs from the user:
- Distance: The distance of the swim in meters. The user can input a value between 50 and 5000 meters in increments of 50 meters.
- Duration: The duration of the swim in minutes. The user can input a value between 5 and 120 minutes in increments of 5 minutes.
- Effort level: The user’s effort level on a scale of 1 to 10, with 10 being the highest effort level. The user can select the effort level using a slider input.
Formula
The swim workout generator uses a simple formula to calculate the appropriate workout based on the user’s inputs. The formula calculates two key metrics:
- Pace: The pace is the time it takes for the swimmer to complete 100 meters. The pace is calculated using the following formula:Pace = Duration (in seconds) / Distance (in meters) * 100For example, if the user swims 1000 meters in 20 minutes, the pace would be:Pace = 20 * 60 / 1000 * 100 = 2 minutes per 100 meters
- Threshold pace: The threshold pace is the pace at which the swimmer can sustain a moderate to high effort level for a given distance. The threshold pace is calculated using the following formula:Threshold pace = (100 – Effort level) / 100 * PaceFor example, if the user’s effort level is 7 and the pace is 2 minutes per 100 meters, the threshold pace would be:Threshold pace = (100 – 7) / 100 * 2 = 1.86 minutes per 100 meters
Once the pace and threshold pace are calculated, it uses the following if-else statements to generate the appropriate workout:
- If the threshold pace is greater than 2 minutes per 100 meters, the generator suggests the workout: “Swim [Distance] meters at a moderate pace. Rest for 20 seconds after each 100 meters. Repeat 10 times.”
- If the threshold pace is greater than 1 minute and 50 seconds per 100 meters, the generator suggests the workout: “Swim [Distance] meters at a moderate pace. Rest for 15 seconds after each 100 meters. Repeat 12 times.”
- If the threshold pace is greater than 1 minute and 40 seconds per 100 meters, the generator suggests the workout: “Swim [Distance] meters at a fast pace. Rest for 10 seconds after each 100 meters. Repeat 15 times.”
- Otherwise, the generator suggests the workout: “Swim [Distance] meters at a very fast pace. Rest for 5 seconds after each 100 meters. Repeat 20 times.”
Conclusion
In conclusion, the swim workout generator is a simple tool that helps swimmers design a personalized workout plan based on their individual inputs. The generator uses a formula that calculates the pace and threshold pace to determine the appropriate workout for the user’s skill level and effort level.