Module for the Adaptive Simpson's Rule

Check out the new Numerical Analysis Projects page.


    The adaptive Simpson's rule for quadrature uses the two subroutines "Simpson" and "Adapt."  The program is "recursive".  There is no brake available if something goes wrong, i.e. if a pathological "bad" function is thrown it's way it may proceed on a slippery path of infinite recursion.

Mathematica Subroutines (Adaptive Simpson's Rule).

[Graphics:Images/AdaptQuadMod_gr_1.gif]
[Graphics:Images/AdaptQuadMod_gr_2.gif]

Animations (Adaptive Simpson's Rule  Adaptive Simpson's Rule).  Internet hyperlinks to animations.

 

Example 1.  Use Adaptive Simpson's rule to compute a numerical approximation to the integral  [Graphics:Images/AdaptQuadMod_gr_3.gif].  
Use the tolerances [Graphics:Images/AdaptQuadMod_gr_4.gif].  Compare with the analytic or "true value" of the integral.

Solution 1.

 

Example 2.  Use Adaptive Simpson's rule to compute a numerical approximation to the integral  [Graphics:Images/AdaptQuadMod_gr_27.gif].  Use the tolerances [Graphics:Images/AdaptQuadMod_gr_28.gif].  Compare with the analytic or "true value" of the integral.

Solution 2.

 

Execute the following Mathematica subroutine, which is the "long version" of the subroutine we have been using previously.

 

[Graphics:Images/AdaptQuadMod_gr_50.gif]

Example 3.  Use Adaptive Simpson's rule to compute a numerical approximation to the integral  [Graphics:Images/AdaptQuadMod_gr_51.gif]  that we investigated in example 1.  
The long solution is obtained if you add a print statement to investigate the in between computations.  
This subroutine is pedagogical and is intended to help us understand what's happening in a recursive program.
You would probably not want to always print out the in between steps, so you might want to re-execute the first version for some of your work.

Solution 3.

 

Research Experience for Undergraduates

Adaptive Simpson's Rule  Adaptive Simpson's Rule  

Internet hyperlinks to web sites and a bibliography of articles.  

  

Downloads (Adaptive Simpson's Rule Adaptive Simpson's Rule).  

Download this Mathematica notebook.  

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2003