Re: setting variables from within NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg73974] Re: setting variables from within NDSolve
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sat, 3 Mar 2007 23:53:49 -0500 (EST)
- Organization: The Open University, Milton Keynes, UK
- References: <epv35f$8dc$1@smc.vnet.net>
dantimatter wrote:
> hello all,
>
> i have an equation that i'm trying to incorporate into NDSolve. it's
> a piecewise function:
>
> D[foo[t], t] == Piecewise[{{slope,
> foo[t] < max && (foo[t] > min || bar[t] < threshold)}}, -foo[t-t0]]
>
> the problem is that i want to set t0 at the time that the condition
> changes from true to false. is there a way that i can set this
> variable from within NDSolve on the condition change only, and not
> while the system remains in the true or false state?
>
> thanks,
> dan
>
*EvenLocator* might do what you are looking for: "It is often useful to
be able to detect and precisely locate a change in a differential
system. For example, with the detection of a singularity or state
change, the appropriate action can be taken, such as restarting the
integration." See
"Built-in Functions / Advanced Documentation / Differential Equations /
NDSolve / ODE Integration Methods / Controller methods / EventLocator"
http://documents.wolfram.com/mathematica/Built-inFunctions/AdvancedDocumentation/DifferentialEquations/NDSolve/ODEIntegrationMethods/ControllerMethods/EventLocation.html
HTH,
Jean-Marc