Let there be the following NDSolve
code:
s = NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 30}]
I think it may be a usefull idea to use as a constistency check the "reverse" NDSolve i.e. define
fy[x_]:=First[Evaluate[y[x]/.s]
then integrate backwords
revs = NDSolve[{ry'[x] == ry[x] Cos[x + ry[x]], ry[30] ==fy[30] }, ry, {x, 30, 0}]
and finally check whether one is back at the initial point
revfy[x_]:=First[Evaluate[ry[x]/.revs]
error=Abs[revf[0]-1]/1
However this is a time consuming approach.
Can NDSolve
do this automatically (integrate from 0 to 30 and then backwords form 30 to 0)? Is there an equivalent error estimate?