Skip to content

Add GPX race pacing calculator#5

Open
smart-knowledge-systems wants to merge 2 commits intojohnjdavisiv:mainfrom
smart-knowledge-systems:gpx-race-pacing-calculator
Open

Add GPX race pacing calculator#5
smart-knowledge-systems wants to merge 2 commits intojohnjdavisiv:mainfrom
smart-knowledge-systems:gpx-race-pacing-calculator

Conversation

@smart-knowledge-systems

Summary

  • Add comprehensive GPX race pacing calculator alongside existing GAP calculator
  • Implement GPX file parsing with distance, elevation, and grade calculations
  • Create goal pace solver using iterative algorithm to find optimal base pace
  • Add lap calculator for generating splits at configurable intervals (400m, 1km, 1 mile, 5km)
  • Include route statistics and GAP-adjusted pacing recommendations
  • Support CSV export of lap splits

Test plan

  • Upload sample GPX file and verify parsing
  • Test goal time calculation with different target times
  • Verify lap splits generation for different intervals
  • Test CSV export functionality
  • Validate GAP calculations integrate correctly with existing calculator

🤖 Generated with Claude Code

This commit transforms the single GAP calculator into a dual-mode application with two calculators:

1. Original GAP Calculator (preserved):
   - Maintains all existing GAP calculation functionality
   - Uses Minetti polynomial and Black GAM data for energy expenditure calculations

2. New GPX Race Pacing Calculator:
   - Parses GPX files to extract route elevation profiles
   - Implements iterative solver to find correct base pace that achieves goal time
   - Generates lap splits (400m, 1k, 1 mile, 5k) accounting for elevation changes
   - Uses GAP calculations to adjust pace for grade variations
   - Provides CSV export for splits

Key implementation details:
- GPXParser: Calculates distances, grades, and smoothed elevation profiles
- GoalPaceSolver: Iteratively solves for base pace using reverse GAP calculations
- LapCalculator: Generates splits with GAP-adjusted times for each segment
- UI: Toggle between calculators, file upload, goal time input, results display

The solver ensures that the calculated lap times, when accounting for all elevation changes along the route, will sum to exactly the target goal time.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add safety-based speed capping for steep downhills (>8% decline) where
theoretical GAP speeds are unrealistic and dangerous to achieve in practice.

Changes:
- Add progressive speed limitation from -8% to -25% grade with max 60% reduction
- Cap maximum downhill speed to 1.5x base pace for safety
- Track segments where speed capping is applied for transparency
- Display visual indicators (⚠️) on affected lap splits
- Highlight speed-capped laps with yellow background
- Show warning message in pacing strategy when adjustments are applied
- Add tooltips explaining the safety limitations to users

Based on research showing runners cannot achieve metabolically equivalent
speeds on steep downhills due to biomechanical constraints and safety concerns.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants