Code covered by the BSD License  

Highlights from
RKN1210 - A 12th/10th order Runge-Kutta-Nystrom integrator

4.0

4.0 | 1 rating Rate this file 45 Downloads (last 30 days) File Size: 131 KB File ID: #25291
image thumbnail

RKN1210 - A 12th/10th order Runge-Kutta-Nystrom integrator

by Rody Oldenhuis

 

11 Sep 2009 (Updated 11 Jun 2013)

Integrator for second-order ODE's with very stringent error tolerances.

| Watch this File

File Information
Description

RKN1210 12th/10th order Runge-Kutta-Nystrom integrator

RKN1210() is a 12th/10th order numerical integrator for ordinary differential equations of the form

  y'' = f(t, y) (1)

with initial conditions

  y(t0) = y0, y'(t0) = yp0 (2)

This second-order differential equation is integrated with a
Runge-Kutta-Nystrom method, with 17 function evaluations per step. The RKN-class of integrators is especially suited for this purpose, since compared to a classic Runge-Kutta integration scheme the same accuracy can be obtained with less function evaluations.

This RKN12(10) method is a very high-order method, to be used in problems with *extremely* stringent error tolerances. In verious studies, it has been shown that this particular integration technique is overall more efficient for ODE's of the form (1) than multi-step or extrapolation methods that give the same accuracy.

RKN1210's behavior is very similar MATLAB's ODE-integrator suite; you can set options via ODESET, and input and output values are also practically the same.

Both output functions and event functions are fully supported.

The construction of RKN12(10) is described in
High-Order Embedded Runge-Kutta-Nystrom Formulae
J. R. DORMAND, M. E. A. EL-MIKKAWY, AND P. J. PRINCE
IMA Journal of Numerical Analysis (1987) 7, 423-430

Coefficients obtained from
http://www.tampa.phys.ucl.ac.uk/rmat/test/rknint.f
These are also available in any format on request to these authors.

Acknowledgements

Rkn86 and Ode86 inspired this file.

MATLAB release MATLAB 7.11 (R2010b)
Other requirements ODE suite, for ODESET() and ODEGET() (standard MATLAB) Replace the tildes with dummy variables if you get errors (R2008b and earlier)
Tags for This File  
Everyone's Tags
accuracy(2), highorder, integration, mathematics, methematics, numerical integration, ode, precision, rungekuttanystrom, secondorder ode
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
18 Mar 2012 Rody Oldenhuis

@Tarek: thank you for the heads up, it has been corrected and a fixed version will be up as soon as they've approved it!

14 Mar 2012 Tarek

There seems to be a bug when using tspan as a vector to display results at certain time steps. An error message is generated for the index of tout as
Undefined function or variable "index".

Error in ==> rkn1210>finalize at 768
tout = tout (1:index,:);

The codes works fine with specifying tspan as [t0 tf]

Updates
14 Jan 2010

- Interactive demonstration included
- implemented support for event functions
  and output functions
- corrected various bugs, most notably the
  (incorrectly) flipped output when tspan(2) < tspan(1)
- improved error handling

28 Oct 2010

- Fixed 2 bugs: 1) exitflag = 3 was never assigned or described in the argument [output] 2) intermediate results were erased by event functions and only the event's zero was returned
- Improved performance a bit by pre-assigning the output arrays

19 Feb 2011

- Removed bug inherited from RKN86; the error estimates there were all wrong. Now RKN1210 integrates at least 50x faster!
- Updated demo; included Earth+J2 example.

18 Mar 2012

bugfix for missing "index" variable on numel(tspan)>2 as noted by Tarek

11 Jun 2013

Improvements regarding performance and memory usage.

Contact us