The battle plan
Load your route. You come out with a finish time, watts per section, grams of carbs per hour and the exact moment you are going to crack. Physical model of mechanical resistance (Martin et al., 1998), air density at real altitude, substrate oxidation computed section by section. Enough to avoid hitting the wall.
The mechanics and the metabolism
Physical model
Every watt you put through the pedals fights three forces: gravity on the way up (weight × g × sin θ), aerodynamic drag (½ × ρ × CdA × v²) and the rolling resistance of your tyres (Crr).
1 kJ ≈ 1 kcal
Human efficiency on a bike sits around 21.5 % (1 / 0.215 ≈ 4.65). Since one kilocalorie is 4.184 kJ, the factor almost perfectly cancels itself out: 1 mechanical kJ ≈ 1 metabolic kcal burned.
Exhaustion window
Your glycogen stores (liver + muscles) cap out around 450 g (~1800 kcal). With no carbs coming in from outside, a high-intensity ride empties them in 1 h 30 to 2 h 15.