MathGroup Archive 1997

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

Search the Archive

RE: StoppingTest does not work ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg9790] RE: [mg9769] StoppingTest does not work ?
  • From: Jean-Marie THOMAS <jmthomas at cybercable.tm.fr>
  • Date: Fri, 28 Nov 1997 05:35:05 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Your StoppingTest function involves y[t] while you are solving for y.

Please note the function is slightly different from yours:

sol=NDSolve[{y'[t]==y[t],y[0]==1},y,{t,0,2},StoppingTest->y>1.4]
f1=y/.sol[[1,1]]
Plot[f1[t],Evaluate at Flatten[{t,First at First@f1}]]

If you solve for y[t], then your test function is correct: Clear at f1
sol=NDSolve[{y'[t]==y[t],y[0]==1},y[t],{t,0,2},StoppingTest->y[t]>1.4]
f1[t_]=y[t]/.sol[[1,1]]
Plot[f1[t],{t,0,0.5}]

----------------------------------------------- Jean-Marie THOMAS
Conseil et Audit en Ingenierie de Calcul jmthomas at cybercable.tm.fr
+33 (0)3 88 32 93 64
www.cybercable.tm.fr/~jmthomas
=======================

-----Message d'origine-----
De:	Gilles BARBIER [SMTP:Gilles.Barbier at der.edfgdf.fr] Date:	mardi 25
novembre 1997 06:07
A:	mathgroup at smc.vnet.net
Objet:	[mg9769] StoppingTest does not work ?


     Anyone could tell me why :
     
     NDSolve[{y'[t]==1,y[0]==0},{y},{t,0,2},StoppingTest->(y[t]>1)]
     
     does not stop for t=1 (it does not stop at all, in fact).
     Of course, my problem is more complicated, but in all case 
     stoppingTest seems to stop when it wants...
     
     Thanks for quick help, Please !!!
     
     Gilles.



  • Prev by Date: RE: numerical eigenfuncs/values
  • Next by Date: Re: sqrt[x^2]
  • Previous by thread: Re: StoppingTest does not work ?
  • Next by thread: Re[2]: StoppingTest does not work ?