function[tp,os,ts]=tposts(t,y)
[mt,nt]=size(t);if(mt<nt),m=mt;mt=nt;nt=m;end
[my,ny]=size(y);if(my<ny),m=my;my=ny;ny=m;end
if(mt~=my),error('Input vectors are not of same size'),end
if(nt~=ny),error('Input vectors are not of same size'),end
if(nt~=1),error('Input vectors are not of proper dimensions'),end
if y(my)<0, y=-y;end
m5pc=ceil(mt/20);
if(m5pc<10),error('not enough data points'),end
for i=1:m5pc
   if(abs(y(mt-i)-y(mt))/y(mt)>= 0.001)
      error('steady state may not have reached')
   end
end
yss=y(mt);
[yp,kp]=max(y);
os=(yp-yss)/yss;
tp=t(kp)
k=mt;
while abs((y(k)-yss)/yss)<= 0.02,
   k=k-1;
end
k=k+1;
ys=y(k);
ts=t(k);