Numerical integration techniques
- Getting started
- Review: Use EXCEL to obtain estimate for the
definite integral of exp(-x^2) for x from 0 to 1.
- Issues: How to choose Delta_x, left or right sums,
how good is the result?
- Add another objective: Want to have estimate to be
guaranteed within 0.000 01 of the exact value.
-
Data collection
- Each team calculates estimates with the assigned
number of subdivisions. Report results to the
instructor's machine (don't truncate decimals,
want all decimals ...)
- You may want to do a sample calculation in EXCEL,
but do the real calculation in MATLAB.
The main step is to assign names like
n=100, b=1, a=0, dx=(b-a)/n, xxx=[a:dx:b]
and to do good book-keeping.
ALWAYS TEST YOUR IMPLEMENTATION WITH SMALL
DATA SETS, e.g. first try out n=5, before
trying n=10000.
- As data emerge on the front screen begin to
put your observations into precise statements.
Write these down!
- If time permits start a second example, f(x)=sin(x)/x
when x is not zero and f(0)=0, integrated from 0 to pi.
- Data analysis, part 1
- Observations in teams -- look at many different
aspects: upper and lower bounds, increasing and
decreasing, how fast do the estimates approach
the limit(s). Formulate precise statements, and
write these down.
- Explanations: Why does which technique provide
lower/upper estimates; why do the estimates obatined
by the respective techniques increase/decrease as
the number n of subdivisions grows. Are these
mere coincidences, or are there reasons.
WRITE down detailed explanations....
- Whole class: Summarize findings.
- Using a weighted average to get even better results!....
- Data analysis, part 2
- Convergence rates.
Observations.
- Convergence rates of left and right sums:
In teams: explanation why.... assuming that
the function is differentiable, .... draw
pictures, identify where to "see" the errors....
WRITE out your explanations in full sentences!
Summary in the whole class.
- If time allows and interest is there:
Richardson extrapolation....
Related resources:
- The program "INTEGRAL" of the Arizona Mathematical Software
is probably the fastest way to generate data like the ones
for the above table (but we wanted to practice using MATLAB,
the true professional engineering software).
(In the lab, go to \LAB\APPS\AZMATH, alternatively
download the small package directly from UA Tucson.)
- In MAPLE, load the student package
(with(student);),
and use funcitons like leftbox, rightsum etc.
These are very useful if you need neat graphics
for a written report.