Extreme Optimization™: Complexity made simple.

Math and Statistics
Libraries for .NET

  • Home
  • Features
    • Math Library
    • Vector and Matrix Library
    • Statistics Library
    • Performance
    • Usability
  • Documentation
    • Introduction
    • Math Library User's Guide
    • Vector and Matrix Library User's Guide
    • Data Analysis Library User's Guide
    • Statistics Library User's Guide
    • Reference
  • Resources
    • Downloads
    • QuickStart Samples
    • Sample Applications
    • Frequently Asked Questions
    • Technical Support
  • Order
  • Company
    • About us
    • Testimonials
    • Customers
    • Press Releases
    • Careers
    • Partners
    • Contact us
Introduction
Deployment Guide
Nuget packages
Configuration
Using Parallelism
Expand Mathematics Library User's GuideMathematics Library User's Guide
Expand Vector and Matrix Library User's GuideVector and Matrix Library User's Guide
Expand Data Analysis Library User's GuideData Analysis Library User's Guide
Expand Statistics Library User's GuideStatistics Library User's Guide
Expand Data Access Library User's GuideData Access Library User's Guide
Expand ReferenceReference

Skip Navigation LinksHome»Documentation»Mathematics Library User's Guide»Calculus»Numerical Integration»Gauss-Kronrod Integration Rules

Gauss-Kronrod Integration Rules

Extreme Optimization Numerical Libraries for .NET Professional

Gauss realized that a higher order could be achieved with the same number of function evaluations if the integration points and their weights in the weighted sum could be chosen arbitrarily. Gauss-Kronrod methods use two integration formulas of different orders where the integration points of the lower order formula are also integration points for the higher order formula. This gives a way to estimate the integration error without doing any extra function evaluations.

Another advantage of these methods is that they don't evaluate the function at the limits of the interval. This is of particular importance for integrands that contain singularities. The fixed point methods brake down for these integrands.

Fixed order Gauss-Kronrod integrators

These methods serve primarily as basic integration rules for the adaptive algorithm. Classes are provided for 15, 21, 31, 41, 51, and 61 point Gauss-Kronrod rules. The following table summarizes the classes in this category and the corresponding order.

Class

Description

GaussKronrod15PointRule

7-point Gauss with 15-point Kronrod rule.

GaussKronrod21PointRule

10-point Gauss with 21-point Kronrod rule.

GaussKronrod31PointRule

15-point Gauss with 31-point Kronrod rule.

GaussKronrod41PointRule

20-point Gauss with 41-point Kronrod rule.

GaussKronrod51PointRule

25-point Gauss with 51-point Kronrod rule.

GaussKronrod61PointRule

30-point Gauss with 61-point Kronrod rule.

To create a Gauss-Kronrod integrator of a different order, derive your class from IntegrationRule, and implement the Evaluate(FuncDouble, Double, Interval) method.

Non-adaptive Gauss-Kronrod integrator.

The NonAdaptiveGaussKronrodIntegrator class implements an algorithm that uses a cascade of Gauss-Kronrod points. Starting out with a 10-point Gauss integration formula, successive formulas for 21, 43, and 87 points provide increasing orders of the approximation with estimates of the error. Once the estimated error is within the required tolerance, no further function evaluations are needed. This is an excellent choice for smooth functions over an extended interval.

C#
VB
C++
F#
Copy
NonAdaptiveGaussKronrodIntegrator nagk = new NonAdaptiveGaussKronrodIntegrator();
nagk.RelativeTolerance = 1e-5;
nagk.ConvergenceCriterion = ConvergenceCriterion.WithinRelativeTolerance;
double result = nagk.Integrate(Math.Sin, 0, 2);
Console.WriteLine("sin(x) on [0,2]");
Console.WriteLine("Romberg integrator:");
Console.WriteLine("  Value: {0}", result);
Console.WriteLine("  Status: {0}", nagk.Status);
Console.WriteLine("  Estimated error: {0}", nagk.EstimatedError);
Console.WriteLine("  Iterations: {0}", nagk.IterationsNeeded);
Console.WriteLine("  Function evaluations: {0}", nagk.EvaluationsNeeded);
Console.WriteLine("  Order: {0}", nagk.Order);
Dim nagk As NonAdaptiveGaussKronrodIntegrator = New NonAdaptiveGaussKronrodIntegrator()
nagk.RelativeTolerance = 0.00001
nagk.ConvergenceCriterion = ConvergenceCriterion.WithinRelativeTolerance
Dim result As Double = nagk.Integrate(AddressOf Math.Sin, 0, 2)
Console.WriteLine("sin(x) on (0,2)")
Console.WriteLine("Romberg integrator:")
Console.WriteLine("  Value: {0}", result)
Console.WriteLine("  Status: {0}", nagk.Status)
Console.WriteLine("  Estimated error: {0}", nagk.EstimatedError)
Console.WriteLine("  Iterations: {0}", nagk.IterationsNeeded)
Console.WriteLine("  Function evaluations: {0}", nagk.EvaluationsNeeded)
Console.WriteLine("  Order: {0}", nagk.Order)

No code example is currently available or this language may not be supported.

let nagk = new NonAdaptiveGaussKronrodIntegrator()
nagk.RelativeTolerance <- 1e-5
nagk.ConvergenceCriterion <- ConvergenceCriterion.WithinRelativeTolerance
let result = nagk.Integrate(Math.Sin, 0.0, 2.0)
Console.WriteLine("sin(x) on [0,2]")
Console.WriteLine("Romberg integrator:")
Console.WriteLine("  Value: {0}", result)
Console.WriteLine("  Status: {0}", nagk.Status)
Console.WriteLine("  Estimated error: {0}", nagk.EstimatedError)
Console.WriteLine("  Iterations: {0}", nagk.IterationsNeeded)
Console.WriteLine("  Function evaluations: {0}", nagk.EvaluationsNeeded)
Console.WriteLine("  Order: {0}", nagk.Order)

The Gauss-Kronrod integration rules and the non-adaptive integrator have the property that the order of the method equals the number of function evaluations.

References

R. Piessens, E. de Doncker, C. Uberhuber and D. Kahaner, QUADPACK, A Subroutine Package for Automatic Integration , Springer-Verlag, New York, 1983.

Copyright (c) 2004-2023 ExoAnalytics Inc.

Send comments on this topic to support@extremeoptimization.com

Copyright © 2004-2023, Extreme Optimization. All rights reserved.
Extreme Optimization, Complexity made simple, M#, and M Sharp are trademarks of ExoAnalytics Inc.
Microsoft, Visual C#, Visual Basic, Visual Studio, Visual Studio.NET, and the Optimized for Visual Studio logo
are registered trademarks of Microsoft Corporation.