Set Problem-Based Optimization Options for Global Optimization Toolbox Solvers
To tune your optimization solution process in the problem-based approach, set options
optimoptions and pass the options to
solve. Set the solver
solve to match the options.
options = optimoptions("patternsearch",PlotFcn="psplotbestf"); [sol,fval] = solve(prob,x0,Options=options,Solver="patternsearch");
To find all available solvers for a problem, view the second output of
[~,validsolvers] = solvers(prob)
validsolvers = 1x10 string "lsqnonlin" "lsqcurvefit" "fmincon" "ga" "patternsearch" "surrogateopt" "particleswarm" "simulannealbnd" "gamultiobj" "paretosearch"
Some Global Optimization Toolbox solver options require you to map the option values to their solver equivalents.
For example, to set an initial population for
particleswarm, you need to map all problem variables to a single
matrix. Perform this mapping using the
For a discussion and examples, see Set Options in Problem-Based Approach Using varindex.
The remaining considerations for setting options are largely the same as in the solver-based approach. For details, see Set Optimization Options.