FilonQuadrature¶
-
class
FilonQuadrature
(*args)¶ Tensorized integration algorithm of Gauss-Legendre.
- Parameters
- nint,
The discretization used by the algorithm. The integration algorithm will be regularly discretized by points.
- omegafloat
The default pulsation in the oscillating kernel. Default value is 1.0.
- kindint,
The type of oscillating kernel defining the integral, see notes. Default value is 0.
Notes
The Filon algorithm enables to approximate the definite integral:
with , , and:
This algorithm is based on a regular partition of the interval , the function being approximated by a quadratic function on three consecutive points. This algorithm provides an approximation of order when . When , the result is returned as a
Point
of dimension 2, the first component being the real part of the result and the second component the imaginary part.Examples
Create a Filon algorithm:
>>> import openturns as ot >>> algo = ot.FilonQuadrature(100) >>> algo = ot.FilonQuadrature(100, 10.0)
Methods
getClassName
(self)Accessor to the object’s name.
getId
(self)Accessor to the object’s id.
getKind
(self)Accessor to the kind of oscillating weight defining the integral.
getN
(self)Accessor to the discretization of the algorithm.
getName
(self)Accessor to the object’s name.
getOmega
(self)Accessor to the default pulsation.
getShadowedId
(self)Accessor to the object’s shadowed id.
getVisibility
(self)Accessor to the object’s visibility state.
hasName
(self)Test if the object is named.
hasVisibleName
(self)Test if the object has a distinguishable name.
integrate
(self, \*args)Evaluation of the integral of on an interval.
setKind
(self, kind)Accessor to the kind of oscillating weight defining the integral.
setN
(self, n)Accessor to the discretization of the algorithm.
setName
(self, name)Accessor to the object’s name.
setOmega
(self, omega)Accessor to the default pulsation.
setShadowedId
(self, id)Accessor to the object’s shadowed id.
setVisibility
(self, visible)Accessor to the object’s visibility state.
-
__init__
(self, \*args)¶ Initialize self. See help(type(self)) for accurate signature.
-
getClassName
(self)¶ Accessor to the object’s name.
- Returns
- class_namestr
The object class name (object.__class__.__name__).
-
getId
(self)¶ Accessor to the object’s id.
- Returns
- idint
Internal unique identifier.
-
getKind
(self)¶ Accessor to the kind of oscillating weight defining the integral.
- Returns
- kindint
The oscillating weight function defining the integral, see the notes.
-
getN
(self)¶ Accessor to the discretization of the algorithm.
- Returns
- ninteger
The discretization used by the algorithm.
-
getName
(self)¶ Accessor to the object’s name.
- Returns
- namestr
The name of the object.
-
getOmega
(self)¶ Accessor to the default pulsation.
- Returns
- omegafloat
The pulsation used in the integrate method if not explicitely given.
-
getShadowedId
(self)¶ Accessor to the object’s shadowed id.
- Returns
- idint
Internal unique identifier.
-
getVisibility
(self)¶ Accessor to the object’s visibility state.
- Returns
- visiblebool
Visibility flag.
-
hasName
(self)¶ Test if the object is named.
- Returns
- hasNamebool
True if the name is not empty.
-
hasVisibleName
(self)¶ Test if the object has a distinguishable name.
- Returns
- hasVisibleNamebool
True if the name is not empty and not the default one.
-
integrate
(self, \*args)¶ Evaluation of the integral of on an interval.
- Available usages:
integrate(f, interval)
integrate(f, interval, omega)
- Parameters
- Returns
- value
Point
Approximation of the integral. Its dimension is if , otherwise it is with the first components corresponding to the real part of the integral and the remaining ones to the imaginary part.
- value
Examples
>>> import openturns as ot >>> import math >>> f = ot.SymbolicFunction(['t'], ['log(1+t)']) >>> a = 0.5 >>> b = a + 8.0 * math.pi >>> n = 100 >>> omega = 1000.0 >>> kind = 0 >>> algoF = ot.FilonQuadrature(n, omega, kind) >>> value = algoF.integrate(f, ot.Interval(a, b)) >>> print(value[0]) -0.00134... >>> kind = 1 >>> algoF = ot.FilonQuadrature(n, omega, kind) >>> value = algoF.integrate(f, ot.Interval(a, b)) >>> print(value[0]) 0.00254... >>> kind = 2 >>> algoF = ot.FilonQuadrature(n, omega, kind) >>> value = algoF.integrate(f, ot.Interval(a, b)) >>> print(value[0]) -0.00134... >>> print(value[1]) 0.00254...
-
setKind
(self, kind)¶ Accessor to the kind of oscillating weight defining the integral.
- Parameters
- kindint
The oscillating weight function defining the integral, see the notes.
-
setN
(self, n)¶ Accessor to the discretization of the algorithm.
- Parameters
- ninteger,
The discretization used by the algorithm.
-
setName
(self, name)¶ Accessor to the object’s name.
- Parameters
- namestr
The name of the object.
-
setOmega
(self, omega)¶ Accessor to the default pulsation.
- Parameters
- omegafloat
The pulsation used in the integrate method if not explicitely given.
-
setShadowedId
(self, id)¶ Accessor to the object’s shadowed id.
- Parameters
- idint
Internal unique identifier.
-
setVisibility
(self, visible)¶ Accessor to the object’s visibility state.
- Parameters
- visiblebool
Visibility flag.