MATLAB: What is the default value of typical step size and error order magnitude of finite differences in ‘fmincon’

derivativeserrorfinitedifferences.pfminconMATLABordersize;step

What are the values of the following parameters while calculating derivatives inside the 'fmincon' function:
a. Accuracy of the finite difference, or (Error order of magnitude).
b. Typical step size for the finite difference method.

Best Answer

The Finite Difference type can be either 'forward'(default) or 'centered':
1. The error order of magnitude is O(h) or O(h^2) for first and second order derivatives in forward and central differences.
2. The Typical step size defaults to (eps)^1/2 and (eps)^1/3 for forward and central differences.
The default step sizes can be overridden with the 'FiniteDifferenceStepSize', 'FiniteDifferenceType' and 'TypicalX' options by calling the 'optimoptions' function .
For more information on the above options, please refer to the following documentation:
https://www.mathworks.com/help/releases/R2020a/optim/ug/fmincon.html#busog7r-options