Taylor models

The Taylor model class is made available in the python module pyaudi:

taylor_model

class pyaudi.taylor_model

This class represents a Taylor model, containing a generalized dual number in combination with an interval. This implementation is derived from Makino (1998) and is built on top of a gdual object representing the Taylor polynomial (generalized dual number) part of the Taylor model.

}

A key concept here is Taylor’s theorem (formulation used from Makino (1998) p.80) which allows for a quantitative estimate of the error that is to be expected when approximating a function by its Taylor polynomial. Furthermore it even offers a way to obtain bounds for the error in practice based on bounding the \((n+1)\) th derivative a method that has sometimes been employed in interval calculations.

As a result, you get \(\forall \vec{x} \in [\vec{a}, \vec{b}]\) , a given order \(n\) , and an expansion point \(\vec{x_o}\):

\(f(\vec{x}) \in P_{\alpha, f}(\vec{x} - \vec{x_0}) + I_{\alpha, f}\)

where f is the function you’re creating a Taylor model for, P is the Taylor polynomial, and I is the interval remainder.

A basic example would be:

>>> from pyaudi import gdual_double as gdual, taylor_model, int_d
>>> domain_size = 0.01
>>> exp_points = {"x": 1.1, "y": 1.2}
>>> dom = {"x": int_d(exp_points["x"] - domain_size, exp_points["x"] + domain_size), "y": int_d(exp_points["y"] - domain_size, exp_points["y"] + domain_size)}
>>> rem = int_d(0.0, 0.0)
>>> tpol = gdual(exp_points["x"], "x", 6)
>>> x = taylor_model(tpol, rem, {"x": exp_points["x"]}, {"x": dom["x"]})
>>> y = taylor_model(tpol, rem, {"y": exp_points["y"]}, {"y": dom["y"]})
>>> test = 2 * x + 3 * y
>>> print(test)
abs(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Absolute value.

acos(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Arc cosine.

acosh(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Inverse hyperbolic cosine.

arccos(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Arc cosine.

arccosh(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Inverse hyperbolic cosine.

arcsin(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Arc sine.

arcsinh(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Inverse hyperbolic sine.

arctan(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Arc tangent.

arctanh(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Inverse hyperbolic arc tangent.

asin(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Arc sine.

asinh(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Inverse hyperbolic sine.

atan(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Arc tangent.

atanh(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Inverse hyperbolic arc tangent.

cos(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Cosine.

cosh(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Hyperbolic cosine.

property domain

Domain

exp(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Exponential.

property exp_point

Expansion point(s)

extend_symbol_set(self: pyaudi.core.taylor_model, sym_vars: collections.abc.Sequence[str], exp_point: collections.abc.Mapping[str, SupportsFloat], domain: collections.abc.Mapping[str, pyaudi.core.int_d]) None

Extends the symbol set of the Taylor polynomial, also adding the corresponding expansion points and domain.

get_bounds(self: pyaudi.core.taylor_model) pyaudi.core.int_d

Compute the bounds of this Taylor model

static get_custom_bounds(tpol: pyaudi.core.gdual_double, exp_points: collections.abc.Mapping[str, SupportsFloat], domain: collections.abc.Mapping[str, pyaudi.core.int_d]) pyaudi.core.int_d

Compute the bounds of a gdual polynomial over a given domain

static identity(*args, **kwargs)

Overloaded function.

  1. identity() -> pyaudi.core.taylor_model

  2. identity(rem: pyaudi.core.int_d, exp: collections.abc.Mapping[str, typing.SupportsFloat], domain: collections.abc.Mapping[str, pyaudi.core.int_d]) -> pyaudi.core.taylor_model

static interval_equal(a: pyaudi.core.int_d, b: pyaudi.core.int_d, tol: SupportsFloat | None = None) bool

Compare two intervals for equality with optional tolerance

log(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Natural logarithm.

static map_equal(a: collections.abc.Mapping[str, SupportsFloat], b: collections.abc.Mapping[str, SupportsFloat], tol: SupportsFloat | None = None) bool

Compare two maps of scalar values for equality with optional tolerance

static map_interval_equal(a: collections.abc.Mapping[str, pyaudi.core.int_d], b: collections.abc.Mapping[str, pyaudi.core.int_d], tol: SupportsFloat | None = None) bool

Compare two maps of intervals for equality with optional tolerance

property rem_bound

Remainder bound

sin(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Sine.

sinh(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Hyperbolic sine.

sqrt(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Square root.

tan(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Tangent.

tanh(self: pyaudi.core.taylor_model) pyaudi.core.taylor_model

Hyperbolic tangent.

property tpol

Taylor polynomial