Re: Options to exit NDSOLVE?
- To: mathgroup at smc.vnet.net
- Subject: [mg13986] Re: [mg13948] Options to exit NDSOLVE?
- From: Jurgen Tischer <jtischer at col2.telecom.com.co>
- Date: Sat, 12 Sep 1998 16:59:11 -0400
- References: <199809111906.PAA23122@smc.vnet.net.>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Robin,
there is a not too well documented option StoppingTest for NDSolve (try
?StoppingTest) which could be helpful. The only way I found to use it
is like in
the following example:
NDSolve[{y'[t]==-y[t],y[0]==1},y,{t,0,5},StoppingTest->(y[t]<0.5)]
This will stop integration at t==0.71712 and of course the
InterpolatingFunction
shows this as the upper limit of it's interval.
Jurgen
Robin Redfield wrote:
> >
> >
> > Is it possible to get NDSOLVE to exit before the independent variable
> > reaches its range? I would like to exit the numerical integration routine
> > based on monitored conditions in the simulation. I would also like to
> know
> > the value of some of my variables at exit.
> >
> > For example, I am modeling the vertical motion of a water rocket and would
> > like to stop the simulation when the water is dispelled from the rocket,
> not
> > necessarily at some particular value of the independent variable (time).
> >
> > Thanks for any help,
> >
> > Rob Redfield
> > Associate Professor
> > Engineering Mechanics
> > US Air Force Academy
- References:
- Options to exit NDSOLVE?
- From: "Robin Redfield" <RedfieldRC.Dfem@usafa.af.mil>
- Options to exit NDSOLVE?