Code covered by the BSD License  

Highlights from
Richardson Extrapolation

Be the first to rate this file! 21 Downloads (last 30 days) File Size: 2.89 KB File ID: #24388

Richardson Extrapolation

by Rhys

 

09 Jun 2009 (Updated 09 Jun 2009)

A generalized Richardson extrapolation routine with many bells and whistles.

| Watch this File

File Information
Description

A generalized Richardson extrapolation routine that can perform multiple extrapolation steps, can accommodate arbitrary leading error terms, can handle any uniform refinement scheme (e.g. h/2, h/3, h/5, etc), and can report a full extrapolation table including comparing against a known good solution. Able to handle vector inputs. Compatible both with MATLAB and Octave. Includes Octave-style unit tests.

A contrived usage example:

Suppose your sequence of approximations was [1, 2, 3, 4] where each successive value refined the grid by a factor of 3. Suppose the three leading error terms in the approximation were O(h^2), O(h^4), and O(h^5) and that you knew the exact value was 4.14. Then you'd invoke

octave:78> [result, normtable] = richardson([1,2,3,4],[2,4,5], 3, 4.14)
result = 4.14163223140496
normtable =

   3.13999999999999968 NaN NaN NaN
   2.13999999999999968 2.01499999999999968 NaN NaN
   1.13999999999999968 1.01499999999999968 1.00249999999999950 NaN
   0.13999999999999968 0.01499999999999968 0.00249999999999950 0.00163223140495905

which shows you the exact result and a full extrapolation table showing the l2 error at each substep.

For more normal examples with h/2 refinement, more standard leading error terms (e.g. starting at h^2 and increasing by h or h^2), and unknown exact solutions the function has much default magic to simplify input parameters.

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
20 Jun 2011 Rhys

Note for Octave users-- it appears that http://octave.1599824.n4.nabble.com/error-nargchk-2-3-2-returns-an-error-tt1673066.html will impact the line 'error(nargchk(1,4,nargin));'

Please login to add a comment or rating.
Updates
09 Jun 2009

Fixed a typo or two in the text. No code change.

Tag Activity for this File
Tag Applied By Date/Time
taylor Rhys 09 Jun 2009 16:21:42
approximation Rhys 09 Jun 2009 16:22:04
extrapolation Rhys 09 Jun 2009 16:22:04
richardson Rhys 09 Jun 2009 16:22:04
estimation Rhys 09 Jun 2009 16:22:04
polynomial Rhys 09 Jun 2009 16:22:04

Contact us at files@mathworks.com