Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Parameters: The velocity profile (v_profile)

  • Returns: The negative sum of how much the car’s velocity in v_profile is greater than the maximum velocity at each point in the map of elevations (error)

  • If the velocity in v_profile isn’t greater than the maximum velocity at a certain point, the error variable will not be incremented.

  • The maximum velocity is calculated by calling the max_velocity function from car_model.py

Solution

  • 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.

...