Vectorized Solution of ODEs in Matlab with Control of Residual and Error
Vectorization is very important to the efficiency of computation in the popular problem-solving environment Matlab. Here we develop an explicit Runge–Kutta (7,8) pair of formulas that exploits vectorization. Conventional Runge–Kutta pairs control local error at the end of a step. The new method controls the extended local error at 8 points equally spaced in the span of a step. This is a byproduct of a control of the residual at these points. A new solver based on this pair, odevr7, not only has a very much stronger control of error than the recommended Matlab solver ode45, but on standard sets of test problems, it competes well at modest tolerances and is notably more efficient at stringent tolerances.
KeywordsMatlab Vectorization Ordinary differential equations Initial value problems
Mathematics Subject Classification (2000)65L05 65L20
- 7.Matlab: The MathWorks, Inc., 3 Apple Hill Dr., Natick, MA 01760 Google Scholar
- 15.The MathWorks, Code Vectorization Guide, available at http://www.mathworks.com/support/tech-notes/1100/1109.html
- 16.Verner, J.H.: A ‘most efficient’ Runge-Kutta (13:7,8) pair. Available at http://www.math.sfu.ca/~jverner/