# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

## Gradient Computations

For the `Gradient descent` (`fmincon`) optimization solver, the gradients are computed using numerical perturbation:

`$\begin{array}{l}dx=\sqrt[3]{eps}×\mathrm{max}\left(|x|,\frac{1}{10}{x}_{typical}\right)\\ dL=\mathrm{max}\left(x-dx,{x}_{\mathrm{min}}\right)\\ dR=\mathrm{min}\left(x+dx,{x}_{\mathrm{max}}\right)\\ {F}_{L}=opt_fcn\left(dL\right)\\ {F}_{R}=opt_fcn\left(dR\right)\\ \frac{dF}{dx}=\frac{\left({F}_{L}-{F}_{R}\right)}{\left(dL-dR\right)}\\ \end{array}$`
• x is a scalar design variable.

• xmin is the lower bound of x.

• xmax is the upper bound of x.

• xtypical is the scaled value of x.

• opt_fcn is the objective function.

dx is relatively large to accommodate simulation solver tolerances.

If you want to compute the gradients in any other way, you can do so in the cost function you write for performing design optimization programmatically. See `sdo.optimize` and `GradFcn` of `sdo.OptimizeOptions` for more information.

## Related Topics

Was this topic helpful?

Get trial now