Is there an real efficient ODE system solvers?
2 views (last 30 days)
Show older comments
Hello,
my task considered with numeric solution of large ODE systems, i.e. method of lines, where typical ODE system consists of 300 and more equations that tends to be stiff. As far as I know, in Matlab ODE all solvers are not adopted for multicore. But for such ODE numbers they work really slow. What shall I do to increase the speed of my programs while using ODE15S or ODE45?
Kind regards, Vasily.
0 Comments
Accepted Answer
Jan
on 7 Jan 2013
A stiff system should be solved by ODE15s.
Actually a parallelization should be easy, when the several function evaluations are independent from eachother. But even then Matlab integrators will not be really fast automatically. A comparison with equivalent C-ODE45 have been depressing. But when the system is large (and 300 is at least a little bit large), the overhead of the integrator should be negligible, while the function to be integrated gets more important. Could you post it, such that we can find redundant code or detect problems like discontinuities.
In every case, there is no magic flag, which allows to set a clandestine after burner on fire to accelerate the ODE solvers.
2 Comments
Jan
on 8 Jan 2013
If a large scale problem, e.g. with 100'000 variables, use linear algebra methods, the underlying BLAS functions call multiple cores already, such that an additional parallelization is not useful. But for small problems a parallelization should be (better) supported.
More Answers (1)
Daniel
on 9 Jan 2013
Vasily, the problem is not that the "stiff" solver is performing poorly in comparison with RK-45, it is that your C compiler optimizes the code to run more efficiently on your computer, whereas since Matlab is interpreted (and not compiled), it can receive no such optimizations. Since the dominant cost in using Matlab's ODE solvers comes from evaluations of your f(t,y) function (that likely doesn't use BLAS), there's little you can do to speed up any Matlab version of your code. In short, the problem is not the ODE solver algorithm, the problem is the computing system.
The fastest approach (and a true apples-to-apples comparison of stiff vs nonstiff solvers) would be to call a stiff ODE solver written in C, such CVODE, and compare that against your C implementation of RK-45.
0 Comments
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!