jacobian

Numerical approximations to Jacobians of functions

Module contents

scikits.bvp1lg.jacobian.check_jacobian(N, f, df, bounds=None, eps=1e-06, rtol=0.001, atol=1e-08, times=None)

Check that df is a partial derivative of f.

This is done by computing (f(u + eps*e_k) - f(u))/eps and checking its difference from df(u) in norm-2.

Note

This routine is currently naive and could be improved.

Parameters:

N :

number of variables

f :

f(u) should return array(N) for u=array(N)

df :

df(u) should return array(N,N) for u=array(N)

bounds :

bounds for elements of u, as [(lower[0], upper[0]), ...]

eps :

epsilon to use for evaluating the partial derivatives

rtol :

relative tolerance to allow

atol :

absolute tolerance to allow

times :

how many random checks to perform

Returns:

ok : bool

True if df passes the test, False otherwise.

scikits.bvp1lg.jacobian.jacobian(f, u, eps=1e-06)

Evaluate partial derivatives of f(u) numerically.

Note

This routine is currently naive and could be improved.

Returns:

df : ndarray

(*f.shape, *u.shape) array df, where df[i,j] ~= (d f_i / u_j)(u)

Table Of Contents

Previous topic

mus

Next topic

Examples

This Page