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.

x = np.linspace(0,4,50)<br />

>>> y = func(x, 2.5, 1.3, 0.5)<br />

>>> yn = y + 0.2*np.random.normal(size=len(x))<br />

>>> popt, pcov = curve_fit(func, x, yn)<br />

3.12.3 Root finding<br />

fsolve(func, x0[, args, fprime, ...]) Find the roots of a function.<br />

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

fsolve(func, x0, args=(), fprime=None, full_output=0, col_deriv=0, xtol=1.49012e-08, maxfev=0, band=None,<br />

epsfcn=0.0, factor=100, diag=None, warning=True)<br />

Find the roots of a function.<br />

Return the roots of the (non-linear) equations defined by func(x)=0 given a starting estimate.<br />

Parameters<br />

func :<br />

x0 :<br />

args :<br />

Returns<br />

x :<br />

fprime :<br />

A Python function or method which takes at least one (possibly vector) argument.<br />

The starting estimate for the roots of func(x)=0.<br />

Any extra arguments to func are placed in this tuple.<br />

A function or method to compute the Jacobian of func with derivatives across the<br />

rows. If this is None, the Jacobian will be estimated.<br />

full_output :<br />

Non-zero to return the optional outputs.<br />

col_deriv :<br />

Non-zero to specify that the Jacobian function computes derivatives down the<br />

columns (faster, because there is no transpose operation).<br />

warning :<br />

True to print a warning message when the call is unsuccessful; False to suppress the<br />

warning message. Deprecated, use the warnings module instead.<br />

The solution (or the result of the last iteration for an unsuccessful call.<br />

infodict :<br />

A dictionary of optional outputs with the keys:<br />

• ‘nfev’: number of function calls<br />

• ‘njev’: number of Jacobian calls<br />

• ‘fvec’: function evaluated at the output<br />

3.12. Optimization and root finding (<strong>scipy</strong>.optimize) 317

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

Saved successfully!

Ooh no, something went wrong!