MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: StoppingTest option for NDSolve


Randall Beer wrote:
> Does anyone know how to use the StoppingTest option for NDSolve?  This 
> option doesn't seem to be documented, but shows up in Options[NDSolve].
> 
> I need to terminate a numerical integration when given state variables 
> go out of a specified region, and I was hoping that I could do this by 
> defining a stopping test.
> 
> Thanks,
> Randy
> 

Hi Randy,
Try ??StoppingTest in Mathematica-Frontend
Here is a toy-example
In[2]:=
sol = NDSolve[{y[0] == 1, y'[x] == y[x]}, y[x], {x, 0, 2},
     StoppingTest -> y[x] >= 2.718]
Out[2]=
{{y[x] -> InterpolatingFunction[{{0., 1.0988}}, "<>"][x]}}

Iteration stopped before x==2. I guess the StepSize is too large to stop at 
Log[2.718] (0.999896).

       Peter



  • Prev by Date: RE: Table as Graphics Object?
  • Next by Date: Colors
  • Previous by thread: RE: StoppingTest option for NDSolve
  • Next by thread: machine-size real number