MathGroup Archive 2002

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

Search the Archive

Re: StoppingTest option for NDSolve

  • To: mathgroup at
  • Subject: [mg35057] Re: StoppingTest option for NDSolve
  • From: Peter Pein <petsie at>
  • Date: Thu, 20 Jun 2002 23:55:05 -0400 (EDT)
  • Organization: Arcor
  • References: <aepkmo$s04$>
  • Sender: owner-wri-mathgroup at

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
sol = NDSolve[{y[0] == 1, y'[x] == y[x]}, y[x], {x, 0, 2},
     StoppingTest -> y[x] >= 2.718]
{{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).


  • 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