Okay - I'm having a look.
Firstly, it's probably helpful to express your equation like this...
Code:
function time = T (t)
% constants
S0 = 100; % m
c = 4; % m/s
vm = 3; % m/s
k = 0.02; % s^-1.
time = ((vm - c)/k) * (1 - exp(-k*t)) + S0*exp(-k*t);
... which means you can do cool stuff like ...
Code:
times = 0:0.1:300;
plot (times, T(times))
... which (I think) is the time-to-contact for a series of times.
Could you post the algorithms? I don't know what they mean.