Re: StoppingTest option for NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg35057] Re: StoppingTest option for NDSolve
- From: Peter Pein <petsie at arcor.de>
- Date: Thu, 20 Jun 2002 23:55:05 -0400 (EDT)
- Organization: Arcor
- References: <aepkmo$s04$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
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