NDSolve profiling
- To: mathgroup at smc.vnet.net
- Subject: [mg126957] NDSolve profiling
- From: Ben <Benjamin.R.Lewis at gmail.com>
- Date: Wed, 20 Jun 2012 03:50:38 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
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? Thanks, Ben