Question: How to use events command in dsolve/numeric for different points of independent variable?

My problem is How to use events command in dsolve/numeric for different points of independent variable?                                     A simple example:

de:=diff(x(t),t)=-x(t);

ds:=dsolve({de,x(0)=1}, numeric, method = rkf45,abserr=1E-12,relerr=1E-11,events =[[x(t)-1E-8,halt]]);

works perfectly, but I need to compare x(t) and x(t-h) in two consecutive points during the calculations of dsolve and to stop when the difference between them is smaller than some epsilon: abs( x(t)- x(t-h) )< epsilon. Here h is the step used by dsolve during the curent calculation and epsilon is some given external smal number, say epsilon =1E-10.

Please Wait...