...
Parameters: The name of the course we’re trying to load in (course_name)
Returns: The map of elevations on said course (elev_profile).
elev_profile
: (2D float list)Each row represents a section of a course
column 0: the pitch/slope/steepness of the section (rad)
column 1: the length of the section (m)
stops
: (float list)Each element is the index of where each turns are (corresponds to row index in elev_profile)
total_dist
: (float) All section lengths added up. Total distance. (m)
The map of elevations has dimensions num_points x 2, with column 1 (Index 0) representing the y-coordinates and column 2 (Index 1) representing the x-coordinates.
...
Calculated using scipy.optimize’s minimize function with the objective function as the function that will be minimized, v0 as the initial profile (naive solution), the bounds being the minimum and maximum velocity, Sequential Least SQuares Programming (SLSQP)optimizer as the method of minimizing the objective function, and the constraints being the speed_constraint and time_constraint function.
Code Block | ||
---|---|---|
| ||
solution = minimize(objective, v0, method='SLSQP',
bounds=bounds, constraints=conditions) |