MathGroup Archive 2004

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

Search the Archive

Re: Re: Garbage collection problem

I stand corrected. A stopping test is a good idea in this application.


On Fri, 5 Nov 2004 02:20:04 -0500 (EST), D Herring <dherring at> wrote:

>> That's an odd bug; but I kind of doubt StoppingTest is working well for you ANYWAY.
> I don't know what you mean by that...  StoppingTest is a bit awkward to
> work with, but I've found ways to manage, and its performing beautifully
> - if you can ignore the memory leak.
> Essentially, I have a dynamical system that regularly impacts with a
> rigid surface.  By setting the StoppingTest to halt NDSolve shortly
> *after* the impact has occurred, I can save a lot of simulation time,
> and it makes it easier to find the exact impact point.
> I'm essentially doing the following:
> (* Expect impact around 0.5; but can happen after 2 *)
> soln=NDSolve[eqn, vars, {t, 0, 3}, StoppingTest->test];
> (* Detect where NDSolve stopped *)
> tau=(vars[[1]]/.soln)[[0, 1, 1, 2]]
> (* Find the exact surface intersection *)
> tImpact=FindRoot[surface/.soln, {t, tau}];
> Because of the highly nonlinear behavior of my system, FindRoot won't
> converge unless I give it a reasonably good estimate of the intersection
> time.  StoppingTest gives me that and stops NDSolve as soon as possible.
> If you have any better ideas, I'm all ears.
> Thanks,
> Daniel

DrBob at

  • Prev by Date: need help with integration
  • Next by Date: Re: Re: Counting Runs
  • Previous by thread: Re: Garbage collection problem
  • Next by thread: Re: Garbage collection problem