<< uncprb_getvecjac Unconstrained Optimization Problems Toolbox Benchmark >>

Unconstrained Optimization Problems Toolbox >> Unconstrained Optimization Problems Toolbox > uncprb_getvecjacfd

uncprb_getvecjacfd

Compute the Jacobian by finite differences

Calling Sequence

Jfd = uncprb_getvecjacfd ( n , m , x , nprob )
Jfd = uncprb_getvecjacfd ( n , m , x , nprob , Jstep )
Jfd = uncprb_getvecjacfd ( n , m , x , nprob , Jstep , Jorder )

Parameters

x:

a n x 1 matrix of doubles, the point where to compute f

Jstep :

the step to use for differences. If Jstep=[], uses the default step. The default step depends on the order and the machine precision %eps.

Jorder:

the order to use for differences (1, 2 or 4). Default Jorder = 2. If Jorder=[], uses the default order.

nprob:

the problem number

n:

the number of variables, i.e. the size of x

m:

the number of functions, i.e. the size of fvec

Jfd:

a m x n matrix of doubles, the Jacobian matrix, dfi(x)/dxj, i=1,..,m , j=1, ..., n

Description

Uses finite differences to compute the Jacobian matrix.

Examples

// Get Jfd at x0 for Rosenbrock's test case
nprob = 1
[n,m,x0]=uncprb_getinitf(nprob)
Jfd = uncprb_getvecjacfd ( n , m , x0 , nprob , [] , [] )
// Compare with exact Jacobian
J=uncprb_getvecjac(n,m,x0,nprob)
norm(J-Jfd)/norm(J)

Authors

<< uncprb_getvecjac Unconstrained Optimization Problems Toolbox Benchmark >>