MathGroup Archive 2007

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

Search the Archive

Re: setting variables from within NDSolve

  • To: mathgroup at
  • Subject: [mg73974] Re: setting variables from within NDSolve
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at>
  • Date: Sat, 3 Mar 2007 23:53:49 -0500 (EST)
  • Organization: The Open University, Milton Keynes, UK
  • References: <epv35f$8dc$>

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"


  • Prev by Date: Re: fastest way to add up a billion numbers
  • Next by Date: Re: Conversion to html problems
  • Previous by thread: Re: Rigid body equations
  • Next by thread: accessing a kernel on a network