MCS 471 Computer Problem 3: Numerical Integration using Maple/Octave
Due: Monday 28 April 1997
Background Reading: Gerald and Wheatley, Chapter 4
Topics
- 4.4 Extrapolation Techniques
- 4.5 Newton-Cotes Integration Rules
- 4.6 Trapezoidal Rule
- 4.7 Simpson's Rule
- 4.9 Gaussian Quadrature
Maple/Octave Computer Problem:
You can use either
Maple and/or Octave for this assignment.
You must hand in a Maple and/or Octave worksheet(s) that is (are)
well documented with comments and plots of integrand functions.
Refer to the Class Maple and/or Octave Pages, or in particular to the
or
See also the main class Maple and Octave pages for more help.
Find integrals by the following three (3) methods
A.) Built-in Maple or Octave built-in integration function;
B.) Maple's "with(student);" trapezoid function
with 20 subdivisions (21 points or nodes) each
(Octave does not have built-in Trapezoidal Rule, so it has to be
coded by hand);
C.) Maple's "with(student);" Simpson's function
with 20 subdivisions (21 points or nodes) each;
(Octave does not have built-in Simpson's Rule, so it has to be
coded by hand);
of the following three (3) functions:
- f1(x) = 7*x^6 - 4*x^3 on (1,2).
Remark 1: This is a test function that can easily be integrated exactly
as a check to your methods.
Remark 2: Give the exact answer in your documentary comments.
- f2(x) = {2*sqrt(1+x^2) if x > 0, else (2+6*x^5)} on (-2.,+2.).
Remark 1: This is a nonsmooth example with piecewise definition.
Remark 2: For Maple, use the Maple function "piecewise" given in the above
Class Maple integration page, since if-then-else or procedure constructs lead
to mysterious Maple errors. Octave should be OK.
- f3(x) = {exp(-x^4)/sqrt(x) if x > 0.25, else 13.767-47.1*x}
on (0,5).
Remark 1: This is a nonsmooth nearly singular example with piecewise
definition.
Remark 2: For Maple, use the Maple function "piecewise" given in the above
Class Maple integration page, since if-then-else or procedure constructs lead
to mysterious Maple errors. Also, Maple "piecewise" works better, if at all,
with the nearly singular part in the "FunctionIfTrue" argument, rather than
the "FunctionElse" argument. Octave should be OK.
Caution: There are three (3) methods for three (3) problems
making nine (9) items total.
Web Source: http://www.math.uic.edu/~hanson/M471/mcs471cp3.html
Email Comments or Questions to Professor Hanson
Click Here For Class HomePage