Matlab Program to Model a Situation

Suppose that a rabbit is initially at point (0,100) and a fox is at (0,0). Suppose that the rabbit runs to the right at speed Vr = 5 ft/sec and the fox always runs toward the rabbit at speed Vf = 6 ft/sec. Write a Matlab program that determines to within 1 second, when the fox catches the rabbit. The program should also plot rabbit and fox positions. Use the modified Euler method to estimate Xf(t),Yf(t) and the time to capture. Please do not respond without a written program in Matlab.

© SolutionLibrary Inc. solutionlibary.com 9836dcf9d7 https://solutionlibrary.com/math/numerical-analysis/matlab-program-to-model-a-situation-2s2

Solution Preview

...=0;

while ( Xf <Xr)

t=t+dt;
Xr=100+Vr*t;
Xf= ...