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
  • FD for forward difference

  • CD for central difference

  • FDR for forward difference with relative step size

  • CDR for central difference with relative step size

  • CS for complex step

sensStepfloat

Step size to use for differencing

sensModestr

Flag to compute gradients in parallel.