_pi_cruise_control

pynumdiff.utils._pi_cruise_control.run(timeseries_length=4, dt=0.01)

Simulate proportional integral control of a car attempting to maintain constant velocity while going up and down hills. This function is used for testing differentiation methods.

This is a linear interpretation of something similar to what is described in Astrom and Murray 2008 Chapter 3.

Parameters
  • timeseries_length (float) – number of seconds to simulate

  • dt (float) – timestep in seconds

Returns

a tuple consisting of arrays of size [N, M], where M is the number of time steps.: - state_vals: state of the car, i.e. position and velocity as a function of time - disturbances: disturbances, ie. hills, that the car is subjected to - controls: control inputs applied by the car

Return type

tuple -> (np.array, np.array, np.array)