Makes the physical modelling of cycling trivially easy.
For example, let's try and estimate the power required for Wiggo's current hour record:
>>> from rouleur import CyclingParams, calculate_air_density
>>>
>>> record = 54.526 # km/h
>>> record *= 1000 / 60**2 # m/s
>>> rho = calculate_air_density(30, 777, 0.6) # about right
>>> pars = CyclingParams(
>>> rider_velocity=record,
>>> air_density=rho,
>>> CdA=0.19, Crr=0.0025,
>>> chain_efficiency_factor=0.98,
>>> road_gradient=0,
>>> mass_total=82)
>>>
>>> pars.solve_for.power_output()
440.9565671224358
That's all there is to it.
The API consists almost exclusively of the CyclingParams
class, which holds all the parameters required for modelling a cyclist. The class constructor combines a number of sensible defaults with any (keyword) arguments passed. Details of recognised keyword arguments---i.e. model parameters---can be found in the class docstring (help(CyclingParams)
).
Instances then have a number of solver methods accessible via parameters.solve_for.*
.
This package is an implementation of a number of published algorithms. Important references are: