function ret = damped(steps, ftime)

% Determine value of 
% dv/dt = - sign(v) |v|^(1/4), v(0) = 1
% with a step size of 1/steps, until time ftime.

stepsize = 1/steps;

t = 0;

yn = 1;
foo = [yn];
while (t < ftime)
	yn1 = yn + stepsize * (-1) * sign(yn) * abs(yn)^(1/4);
	t = t + stepsize;
	yn = yn1;
	foo = [foo yn];
end

ret = yn;


% 0   1 0
% 1   2 0.15726    6.35
% 2   4 0.06250   16
% 3   8 0.02480   40.32
% 4  16 0.00984  101.59 
% 5  32 0.00390  
% 6  64 0.00155  645.08
% 7 128 0.00006 1625.50

% So each pwer of 2 causes a change by 16^(1/3).

% 0.15726...

% 0.15726... / (16^(1/3))^(log_2(1/h)-1)

%     3 0.09172
