Re: right StoppingTest
- To: mathgroup at smc.vnet.net
- Subject: [mg31710] Re: right StoppingTest
- From: atelesforos at hotmail.com (Orestis Vantzos)
- Date: Wed, 28 Nov 2001 01:29:32 -0500 (EST)
- References: <9tvgln$fql$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
The following code will return a list of the form: {{omax,tmax},{o[t]->-InterpolatingFunction-,...}} where omax is the maximum o and tmax the corresponding t: Module[{oldO = -\[Infinity], oldT, sol}, sol = NDSolve[equs, {o[t], d[t], i[t]}, {t, 0, 10}, StoppingTest :> (If[o < oldO, True, oldO = o; oldT = t; False])]; {{oldO, oldT}, sol}] where equs is your ODE system with NUMERIC values for a and b, plus proper initial conditions (of the form o[0]==..,d[0]==..,i[0]==..). Orestis