methodsnm.intrule_1d
index
/builds/lehrenfeld/methodsnm/git-repo/jlcontent/src/methodsnm/intrule_1d.py

This module provides classes for 1D numerical integration rules.

 
Modules
       
numpy
scipy

 
Classes
       
methodsnm.intrule.IntRule(builtins.object)
IntRule1D
GaussJacobiRule
GaussLegendreRule
MidPointRule
NP_GaussLegendreRule
NewtonCotesRule
SP_GaussJacobiRule

 
class GaussJacobiRule(IntRule1D)
    GaussJacobiRule(n, alpha, beta, interval=(0, 1))
 
Class for the Gauss-Jacobi rule for 1D numerical integration.
 
 
Method resolution order:
GaussJacobiRule
IntRule1D
methodsnm.intrule.IntRule
builtins.object

Methods defined here:
__init__(self, n, alpha, beta, interval=(0, 1))
Initializes the Gauss-Jacobi rule with the given interval and number of nodes.
 
Parameters:
n (int): The number of nodes to use for integration.
interval (tuple): The interval to integrate over.
alpha, beta (float): The parameters of the Jacobi polynomial.

Data and other attributes inherited from IntRule1D:
interval = None

Methods inherited from methodsnm.intrule.IntRule:
__str__(self)
Return str(self).
integrate(self, f)

Data descriptors inherited from methodsnm.intrule.IntRule:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from methodsnm.intrule.IntRule:
exactness_degree = None
nodes = None
weights = None

 
class GaussLegendreRule(IntRule1D)
    GaussLegendreRule(n, interval=(0, 1))
 
Class for the Gauss-Legendre rule for 1D numerical integration.
 
 
Method resolution order:
GaussLegendreRule
IntRule1D
methodsnm.intrule.IntRule
builtins.object

Methods defined here:
__init__(self, n, interval=(0, 1))
Initializes the Gauss-Legendre rule with the given interval and number of nodes.
 
Parameters:
n (int): The number of nodes to use for integration.
interval (tuple): The interval to integrate over.

Data and other attributes inherited from IntRule1D:
interval = None

Methods inherited from methodsnm.intrule.IntRule:
__str__(self)
Return str(self).
integrate(self, f)

Data descriptors inherited from methodsnm.intrule.IntRule:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from methodsnm.intrule.IntRule:
exactness_degree = None
nodes = None
weights = None

 
class IntRule1D(methodsnm.intrule.IntRule)
    IntRule1D(interval=(0, 1))
 
Abstract base class for 1D numerical integration rules.
 
 
Method resolution order:
IntRule1D
methodsnm.intrule.IntRule
builtins.object

Methods defined here:
__init__(self, interval=(0, 1))
Initializes the integration rule with the given interval.

Data and other attributes defined here:
interval = None

Methods inherited from methodsnm.intrule.IntRule:
__str__(self)
Return str(self).
integrate(self, f)

Data descriptors inherited from methodsnm.intrule.IntRule:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from methodsnm.intrule.IntRule:
exactness_degree = None
nodes = None
weights = None

 
class MidPointRule(IntRule1D)
    MidPointRule(interval=(0, 1))
 
Class for the midpoint rule for 1D numerical integration.
 
 
Method resolution order:
MidPointRule
IntRule1D
methodsnm.intrule.IntRule
builtins.object

Methods defined here:
__init__(self, interval=(0, 1))
Initializes the midpoint rule with the given interval.
 
Parameters:
interval (tuple): The interval to integrate over.

Data and other attributes inherited from IntRule1D:
interval = None

Methods inherited from methodsnm.intrule.IntRule:
__str__(self)
Return str(self).
integrate(self, f)

Data descriptors inherited from methodsnm.intrule.IntRule:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from methodsnm.intrule.IntRule:
exactness_degree = None
nodes = None
weights = None

 
class NP_GaussLegendreRule(IntRule1D)
    NP_GaussLegendreRule(n, interval=(0, 1))
 
Wrapper class for the Gauss-Legendre rule for 1D numerical integration of numpy.
 
 
Method resolution order:
NP_GaussLegendreRule
IntRule1D
methodsnm.intrule.IntRule
builtins.object

Methods defined here:
__init__(self, n, interval=(0, 1))
Initializes the Gauss-Legendre rule with the given interval and number of nodes.
 
Parameters:
n (int): The number of nodes to use for integration.
interval (tuple): The interval to integrate over.

Data and other attributes inherited from IntRule1D:
interval = None

Methods inherited from methodsnm.intrule.IntRule:
__str__(self)
Return str(self).
integrate(self, f)

Data descriptors inherited from methodsnm.intrule.IntRule:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from methodsnm.intrule.IntRule:
exactness_degree = None
nodes = None
weights = None

 
class NewtonCotesRule(IntRule1D)
    NewtonCotesRule(n=None, nodes=None, interval=(0, 1))
 
Class for the Newton-Cotes rule for 1D numerical integration.
 
 
Method resolution order:
NewtonCotesRule
IntRule1D
methodsnm.intrule.IntRule
builtins.object

Methods defined here:
__init__(self, n=None, nodes=None, interval=(0, 1))
Initializes the Newton-Cotes rule with the given interval and number of nodes.
 
Parameters:
n (int or list): The number of nodes or a list of nodes to use for integration.
nodes (list): A list of nodes to use for integration.
interval (tuple): The interval to integrate over.

Data and other attributes inherited from IntRule1D:
interval = None

Methods inherited from methodsnm.intrule.IntRule:
__str__(self)
Return str(self).
integrate(self, f)

Data descriptors inherited from methodsnm.intrule.IntRule:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from methodsnm.intrule.IntRule:
exactness_degree = None
nodes = None
weights = None

 
class SP_GaussJacobiRule(IntRule1D)
    SP_GaussJacobiRule(n, alpha, beta, interval=(0, 1))
 
Wrapper class for the Gauss-Jacobi rule for 1D numerical integration of numpy.
 
 
Method resolution order:
SP_GaussJacobiRule
IntRule1D
methodsnm.intrule.IntRule
builtins.object

Methods defined here:
__init__(self, n, alpha, beta, interval=(0, 1))
Initializes the Gauss-Legendre rule with the given interval and number of nodes.
 
Parameters:
n (int): The number of nodes to use for integration.
interval (tuple): The interval to integrate over.
alpha, beta (float): The parameters of the Jacobi polynomial.

Data and other attributes inherited from IntRule1D:
interval = None

Methods inherited from methodsnm.intrule.IntRule:
__str__(self)
Return str(self).
integrate(self, f)

Data descriptors inherited from methodsnm.intrule.IntRule:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from methodsnm.intrule.IntRule:
exactness_degree = None
nodes = None
weights = None

 
Functions
       
evaluate_exactness_degree(rule, max_order=None)
Evaluates the exactness degree of the given integration rule.
 
Parameters:
rule (IntRule1D): The integration rule to evaluate.
max_order (int or None): maximum order to check for exactness degree. If None, the exactness degree is checked until it is found.
 
Returns:
int: The exactness degree of the integration rule.