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 Type | Recommended Solver |
---|---|
Smooth (objective twice differentiable), and you want a local solution | An appropriate Optimization Toolbox™ solver; see Optimization Decision Table |
Smooth (objective twice differentiable), and you want a global solution or multiple local solutions | GlobalSearch or MultiStart |
Nonsmooth, and you want a local solution | patternsearch |
Nonsmooth, and you want a global solution or multiple local solutions | surrogateopt 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.