Optimization Troubleshooting and Tips
This table describes typical optimization problems and provides recommendations for handling them.
Problem |
Recommendation |
---|---|
The solution found by |
There is no guarantee that a solution is a global minimum unless
your problem is continuous and has only one minimum. To search for a
global minimum, start the optimization from multiple starting points
(or intervals, in the case of |
It is impossible to evaluate the objective function
|
Modify your function to return a large positive value for
|
The minimization routine appears to enter an infinite loop or
returns a solution that is not a minimum (or not a zero, in the case
of |
Perhaps your objective function returns options = optimset('FunValCheck','on') and call the optimization function with |
The solver takes a long time. |
Most optimization problems benefit from good starting points. Try random starting points in a region that might be close to a solution, based on your problem characteristics. Sometimes you can solve a complicated problem using an evolutionary approach. First, solve problems with a smaller number of independent variables. Use solutions from these simpler problems as starting points for more complicated problems by using an appropriate mapping. Also, you can sometimes speed the solution by using simpler objective functions and less stringent stopping conditions in the initial stages of an optimization problem. |
It is unclear what the solver is doing. |
To see what the solver is doing as it iterates:
|
|
|
Note
Optimization solvers apply to real-valued functions. Complex values cannot be optimized, except for a real-valued function of the complex values, such as the norm.