File Format
Optimal Cycling uses an open file format to store the simulation data for power pacing optimizations. It is meant to be human readable and editable with a simple spreadsheet program, like Microsoft Excel or OpenOffice.org Calc.
An Optimal Cycling simulation is contained inside a folder. In the folder are a number of CSV files that define the data for the simulation as well as store the results. A single text file is also used to store the console output showing the progress of the simulation. Below is a screenshot of an example folder containing an Optimal Cycling simulation.
Note that the headers for the CSV files are *not* case sensitive and also, the order of the columns are *not* guaranteed, in case you want to write your own parser. Optimal Cycling reads in the text of the headers to know what is where and is not dependent on the order of the columns.
Here, we will describe each each of the items contained inside an Optimal Cycling data folder used for a power pacing simulation:
Intermed
This is a folder containing the temporary files that Optimal Cycling uses as a place to save your running optimization. In case something goes wrong, you can restart from the last saved point instead of re-running the whole simulation. Normally, you do not need to do anything inside this folder.
Comments.csv
This file allows you to type some comments into it to remind yourself what the simulation is for.
Headers:
- Comments 0
- Comments 1
- Comments 2
- Comments 3
- Comments 4
ConsoleOutput.txt
This is a text file where Optimal Cycling saves the console output showing the progress of your simulation.
Headers:
- Compute Time
- How long the simulation has been running for.
- Gen #
- How many generations of candidate solutions have been generated so far.
- Best Time [s]
- The best time found so far.
- Viable
- How many valid power pacing solutions have been found so far up to a maximum of what is allowed.
- Convergence
- How close the candidate solutions agree with each other. It approaches zero as the solutions are refined.
Course.csv
This file allows you to define the course profile, wind, power limits, etc…. for the simulation.
Headers:
- Course X [m]
- The X coordinates of the course in metres.
- Course Y [m]
- The Y coordinates of the course in metres. This is required to be the elevation above sea level.
- Course Z [m]
- The Z coordinates of the course in metres. Use this only if you are trying to model in 3D instead of a regular 2D course profile.
- Wind X [m/s]
- The X vectors of the wind.
- Wind Y [m/s]
- The Y vectors of the wind.
- Wind Z [m/s]
- The Z vectors of the wind. Use this only if you are trying to model in 3D instead of a regular 2D course profile.
- Power [watts]
- A guess for the power output for each point on the course. Or, if not using Optimal Cycling for power optimization, this is the power to be simulated.
- Power Minimum [watts]
- The lower limit for the power that can be produced. Must be >= 0.
- Power Maximum [watts]
- The upper limit for the power that can be produced.
- Speed Limit High [m/s]
- The maximum speed allowed per point on the course.
- Air Temperature [Celsius]
- The air temperature for each point on the course.
- Dew Point Temperature [Celsius]
- The dew point temperature for each point on the course.
- Air Pressure [Pascals]
- The air pressure for each point on the course.
- General CdA [unitless]
- The CdA drag value for the rider + bike for each point on the course. Note that this should actually read General CdA [m^2]. This will be fixed in future revisions of Optimal Cycling.
- Crr [unitless]
- The rolling resistance coefficient for each point on the course.
- Mass of Rider [kg]
- Mass Front Wheel [kg]
- Mass Rear Wheel [kg]
- Mass Bike Without Wheels [kg]
FileInformation.csv
This file contains the version number of the file format so that future revisions of Optimal Cycling will know how to convert old data folders.
Headers:
- File Version
- A string of text that describes the version of the file format.
IntegrationParams.csv
This file contains the calculus integration parameters used by Optimal Cycling to solve the physics model of a bicycle racer. Normally, the only value you should change in here is the maximum expected time needed for the rider to race the course.
Headers:
- Minimum Speed [m/s]
- The minimum speed that the rider is allowed to take on. Must be >= 0.01 m/s because there is an asymptote at 0 m/s. Suggested value is 0.01 m/s.
- Initial Speed [m/s]
- The initial speed that the rider starts the race with. Must be >= 0.01 m/s because there is an asymptote at 0 m/s. Suggested value is 0.01 m/s.
- Race Time Measure Start Index [0-(Total Points - 1)]
- The zero based index of the course simulation points where the racing timing starts.
- Max. Time Expected [sec]
- The maximum time that is expected to be needed for the rider to race the course. This prevents the integration from running forever on non-viable power outputs. Setting this value too low will result in Optimal Cycling not being able to solve the simulation. Suggested value is 10000 sec.
- Integration Initial Step Size [sec]
- Initial step size for the Runge Kutta Fehlberg 45 integration. Recommend is 0.005 sec. Do not change unless you know what the effects are.
- Integration Global Tolerance [sec]
- Tolerance Runge Kutta Fehlberg 45 integration. Recommend is 0.001 sec. Do not change unless you know what the effects are.
- Integration Minimum Step Size [sec]
- Minimum step size for the Runge Kutta Fehlberg 45 integration. Recommend is 0.001 sec. Do not change unless you know what the effects are.
- Integration Maximum Step Size [sec]
- Minimum step size for the Runge Kutta Fehlberg 45 integration. Recommend is 1 sec. Do not change unless you know what the effects are.
MiscModelData.csv
Various additional model parameters.
Headers:
- Drive Train Efficiency [0-1]
- Recommended value is 0.98.
- Front Wheel Diameter [m]
- Typical size is 0.674 metres.
- Rear Wheel Diameter [m]
- Typical size is 0.674 metres.
- Rear Wheel Shielding Drag Reduction Factor [unitless]
- How well the rear wheel is shielded from the wind. Recommend value is 0.25.
- Gravity Coeff. [m/s^2]
- The acceleration due to gravity, ex: 9.80665 m/s^2.
OptimizationParams.csv
This file defines the parameters of the solver that Optimal Cycling uses to obtain the optimized power pacing. It defines things such as how long the simulation can run for and how often to save the simulation.
Headers:
- Progress Update Frequency [>=0]
- How often to print simulation progress to the console screen. If set to 0, there will be no progress updates. Recommended value is 10.
- Intermediate Save Frequency [>=0]
- How often to save the simulation state in case the program is ended prematurely. If set to 0, there will be no intermediate saving. Recommended value is >=200.
- Keep All Intermediates [bool]
- Whether the intermediate saved program states should all be kept. Default is FALSE.
- Rand Num. Gen. Seed
- An integer used to set the random number generator.
- Num. Populations [>=1]
- How many simultaneous populations of solutions the solver should use. Recommended is 1.
- Population Size [>=10]
- How many solutions should exist in total from all populations. Recommended is 50.
- Max. Gens. to Run [>=1]
- The maximum number of generations the solver should generate before we force it to end if convergence is not reached. Recommended is >=10000.
- Gens. Between Migrations [>=1]
- How many generations should be generated before we mix the populations. This has no effect if there is only 1 population.
- Migration Size [>=1]
- The number of solutions that should be swapped during a migration.
- Max. Num. Heuristic Seeds [>=0]
- The maximum number of heuristic solutions that should be used to seed the initial population. The rest are seeded randomly. The recommend number is a quarter to a half of the total population size.
- Convergence Generations [>=1]
- When the convergence tolerance falls below the set value, this is how many generations we should keep going before ending the simulation. Recommended is 500.
- Convergence Tolerance [>=0]
- The convergence tolerance we want to achieve before ending the simulation.
PowerMetricsCriticals.csv
This file contains the critical/maximal power curve of the athlete. It is used to limit the overall power that can be generated by the chosen power metric.
Headers:
- Duration [sec]
- The durations corresponding to the critical/maximal power. The duration should increase as you go down the column.
- Max. Power [watts]
- The critical/maximal power.
PowerMetricsParams.csv
This file tells Optimal Cycling what power metric to use and what the parameters are for the power metrics.
Headers:
- Power Rate Coeff. [unitless]
- Used for the CCAP power metric to scale the power rate, see http://optimalcycling.com/power-pacing/power-metrics/.
- Power Rate Exp. [unitless]
- Used for the CCAP power metric to scale the power rate, see http://optimalcycling.com/power-pacing/power-metrics/.
- Power Curve Exp. [unitless]
- Used for the CCAP power metric to scale the power, see http://optimalcycling.com/power-pacing/power-metrics/.
- Functional Threshold Power [watts]
- Used for the CCAP power metric to scale the power.
- General Mean Exp. [unitless]
- For general mean type power metrics, see http://en.wikipedia.org/wiki/Generalized_mean. If you want “Normalized Power”, set this to 4 and set the rolling average to 30 sec.
- General Mean Rolling Average Time [sec]
- For general mean type power metrics, see http://en.wikipedia.org/wiki/Generalized_mean. If you want “Normalized Power”, set this to 30 sec.
- General Mean Sampling Interval [sec]
- How often the power data should be sampled in the calculation of a general mean. Recommended value is 0.25-0.5 sec.
- Power Metric Choice [0-CCAP, 1-Ave, 2-GM]
- It is highly recommended to set this value to 0 in order to use the CCAP power metric that was designed for Optimal Cycling.
- Power Optimization Type [0-None, 1-Limits, 2-Constant]
- Setting this value to 0 results in Optimal Cycling simply calculating the acceleration, speed, and time of the racer using the power values given in Course.csv without any optimization. Setting it to 1 results in a normal power pacing optimization. Setting it to 2 results in calculating the highest constant power that can be sustained for the course.
ResultsCourse.csv
This is the primary file containing the results of a simulation and is where you can see the optimized power numbers.
Headers:
- Course X [m]
- Course Y [m]
- Course Z [m]
- Linear Position [m]
- Wind X [m/s]
- Wind Y [m/s]
- Wind Z [m/s]
- Time [s]
- Optimized Power [watts]
- Speed [m/s]
- Acceleration [m/s^2]
- Air Density [kg/m^3]
ResultsPowerMetrics.csv
This is the other results file where you can see the power metric numbers.
Headers:
- Race Time [sec]
- Total Time [sec]
- Average Speed [km/hr]
- Energy Used [J]
- Average Power [watts]
- CCAP [watts]
- General Mean [watts]
- Critical Power [watts]
WheelDragCoeff.csv
This file is where the drag coefficient values are entered in for the front and rear wheels at varying yaw angles.
Headers:
- Yaw Angle [degrees]
- The yaw angle for the corresponding drag coefficient data point. Starts at 0 degrees and up to 360 degrees.
- Front Wheel Drag Coefficient [unitless]
- Rear Wheel Drag Coefficient [unitless]
WheelRotInertia.csv
This file allows you to enter the rotational inertia of the wheels as a function of speed. Useful for modelling what happens if you have spinning weights on your wheels.
Headers:
- Speed [m/s]
- There must be at least one data point.
- Front Wheel Rot. Inertia [kg*m^2]
- Rear Wheel Rot. Inertia [kg*m^2]


Leave your response!