Numerical Integration Methods and AutoSelect |
There are four numerical integration methods available within the integration
operator. Mathcad attempts to autoselect the most appropriate method from the
following list when the integral is evaluated:
- Romberg: applicable to most integrands, this method uses trapezoidal
approximations over an even number of subintervals, then compares sequential
estimates by summing the areas of the trapezoids. The method terminates when
the four most recent estimates differ by less than the value of the built-in
variable TOL. Because the Romberg integration
method divides the integration interval into four subintervals, then successively
doubles the number of points, it can return incorrect answers for periodic
functions having periods 1/2n times the length
of the interval. To avoid this problem, divide the interval into two uneven
subintervals and integrate over each subinterval separately. Mathcad sets
a limit on the number of times it will iterate this procedure. If the routine
reaches this limit without converging, or if the integrand is singular at
one or both of the endpoints of the interval of integration, then Mathcad
switches to the Singular Endpoint method.
- Adaptive: adaptive quadrature method for functions that change
rapidly over the interval of integration.
- Infinite Limit: appropriate for integrals where one or both of
the limits are infinite. The function being integrated must be real.
- Singular Endpoint: an open-ended Romberg method appropriate for
integrals which have singularities/infinities at one or both limits of integration.
Preliminary estimates to the integral are obtained using the midpoints of
subintervals, so the function is not evaluated at the endpoints a and b. Estimates
are concentrated near the ends of the integration interval, where integrands
that are singular or that have an infinite derivative are likely to be changing
most rapidly. The number of subintervals is tripled at each step. There is
a set limit on the number of iterations through the open-ended Romberg method.
If the routine reaches this limit without returning an answer, the integral
is marked with an error
indicating that it did not converge.
 |
Modifying AutoSelect |
To see which method was chosen, or to override the chosen method:
- Right-click the integral symbol in an evaluated integration. The menu shows AutoSelect with a check next to it, and the chosen
method is indicated with a dot.
- If you wish to override the chosen method, click on another method in the list.
- Click outside the integration expression in your worksheet.
The integral is reevaluated using the method you selected and is evaluated
that way until you specify another method or choose AutoSelect again.
Notes:
-
Decreasing TOL may improve your results, but
at some point will make the integral fail to converge. A good working range
is 10-4 to 10-6.
-
Setting large-valued endpoints to infinity and using the infinite endpoint
algorithm may yield better answers.
-
Sharply peaked integrands, or functions whose shape is not readily characterized
by a single length scale, do not evaluate accurately. This is the nature
of numerical integration. Accurate results may be obtained by breaking an
integral into pieces and separately integrating around the peak and away
from the peak.
-
Mathcad generally cannot integrate functions that have singularities
on the interval of integration. Functions such as step and sawtooth functions
with many finite discontinuities may also lead to nonconverging integrals.
If you know the location of singularities in the integrand, you can often
obtain a correct numerical evaluation by splitting the integral into a sum
of integrals with these points as limits. A plot
of the integrand may help to indicate trouble spots.