CheckDerivs

From TomWiki
Jump to navigationJump to search

Purpose

TOMLAB routine for verifying derivatives of user supplied routines.

Calling Syntax

[exitFlag,output] = checkDerivs(Prob, x_k, PriLev, ObjDerLev, ConsDerLev, AbsTol)

Inputs

Input Description
Prob Problem structure created with assign routine.
x_k Point the check derivatives for. Default x_0 or (xL + xU )/2. x_L and x_U have to be within 1e5.
PriLev Print Level, default 1. (0-1 valid).
ObjDerLev Depth for objective derivative check, 1 - checks gradient, 2 checks gradient and Hessian. Default 2 or level of derivatives supplied.
ConsDerLev Depth for constraint derivative check, 1 - checks Jacobian, 2 checks Jacobian and 2nd part of the Hessian to the Lagrangian function. Default 2 or level of derivatives supplied.
AbsTol Absolute tolerance for errors. Default [1e-5 1e-3 1e-4 1e-3 1e-4] (g H dc d2c J).

Outputs

Output Description
exitFlag If exitFlag = 0 a problem exist. See output for more information. Binary indicates where problem is: 01011. 1 + 2 + 8 = 13. Problems everywhere but 'dc', 'J'. 11111 = 'J' 'd2c' 'dc' 'H' 'g'.
output Structure containing analysis information.

g,H,dc,d2c,J Structure with results.

minErr: The smallest error.

avgErr: The average error.

maxErr: The largest error.

idx: Index for elements with errors.

exitFlag: 1 if problem with the function.

See Also