dist <- seq(0, 40, length.out = 1000)
velocity <- predict_velocity_at_distance(
distance = dist,
MSS = 10,
MAC = 9
)
acceleration <- predict_acceleration_at_distance(
distance = dist,
MSS = 10,
MAC = 9
)
# Use ... to forward parameters to the shorts::get_air_resistance
pwr <- predict_power_at_distance(
distance = dist,
MSS = 10,
MAC = 9
# bodyweight = 100,
# bodyheight = 1.9,
# barometric_pressure = 760,
# air_temperature = 25,
# wind_velocity = 0
)
# Find critical distance when 90% of MSS is reached
plot(x = dist, y = velocity, type = "l")
abline(h = 10 * 0.9, col = "gray")
abline(v = find_velocity_critical_distance(MSS = 10, MAC = 9), col = "red")
# Find critical distance when 20% of MAC is reached
plot(x = dist, y = acceleration, type = "l")
abline(h = 9 * 0.2, col = "gray")
abline(v = find_acceleration_critical_distance(MSS = 10, MAC = 9, percent = 0.2), col = "red")
# Find peak power and location of peak power
plot(x = dist, y = pwr, type = "l")
peak_pwr <- find_peak_power_distance(
MSS = 10,
MAC = 9
# Use ... to forward parameters to the shorts::get_air_resistance
)
abline(h = peak_pwr$peak_power, col = "gray")
abline(v = peak_pwr$distance, col = "red")
# Find distance in which relative power stays over 75% of PMAX'
plot(x = dist, y = pwr, type = "l")
abline(h = peak_pwr$peak_power * 0.75, col = "gray")
pwr_zone <- find_power_critical_distance(MSS = 10, MAC = 9, percent = 0.75)
abline(v = pwr_zone$lower, col = "blue")
abline(v = pwr_zone$upper, col = "blue")
Run the code above in your browser using DataLab