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

Richardson Extrapolation

by Rhys

 

09 Jun 2009 (Updated 09 Jun 2009)

Code covered by the BSD License  

A generalized Richardson extrapolation routine with many bells and whistles.

Download Now | 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)
Zip File Content  
Other Files license.txt,
richardson.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
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
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com