MathGroup Archive 2000

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

Search the Archive

Re: final timestep using StoppingTest


Hi,

with

sol = NDSolve[{x''[t] == -x[t], x[0] == 1, x'[0] == 0}, x[t], {t, 0,
2Pi}, 
    StoppingTest -> x[t] < 0]

Head[First[x[t] /. sol]][[1]]

I got

{{0., 1.68799}}

is this OK for you ?

You can get all time values by

Head[First[x[t] /. sol]][[3]]

Regards
  Jens

Michael Gilchrist wrote:
> 
> Hi,
> 
> I am using NDSolve with StoppingTest to stop NDSolve when the
> solutions become trivial.  I have, however, a problem.  I want to
> know at what value of the independent variable (e.g. t) that the
> StoppingTest evaluates True and exits NDSolve.  I am getting very
> frustrated.  I try pull this info from the InterpolatingFunction, but
> it won't allow me to extract the part of the answer with the bounds
> of the independent variable.


  • Prev by Date: Re: More about l`Hopital`s rule
  • Next by Date: Re: Windows 9X or Linux?
  • Previous by thread: final timestep using StoppingTest
  • Next by thread: controlling evaluation