Clear Filters
Clear Filters

Is there an real efficient ODE system solvers?

3 views (last 30 days)
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.

Accepted Answer

Jan
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
Vasily Kozhevnikov
Vasily Kozhevnikov on 8 Jan 2013
Yes, I solve my system of 200 ODES with ODE15S in matlab, and it takes much more time to execute than RKF45 solver in dummy C program. So it grieves me so much =) Stiff solver gives no visible advantage in efficiency. As I remember Runge-Kutta methods may be parallelized. I wounder why MATLAB solvers doesn't support parallel RK for large-scale problems.
Jan
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.

Sign in to comment.

More Answers (1)

Daniel
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.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!