you guys rock!
ok, the question is this:
Tom the cat is running after Jerry the mouse. Tom's velocity is a constant c. Jerry's velocity depends on how close Tom is from Jerry: v(t) = vm - k * S(t), where vm is Jerry's maximum velocity, k is proportional constant, t is time, S(t) is the distance between Tom and Jerry at time t. The initial distance betweeen Tom and Jerry at t = 0 is S0. We found that the time T when Tom will catch Jerrr satisfies the following equation:
F(T) = [(vm - c)/k] * (1 - e^-kt) + S0e^-kt = 0
Suppose S0 = 100m, c = 4 m/s, vm = 3 m/s, k = 0.02s^-1. Use the bisection method, Newton's method, secant method and method of false position to solve for T. For Newton's method, use initial guess T0 = 300 s. For the other 3 methods, search in the interval [0, 300]. For all the methods, use the stopping criteria:
|Tn - Tn - 1 |/|Tn | < 10^-4
How many iterations does each method need? Solve F(T) = 0 by hand to get the true solution and compute the relative error for the numerical result produced by each method.
ok, that's the problem. i have the algorithms for each of the above mentioned methods, but i can't seem to initialize anything or get any of my functions to work properly. maybe something to do with my .m files. thanks again guys.
if you guys need, i'll post the algorithms to the above mentioned methods. thanks.
|