taylor_series#

pynlo.utility.taylor_series(x0, fn)[source]#

Calculate a Taylor series expansion given the derivatives of a function about a point.

Parameters:
x0float

The center point of the Taylor series expansion.

fnarray_like

The value and derivatives of the function evaluated at x0. The coefficients must be given in order of increasing degree, i.e. [f(x0), f'(x0), f''(x0), ...].

Returns:
pwr_seriesnumpy.polynomial.Polynomial

A NumPy Polynomial object representing the Taylor series expansion.