Re: NDSolve does not let me to stop
- To: mathgroup at smc.vnet.net
- Subject: [mg30088] Re: NDSolve does not let me to stop
- From: "W. H. Harker" <wharke at sprynet.com>
- Date: Fri, 27 Jul 2001 03:52:23 -0400 (EDT)
- References: <9joa08$18d$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <9joa08$18d$1 at smc.vnet.net>, borut at email.si says... > Hi, > > You say Mathematica can do wonders, but I just can't figure this one out. > > I'm solving ODE for r[t] = {x[t],y[t]}. Is there a way to stop NDSolve from > going on, when {x[t],y[t]} fullfills a particular constrain (e.g. > Sqrt[x[t1]^2 + y[t1]^2] > 2) and get Interpolating Function object from 0 to > t1? > > If ain't possible this way, how would you solve the problem (with > Mathematica build-in solvers)? It's essentially a very simple > 'one-step-at-a-time' problem (e.g. Rungee Kutta), where you can check on > variables of integration after any time. > > It seems to me, you can check on variables in NDSolve[eqs, {t,tmin,tmax}] > only at tmin and tmax. > > Well? > > > Thanks for your time, > > Borut Levart > > > > The option StoppingTest->(a condition on x and y) almost does the job (it overshoots a bit).