MathGroup Archive 2012

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

Search the Archive

NDSolve profiling

  • To: mathgroup at
  • Subject: [mg126957] NDSolve profiling
  • From: Ben <Benjamin.R.Lewis at>
  • Date: Wed, 20 Jun 2012 03:50:38 -0400 (EDT)
  • Delivered-to:

Are there any tricks to profiling/optimising NDSolve?

A computationally expensive subexpression (involving ProductLog) is repeated many times in my ODE, so I'd like to check whether it is only computed once per evaluation point (and would also like to try other possible optimisations like using compile unless that is already redundant).

My ODE has multiple coupled-components so I've also experimented with converting it into vector form. With simpler ODEs I've found this has facilitated using compiled functions in NDSolve (and gave an overall speed boost), but with my current ODE I find that the vector form causes failure. I'm wondering whether switching from a coupled set of equations to vector form of the identical ODE/IVP may cause the algorithm pick a different step sequences, or may be more likely to produce catastrophic-cancellation inaccuracies?

Can anybody share relevant insight into the evaluation that goes on behind the scenes of ndsolve's equation-processing and iteration, and how to debug or ways to optimise it for speed?


  • Prev by Date: Re: Parenthesis reduction
  • Next by Date: plot legend with filling
  • Previous by thread: Re: Moment function
  • Next by thread: Re: NDSolve profiling