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 />

>>> r = ode(f, jac).set_integrator(’zvode’, method=’bdf’, with_jacobian=True)<br />

>>> r.set_initial_value(y0, t0).set_f_params(2.0).set_jac_params(2.0)<br />

>>> t1 = 10<br />

>>> dt = 1<br />

>>> while r.successful() and r.t < t1:<br />

>>> r.integrate(r.t+dt)<br />

>>> print r.t, r.y<br />

Methods<br />

ode.integrate<br />

ode.set_f_params<br />

ode.set_initial_value<br />

ode.set_integrator<br />

ode.set_jac_params<br />

ode.successful<br />

3.5 Interpolation (<strong>scipy</strong>.interpolate)<br />

3.5.1 Univariate interpolation<br />

interp1d(x, y[, kind, axis, copy, ...]) Interpolate a 1D function.<br />

BarycentricInterpolator(xi[, yi]) The interpolating polynomial for a set of points<br />

KroghInterpolator(xi, yi) The interpolating polynomial for a set of points<br />

PiecewisePolynomial(xi, yi[, orders,<br />

Piecewise polynomial curve specified by points and<br />

direction])<br />

derivatives<br />

barycentric_interpolate(xi, yi, x) Convenience function for polynomial interpolation<br />

krogh_interpolate(xi, yi, x[, der]) Convenience function for polynomial interpolation.<br />

piecewise_polynomial_interpolate(xi, Convenience function for piecewise polynomial<br />

yi, x)<br />

interpolation<br />

class interp1d(x, y, kind=’linear’, axis=-1, copy=True, bounds_error=True, fill_value=nan)<br />

Interpolate a 1D function.<br />

See Also:<br />

splrep, splev, UnivariateSpline<br />

class BarycentricInterpolator(xi, yi=None)<br />

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

Constructs a polynomial that passes through a given set of points. Allows evaluation of the polynomial, efficient<br />

changing of the y values to be interpolated, and updating by adding more x values. For reasons of numerical<br />

stability, this function does not compute the coefficients of the polynomial.<br />

This class uses a “barycentric interpolation” method that treats the problem as a special case of rational function<br />

interpolation. This algorithm is quite stable, numerically, but even in a world of exact computation, unless the<br />

x coordinates are chosen very carefully - Chebyshev zeros (e.g. cos(i*pi/n)) are a good choice - polynomial<br />

interpolation itself is a very ill-conditioned process due to the Runge phenomenon.<br />

Based on Berrut and Trefethen 2004, “Barycentric Lagrange Interpolation”.<br />

Methods<br />

add_xi(xi[, yi]) Add more x values to the set to be interpolated<br />

set_yi(yi) Update the y values to be interpolated<br />

3.5. Interpolation (<strong>scipy</strong>.interpolate) 187

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

Saved successfully!

Ooh no, something went wrong!