Gradient
- class pyoptsparse.pyOpt_gradient.Gradient(optProb, sensType, sensStep=None, sensMode='', comm=None)[source]
Gradient class for automatically computing gradients with finite difference or complex step.
- Parameters:
- optProbOptimization instance
This is the complete description of the optimization problem.
- sensTypestr
fdfor forward differencecdfor central differencefdrfor forward difference with relative step sizecdrfor central difference with relative step sizecsfor complex step
- sensStepfloat | complex, optional
Step size to use for differencing. By default
1e-6forfd/fdr,1e-4forcd/cdr,1e-40jforcs. Must be a purely imaginary value forcs.- sensModestr
Flag to compute gradients in parallel.