Optimization Toolbox

Parallel Computing and Derivatives

Optimization Toolbox solvers for nonlinear problems use gradient-based methods for minimizing or maximizing an objective. Information about the gradient of the objective function can be either estimated by the solver using finite differences, or supplied to the solver by the user.

Parallel Computing

Optimization Toolbox can be used with Parallel Computing Toolbox to solve problems that benefit from parallel computation. You can use parallel computing to decrease time to solution by enabling built-in parallel computing support or by defining a custom parallel computing implementation of an optimization problem.

Built-in support for parallel computing in Optimization Toolbox enables you to accelerate the gradient estimation step in select solvers for constrained nonlinear optimization problems and for multiobjective goal attainment and minimax problems.

Accelerating time to solution for an electrostatics problem using the built-in support for parallel computing.
Accelerating time to solution for an electrostatics problem using the built-in support for parallel computing in a nonlinear optimization solver. The built-in functionality is enabled by specifying the UseParallel option (left) for the objective (middle right) and constraint (bottom right) functions, with the solution shown in the top right.

You can customize a parallel computing implementation by explicitly defining the optimization problem to use parallel computing functionality. You can define either an objective function or a constraint function to use parallel computing, enabling you to decrease the time required to evaluate the objective or constraint.

Accelerating time to solution for a suspension system design.
Accelerating time to solution (top right) for a suspension system design (bottom left and bottom right) subject to uncertainty by customizing the objective function with a single line change in code (top left).

Speeding Up Optimization Problems Using Parallel Computing 55:41
In this webinar, we will use two case studies to demonstrate how you can use parallel computing to speed up single-level and multilevel optimization problems in MATLAB.

Supplying Derivatives

Optimization Toolbox solvers minimize nonlinear functions by estimating the partial derivatives of the objective function using finite differences. Alternatively, you can define functions that calculate the values of the partial derivatives, significantly reducing the overhead of the derivative estimation step. 

Calculating partial derivatives of an objective function can be a tedious task. By expressing the problem symbolically using Symbolic Math Toolbox™, you can use built-in functions for automatically calculating objective function partial derivatives. MATLAB code can then be generated for use with Optimization Toolbox solvers.

Optimization Using Symbolic Derivatives (Technical Article)

Try Optimization Toolbox

Get trial software

Tips and Tricks - Getting Started Using Optimization with MATLAB

View webinar

Learn to solve your optimization problems with MATLAB

View course info