Method of lines with e.g ode15s versus time stepping in c++

1 view (last 30 days)
Hello,
the last months i spent some of my time learning a lot about numerical methods for PDE`s. The outcome is an implenentation of a nonlinear model (phenomenological sedimentation and filtration model) with the method of lines using a numerical flux and flux limiter.
at every function call i have to calculate the numerical flux and diffusion term with external (explicit) functions.
i use ode23 and ode15s for the integration
explicit time stepping equations for the interior scheme and the boundary conditions have been published.
Since the implementation is quite slow (depending on size and accuracy 15 - 100 seconds on a standard PC) i would like to speed it up. I do not use loops and tried to vectorize as much as possible. Still there is room left for optimiziation. I guess 20 - 30 %.
Would it be worth a try to convert it to c++ and use a simple loop over space and time, since the explicit functions are already been published ?
Bying the Matlab Compiler or coding it by hand ? I never used C++.
Or would you try to linearise the explicit equations through taylor approximation and code it as a matrix system ?
Best Wishes
Moritz
  2 Comments
Moritz
Moritz on 14 Aug 2013
Nothing ?
I could break it down to this question:
I do not use loops in my method. I calculate functions only once at each call and interpolate with my new solution. Sol interpolation and the ode solvers take most of the time.
Does it make sense to think about moving to c++. I would use the book "numerical receipies in c++" from cambridge university press.
Moritz
Moritz on 14 Aug 2013
and i mostly use build in functions like int inerp1q and the odesolvers

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!