Thread: Matlab
View Single Post
Old 07-24-2003, 08:09 AM   #9 (permalink)
Taliesin
Crazy
 
Location: Oxford, UK
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.

Last edited by Taliesin; 07-24-2003 at 08:16 AM..
Taliesin is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76