%
% simple euler integration routine
%
% bob newell, 1999
%
function [ t, x ] = euler( func, times, xo )
%
x = xo(:)';
t = times(1);
if length(times) < 3
   times(3) = ( times(2) - times(1) ) / 1000;
end;
%
xx = xo(:);
for tt = times(1):times(3):times(2),
   dx = feval( func, tt, xx );
   xx = xx + dx * times(3);
   x = [ x; xx' ];
   t = [ t; tt ];
end;
%
