Main Content

Table for Choosing a Solver

Choose a solver based on problem characteristics and on the type of solution you want. Solver Characteristics contains more information to help you decide which solver is likely to be most suitable. This table gives recommendations that are suitable for most problems.

Problem TypeRecommended Solver
Smooth (objective twice differentiable), and you want a local solutionAn appropriate Optimization Toolbox™ solver; see Optimization Decision Table
Smooth (objective twice differentiable), and you want a global solution or multiple local solutionsGlobalSearch or MultiStart
Nonsmooth, and you want a local solutionpatternsearch
Nonsmooth, and you want a global solution or multiple local solutionssurrogateopt or patternsearch with several initial points x0

To start patternsearch at multiple points when you have finite bounds lb and ub on every component, try:

x0 = lb + rand(size(lb)).*(ub - lb);

Many other solvers provide different solution algorithms, including the genetic algorithm solver ga and the particleswarm solver. Try some of them if the recommended solvers do not perform well on your problem. For details, see Global Optimization Toolbox Solver Characteristics.

Related Examples

More About