Optimization Workflow

To solve an optimization problem:

  1. Decide what type of problem you have, and whether you want a local or global solution (see Local vs. Global Optima). Choose a solver per the recommendations in Table for Choosing a Solver.

  2. Write your objective function and, if applicable, constraint functions per the syntax in Compute Objective Functions and Write Constraints.

  3. Set appropriate options using optimoptions, or prepare a GlobalSearch or MultiStart problem as described in Workflow for GlobalSearch and MultiStart. For details, see Pattern Search Options, Particle Swarm Options, Genetic Algorithm Options, Simulated Annealing Options, or Surrogate Optimization Options.

  4. Run the solver.

  5. Examine the result. For information on the result, see Solver Outputs and Iterative Display or Examine Results for GlobalSearch or MultiStart.

  6. If the result is unsatisfactory, change options or start points or otherwise update your optimization and rerun it. For information, see Global Optimization Toolbox Solver Characteristics or Improve Results. For information on improving solutions that applies mainly to smooth problems, see When the Solver Fails, When the Solver Might Have Succeeded, or When the Solver Succeeds.

Related Topics