Introductory Programming Fall 2005 Evaluation 6 Today Today's instructions 1) create a file named freefall.m in the usual place you put scripts 2) type in the following code function dxdt = f(t, X) r = X(1); % the first component is position v = X(2); % the second component is velocity drdt = v; dvdt = acceleration(t, r, v); dxdt = [drdt; dvdt]; % pack the results in a column vector end function a = acceleration(t, r, v) g = 9.8; % acceleration of gravity in m/s^2 a = -g; end This is similar to what we worked on last time, except that X is a vector with two elements: position and velocity. The function dxdt unpacks X, computes drdt and dvdt, and then packs the result into a vector. The function acceleration computes the acceleration of a hypothetical particle under force of gravity. Notice that acceleration is (in general) a function of time, position and velocity. 3) evaluate dxdt from the command line using the values t=0 (seconds), r=4000 (meters), v=0 (m/s) Assuming that it works, what does the result mean? 4) use ode45 to compute the position and velocity of the particle over a time range from 0 to 10 seconds, with the initial values t=0 (seconds), r=4000 (meters), v=0 (m/s) How long does it take the particle to fall from 4000 meters to the ground? 5) Modify acceleration to compute the force of wind resistance for a 70 kg skydiver with drag constant c = 0.22. What is the skydiver's terminal velocity? How long does he/she take to bounce? 6) Modify acceleration again so that after 30 seconds of free-fall the skydiver deploys a parachute, which (almost) instantly increases the drag constant to 2.7. What is the terminal velocity now? How long (after deployment) does it take to reach the ground?