Re: StoppingTest does not work ?
- To: mathgroup at smc.vnet.net
- Subject: [mg9825] Re: [mg9769] StoppingTest does not work ?
- From: Wouter Meeussen <vdmcc at vandemoortele.be>
- Date: Fri, 28 Nov 1997 05:35:39 -0500
- Sender: owner-wri-mathgroup at wolfram.com
Cher Gilles, the following works: In[30]:=sol1=NDSolve[{y'[t]==y[t],y[0]==1},{y},{t,0,2}] Out[30]={{y -> InterpolatingFunction[{{0., 2.}}, <>]}} In[33]:=sol2=NDSolve[{y'[t]==y[t],y[0]==1},{y},{t,0,2},StoppingTest->(y[t]>3)] Out[33]={{y -> InterpolatingFunction[{{0., 1.0988}}, <>]}} In[32]:=y[1]/.sol1 Out[32]={2.71829} In[40]:=y[1.0988]/.sol2 Out[40]={3.00057} in for a picture ? In[39]:=Plot[{y[x]/.sol1,y[x]/.sol2},{x,0,1.5},PlotStyle->{{Hue[0]},{Hue[.7]}}]; InterpolatingFunction::dmval: Input value {1.12545} lies outside the range of data in the interpolating function. Extrapolation will be used. -- nice plot -- I guess your example {y'[t]==1,y[0]==0} is partly "bonkers" (?) it should come out y->t of course. A propos: Options[NDSolve] lists "StoppingTest", neither the manual nor online help do! according to standard notation, a "test" should be a (pure) function of the thing to be tested, like (y[#]>1&), but it does not seem to be so in this case. hmmm, strange. wouter. At 12:07 25.11.97 -0500, Gilles BARBIER wrote: > > 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. > NV Vandemoortele Coordination Center Oils & Fats Applied Research Prins Albertlaan 79 Postbus 40 B-8870 Izegem (Belgium) Tel: +/32/51/33 21 11 Fax: +/32/51/33 21 75 vdmcc at vandemoortele.be