Modeling - The Cab Control Problem Determining the form of the safe distance algorithm B A (xn - yn) vn un yn xn
Modeling #5 - The Cab Control Problem an amax slope = k1 (xn- yn) - D -dmax
Modeling #5 - The Cab Control Problem A better safe distance algorithm is this: so
Modeling - The Cab Control Problem Think of a strategy to implement: an -> vn -> yn un -> xn -dmax ≤ an ≤ amax
Modeling - The Cab Control Problem For starters, let’s make un (the speed of the leading cab) be the following: Let us = 40 mph ud = 10 mph w = 0.1 sec-1
Modeling - The Cab Control Problem Start with the equation for the velocity of the leading car A: This can be integrated directly, analytically, to find the position - but let’s use the numerical approach that we used last term:
Modeling - The Cab Control Problem Then repeat for the trailing car B: 1. Calculate the acceleration an from the safe distance algorithm 2. Calculate the velocity vn+1 3. Calculate the distance yn+1
Modeling - The Cab Control Problem 4. Calculate the relative distance: then compute the new acceleration from the safe distance algorithm. 5. Increment the time, and repeat all of the calculations for both cab A and cab B
Modeling - The Cab Control Problem Note: When calculating the acceleration, you must test the relative distance against the safe distance. With “if” statements, or some other approach, you must stop the acceleration from exceeding the two limits (amax and -dmax)