Numerical Integration Methods
There are four numerical integration methods available within the integration operator. PTC Mathcad attempts to select 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. PTC 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 PTC 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 is infinite. The function being integrated must be real.
• Singular Endpoint: an open-ended Romberg method appropriate for integrals which have singularities or 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.
Additional Information
When an integral is evaluated numerically, PTC Mathcad uses an adaptive quadrature method. You may want to change TOL, the endpoints, or the integrand to improve your results:
• Decreasing TOL may improve your results, but at some point the integral fails 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. You may obtain better results by breaking an integral into pieces and separately integrating the peak from the rest of the plot.
• PTC Mathcad generally cannot integrate functions that have singularities in 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. To find potential singularities or discontinuities, plot the integrand.
• Applying the adaptive method to an improper integral will likely produce an incorrectnumerical result. The Adaptive Integration algorithm requires the function to be approximated by a polynomial in each subinterval division so the Gauss-Quadrature method can be used. Failing to meet the continuity requirement on the integrand can lead to inaccurate results or failure to converge.