Extreme Optimization > User's Guide > Mathematics Library > Numerical Integration and Differentiation > The NumericalIntegrator Class

Extreme Optimization User's Guide

User's Guide

Up: Numerical Integration and Differentiation Next: Fixed Interval Methods Previous: Numerical Integration and Differentiation Contents

Overview of Numerical Integration

The NumericalIntegrator Class

The NumericalIntegrator class is the abstract base class for all numerical integration classes. It inherits from IterativeAlgorithm. The AbsoluteTolerance and RelativeTolerance properties set the desired precision as specified by the ConvergenceCriterion property. The default value for both tolerances is MachineConstants.SqrtEpsilon (roughly 10-8). MaxIterations sets the maximum number of iterations. The default value for this property depends on the algorithm used. IterationsNeeded returns the actual number of iterations performed after the algorithm has completed.

Specific to this class are the Order and FunctionEvaluationsNeeded properties, and the overloaded Integrate method.

The Order property gives the order of the integration algorithm. The order of an integration algorithm is the highest degree of a general polynomial whose integral is calculated exactly by the algorithm. A method of order three integrates cubic polynomials exactly. Many methods have a fixed order. For some algorithms, the order depends on the input values.

The FunctionEvaluationsNeeded property returns the total number of times the target function was evaluated while approximating the integral. This property is a more reliable indication of the efficiency of an algorithm than IterationsNeeded. For some algorithms, the number of function evaluations grows exponentially with each iteration, while for others it is a simple multiple. Even though higher order methods are slower, they usually require less subdivisions of the integration interval, which makes them more desirable for smooth target functions. For target functions with integrable singularities, a low order method is usually preferred.

The Integrate method does the actual work of numerically integrating a target function. It has three overloads. With no parameters, the method uses the values supplied through the Integrand, LowerBound, and UpperBound properties.

The remaining two overloads take two or three parameters. The first parameter, if present, is a RealFunction delegate that specifies the target function. The remaining two parameters are Double values that specify the lower and upper bounds of the integration interval.

Code examples are given in later sections.

Result codes

The Integrate method always returns the best estimate for the integral. Successive calls to the Result property will also return this value, until the next call to Integrate.

If the ThrowExceptionOnFailure property is set to true, an exception is thrown if the algorithm has failed to obtain the integral with the desired accuracy. If false, the Integrate method returns the best approximation to the integral, regardless of whether it is within the requested tolerance.

The Status property indicates how the algorithm terminated. Its possible values and their meaning are listed below.

Value Description
NoResult The algorithm has not been executed.
Normal The algorithm ended normally. The desired accuracy has been achieved.
IterationLimitExceeded The number of iterations needed to achieve the desired accuracy is greater than MaxIterations.
RoundOffError Round-off prevented the algorithm from achieving the desired accuracy.
BadFunction Bad behavior of the target function prevented the algorithm from achieving the desired accuracy.

Divergent

The integral appears to divirge.

Up: Numerical Integration and Differentiation Next: Fixed Interval Methods Previous: Numerical Integration and Differentiation Contents

Overview
Introduction
Features
Documentation
QuickStart Samples
Sample Applications
Downloads
Get it now!
Download trial version
How to Buy
Information
Resources
Contact Us
Search

"The Extreme Optimization Statistics Library for .NET is a major boon for those doing statistical work in .NET. I strongly recommend this product."
- Marc Brooks

"I have made it my mission to institutionalize the value of good API design.  I strongly believe that this is key to making developers more productive and happy on our platform. It is clear that you value good API design in your work, and take to heart developer productivity and synergy with the .NET framework."
- Brad Abrams,
Lead Program Manager, Microsoft.

This is a partial list of companies who are using our libraries:
ABB Robotics
Allstate
Applied Materials
Arcam
Astra Schedule
Babson College
Canadian Council on Learning
Canyon Associates
Caxton Associates
CECity
Constellation Energy
CreditSights
DeepOcean
Duke University
Dynamotive
Elecsoft
Engelhard Corporation
Epcor
Equipoise Software
Galileo International
GAM UK
Gammex
GlaxoSmithKline
Global Matrix
The Hartford
Infinera Corporation
Intel
JDS Uniphase
LaBranche & Co.
Learning & Skills Council
Jacobs Consultancy
Litman Gregory
Lucas Systems
Malvern Instruments
Medrio
Merck & Co.
Mintera.
Monitor Software
MorningStar
NanoString Technologies
Paletta Invent
Parametric Portfolio Associates
Prosanos
RATA Associates
RiskShield
Ramboll
Standard & Poor's
Strategic Analysis Corporation
Univ. of Alicante
Univ. of South Carolina
vielife
Xerox
US Army