Integration Nodes Interface (i_nodes)

class pypint.integrators.node_providers.i_nodes.INodes[source]

Bases: builtins.object

Provider for integration nodes.

This is an abstract interface for providers of integration nodes.

init(n_nodes, interval=None)[source]

Initializes the vector of integration nodes of size n_nodes.

Parameters:
  • n_nodes (int) – The number of desired integration nodes.
  • interval (numpy.ndarray(size=2) or None) – Interval of desired integration nodes. If unset (i.e. None), default nodes interval is implementation dependent.

Notes

The implementation and behaviour must and will be defined by specializations of this interface.

See also

interval : Accessor for the interval.

transform(interval)[source]

Transforms computed integration nodes to fit a new given interval.

Based on the old interval the computed integration nodes are transformed fitting the newly given interval using standard linear interval scaling. In case no interval was previously given, the standard interval of the used nodes method, e.g. \([-1, 1]\) for Gauss-Lobatto, is used.

Parameters:interval (numpy.ndarray(size=2)) – New interval to transform nodes onto.
Raises:ValueError – If the standard interval is not suited for transformation, i.e. it is not a numpy.ndarray of size 2 and not positive.

Notes

It may be this transformation is numerically inconvenient because of the loss of significance.

__weakref__

list of weak references to the object (if defined)

interval[source]

Accessor for the interval of the integration nodes.

Parameters:interval (numpy.ndarray(size=2)) – Desired interval of integration nodes.
Raises:ValueError – If interval is not an numpy.ndarray and not of size 2.
Returns:node_interval – Interval of the nodes.
Return type:numpy.ndarray(size=2)

Notes

The setter calls transform() with the given interval.

nodes[source]

Accessor for the vector of integration nodes.

Returns:nodes – Vector of nodes.
Return type:numpy.ndarray
num_nodes[source]

Accessor for the number of desired integration nodes.

Returns:number of nodes – The number of desired and/or computed integration nodes.
Return type:int

Notes

Specializations of this interface might override this accessor.

std_interval = array([ 0., 0.])

Standard interval for this integration nodes.