eryar@163.com

Abstract. Numerical integration is the approximate computation of an integral using numerical techniques. The numerical computation of an integral is sometimes called quadrature. The most straightforward numerical integration technique uses the Newton-Cotes formulas(also called quadrature formulas), which approximate a function tabulated sequence of regularly spaced intervals by various degree polynomials. If the functions are known analytically instead of being tabulated at equally spaced intervals, the best numerical method of integrations is called Gauss Integration(Gaussian quadrature). By picking the abscissas at which to evaluate the function, Gaussian quadrature produces the most accurate approximations possible. In OpenCASCADE math package it implement the Gauss-Legendre integration. So I will focus on the usage of the class in OpenCASCADE.

Key Words. OpenCASCADE, Gauss Integration, Gauss-Legendre, Numerical Analysis

1. Introduction

Gauss型求积公式是一种高精度的数值积分公式。在求积节点数相同的情况下，即计算工作量相近的情况下，利用Gauss型求积公式往往可以获得准确程序较高的积分结果，只是它在不等距的无理数上计算被积函数。

2. The Gauss-Legendre Integration

Gauss型求积公式是数值稳定的，且对有限闭区间上的连续函数，Gauss求积的数值随节点数目的增加而收敛到准确积分值。

v 查表求得Gauss点及求积系数；

```//Recuperation des points de Gauss dans le fichier GaussPoints.
math::GaussPoints(Order,GaussP);
math::GaussWeights(Order,GaussW);```

v 根据Gauss-Legendre求积公式计算；

```// Changement de variable pour la mise a l\'echelle [Lower, Upper] :
xm = 0.5*(Upper + Lower);
xr = 0.5*(Upper - Lower);
Val = 0.;

Standard_Integer ind = Order/2, ind1 = (Order+1)/2;
if(ind1 > ind) { // odder case
Ok1 = F.Value(xm, Val);
if (!Ok1) return;
Val *= GaussW(ind1);
}
// Sommation sur tous les points de Gauss: avec utilisation de la symetrie.
for (j = 1; j <= ind; j++) {
dx = xr*GaussP(j);
Ok1 = F.Value(xm-dx, F1);
if(!Ok1) return;
Ok1 = F.Value(xm+dx, F2);
if(!Ok1) return;
// Multiplication par les poids de Gauss.
Standard_Real FT = F1+F2;
Val += GaussW(j)*FT;
}
// Mise a l\'echelle de l\'intervalle [Lower, Upper]
Val *= xr;```

```/*
*
*        File    : Main.cpp
*        Author  : eryar@163.com
*        Date    : 2014-09-11 20:46
*        Version : 1.0v
*
*    Description : Demo for Gauss-Legendre Integration usage.
*
*      Key words : OpenCascade, Gauss-Legendre Integration
*/

#define WNT
#include <math_Function.hxx>
#include <math_GaussSingleIntegration.hxx>

#pragma comment(lib, \"TKernel.lib\")
#pragma comment(lib, \"TKMath.lib\")

class Test_GaussFunction : public math_Function
{
public:
virtual Standard_Boolean Value(const Standard_Real x, Standard_Real &y)
{
y = x;

return Standard_True;
}

private:
};

void TestGaussIntegration(void)
{
Test_GaussFunction aFunction;
math_GaussSingleIntegration aSolver(aFunction, 1, 10, 10);

std::cout << aSolver << std::endl;
}

int main(int argc, char* argv[])
{
TestGaussIntegration();

return 0;
}```

Figure 2.1 Gauss-Legendre Integtation Result

3. Application

Figure 3.1 Compute Area of a Surface

```TopoDS_Shape S = BRepBuilderAPI_MakeFace(BSS, Precision::Confusion()).Face();

GProp_GProps System;
BRepGProp::SurfaceProperties(S,System);
gp_Pnt G = System.CentreOfMass ();
Standard_Real Area = System.Mass();
gp_Mat I = System.MatrixOfInertia();```

4. Conclusion

5. References

1. Wolfram MathWorld, Numerical Integration,

http://mathworld.wolfram.com/NumericalIntegration.html

2. 易大义，沈云宝，李有法编. 计算方法. 浙江大学出版社. 2002

3. 易大义，陈道琦编. 数值分析引论. 浙江大学出版社. 1998

4. 李庆杨，王能超，易大义.数值分析.华中理工大学出版社. 1986

5. 同济大学数学教研室. 高等数学(第四版). 高等教育出版社. 1996