15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SciPy Reference Guide, Release 0.8.dev<br />

add_xi(xi, yi=None)<br />

Add more x values to the set to be interpolated<br />

The barycentric interpolation algorithm allows easy updating by adding more points for the polynomial<br />

to pass through.<br />

Parameters<br />

xi : array-like of length N1<br />

The x coordinates of the points the polynomial should pass through<br />

yi : array-like N1 by R or None<br />

The y coordinates of the points the polynomial should pass through; if R>1 the<br />

polynomial is vector-valued. If None the y values will be supplied later. The yi<br />

should be specified if and only if the interpolator has y values specified.<br />

set_yi(yi)<br />

Update the y values to be interpolated<br />

The barycentric interpolation algorithm requires the calculation of weights, but these depend only on the<br />

xi. The yi can be changed at any time.<br />

Parameters<br />

yi : array-like N by R<br />

The y coordinates of the points the polynomial should pass through; if R>1 the<br />

polynomial is vector-valued. If None the y values will be supplied later.<br />

class KroghInterpolator(xi, yi)<br />

The interpolating polynomial for a set of points<br />

Constructs a polynomial that passes through a given set of points, optionally with specified derivatives at those<br />

points. Allows evaluation of the polynomial and all its derivatives. For reasons of numerical stability, this<br />

function does not compute the coefficients of the polynomial, although they can be obtained by evaluating all<br />

the derivatives.<br />

Be aware that the algorithms implemented here are not necessarily the most numerically stable known. Moreover,<br />

even in a world of exact computation, unless the x coordinates are chosen very carefully - Chebyshev<br />

zeros (e.g. cos(i*pi/n)) are a good choice - polynomial interpolation itself is a very ill-conditioned process due<br />

to the Runge phenomenon. In general, even with well-chosen x values, degrees higher than about thirty cause<br />

problems with numerical instability in this code.<br />

Based on Krogh 1970, “Efficient Algorithms for Polynomial Interpolation and Numerical Differentiation”<br />

Methods<br />

derivative(x, der) Evaluate one derivative of the polynomial at the point x<br />

derivatives(x[, der]) Evaluate many derivatives of the polynomial at the point x<br />

derivative(x, der)<br />

Evaluate one derivative of the polynomial at the point x<br />

Parameters<br />

x : scalar or array-like of length N<br />

Point or points at which to evaluate the derivatives<br />

der : None or integer<br />

Which derivative to extract. This number includes the function value as 0th<br />

derivative.<br />

188 Chapter 3. Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!