Defining Function Derivatives
Automatic differentiation is not supported with MATLAB® functions. In case the MATLAB function has Jacobian contributions, its derivatives with respect to the function input arguments need to be defined. By default, COMSOL Multiphysics assumes the derivatives to be null.
Expand the Derivatives section to define the derivatives of the function with respect to the function arguments. In the table, define the derivative for each function argument. In the Function column enter the function name, in the Argument column enter the argument. Finally, in the Function derivative column, enter the expression for the corresponding derivative.
The section Example: Define the Hankel Function, define the function derivative by entering the following settings in the table: