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_2.gif]](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
.
Use the tolerances
. Compare
with the analytic or "true value" of the integral.
Example 2. Use
Adaptive Simpson's rule to compute a numerical approximation to the
integral
. Use
the tolerances
. Compare
with the analytic or "true value" of the integral.
Execute the following Mathematica subroutine, which is the "long version" of the subroutine we have been using previously.
![[Graphics:Images/AdaptQuadMod_gr_50.gif]](Images/AdaptQuadMod_gr_50.gif)
Example 3. Use
Adaptive Simpson's rule to compute a numerical approximation to the
integral
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.
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