.. Copyright 2021 IRT Saint-Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. .. _gen_opt_algos: Optimization algorithms options =============================== A simple way to solve :class:`.OptimizationProblem` is to use the API method :meth:`~gemseo.api.execute_algo`. E.g. .. code:: from gemseo.api import execute_algo from gemseo.problems.analytical.rosenbrock import Rosenbrock problem = Rosenbrock() sol = execute_algo(problem, "L-BFGS-B", max_iter=20) print sol.f_opt They are also used in all MDO and DOE scenarios in the dictionary passed to the :meth:`.MDODiscipline.execute` method. List of available algorithms : :ref:`L-BFGS-B_options` - :ref:`NLOPT_BFGS_options` - :ref:`NLOPT_BOBYQA_options` - :ref:`NLOPT_COBYLA_options` - :ref:`NLOPT_MMA_options` - :ref:`NLOPT_NEWUOA_options` - :ref:`NLOPT_SLSQP_options` - :ref:`SLSQP_options` - :ref:`TNC_options` - .. _L-BFGS-B_options: L-BFGS-B -------- Description ~~~~~~~~~~~ Limited-memory BFGS algorithm implemented in SciPy library `External link `__ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Options ~~~~~~~ - **disp**, :code:`int` - display information, (Default value = 0) - **ftol_rel**, :code:`float` - stop criteria, relative tolerance on the objective function, if abs(f(xk)-f(xk+1))/abs(f(xk))<= ftol_rel: stop (Default value = 1e-9) - **max_fun_eval**, :code:`int` - internal stop criteria on the number of algorithm outer iterations (Default value = 999) - **max_iter**, :code:`int` - maximum number of iterations, ie unique calls to f(x) - **maxcor**, :code:`int` - maximum BFGS updates (Default value = 20) - **normalize_design_space**, :code:`bool` - If True, scales variables in [0, 1] - **pg_tol**, :code:`float` - stop criteria on the projected gradient norm (Default value = 1e-5) .. _NLOPT_BFGS_options: NLOPT_BFGS ---------- Description ~~~~~~~~~~~ Broyden-Fletcher-Goldfarb-Shanno method (BFGS) implemented in the NLOPT library `External link `__ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Options ~~~~~~~ - **ctol_abs**, :code:`float` - Absolute tolerance for constraints - **eq_tolerance**, :code:`float` - equality tolerance - **ftol_abs**, :code:`float` - Objective function tolerance - **ftol_rel**, :code:`float` - Relative objective function tolerance - **ineq_tolerance**, :code:`float` - inequality tolerance - **init_step**, :code:`float` - initial step size for derivavtive free algorithms increasing init_step will make the initial DOE in COBYLA wider steps in the design variables. By defaults, each variable is set to x0 + a perturbation that worths 0.25*(ub_i-x0_i) for i in xrange(len(x0)) - **max_iter**, :code:`int` - maximum number of iterations - **max_time**, :code:`float` - Maximum time - **normalize_design_space**, :code:`bool` - If True, scales variables in [0, 1] - **stopval**, :code:`float` - Stop when an objective value of at least stopval is found: stop minimizing when an objective value :math:`\leq` stopval is found, or stop maximizing a value :math:`\geq` stopval is found. - **xtol_abs**, :code:`float` - Design parameter tolerance - **xtol_rel**, :code:`float` - Relative design parameter tolerance .. _NLOPT_BOBYQA_options: NLOPT_BOBYQA ------------ Description ~~~~~~~~~~~ Bound Optimization BY Quadratic Approximation (BOBYQA) implemented in the NLOPT library `External link `__ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Options ~~~~~~~ - **ctol_abs**, :code:`float` - Absolute tolerance for constraints - **eq_tolerance**, :code:`float` - equality tolerance - **ftol_abs**, :code:`float` - Objective function tolerance - **ftol_rel**, :code:`float` - Relative objective function tolerance - **ineq_tolerance**, :code:`float` - inequality tolerance - **init_step**, :code:`float` - initial step size for derivavtive free algorithms increasing init_step will make the initial DOE in COBYLA wider steps in the design variables. By defaults, each variable is set to x0 + a perturbation that worths 0.25*(ub_i-x0_i) for i in xrange(len(x0)) - **max_iter**, :code:`int` - maximum number of iterations - **max_time**, :code:`float` - Maximum time - **normalize_design_space**, :code:`bool` - If True, scales variables in [0, 1] - **stopval**, :code:`float` - Stop when an objective value of at least stopval is found: stop minimizing when an objective value :math:`\leq` stopval is found, or stop maximizing a value :math:`\geq` stopval is found. - **xtol_abs**, :code:`float` - Design parameter tolerance - **xtol_rel**, :code:`float` - Relative design parameter tolerance .. _NLOPT_COBYLA_options: NLOPT_COBYLA ------------ Description ~~~~~~~~~~~ Constrained Optimization BY Linear Approximations (COBYLA) implemented in the NLOPT library `External link `__ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Options ~~~~~~~ - **ctol_abs**, :code:`float` - Absolute tolerance for constraints - **eq_tolerance**, :code:`float` - equality tolerance - **ftol_abs**, :code:`float` - Objective function tolerance - **ftol_rel**, :code:`float` - Relative objective function tolerance - **ineq_tolerance**, :code:`float` - inequality tolerance - **init_step**, :code:`float` - initial step size for derivavtive free algorithms increasing init_step will make the initial DOE in COBYLA wider steps in the design variables. By defaults, each variable is set to x0 + a perturbation that worths 0.25*(ub_i-x0_i) for i in xrange(len(x0)) - **max_iter**, :code:`int` - maximum number of iterations - **max_time**, :code:`float` - Maximum time - **normalize_design_space**, :code:`bool` - If True, scales variables in [0, 1] - **stopval**, :code:`float` - Stop when an objective value of at least stopval is found: stop minimizing when an objective value :math:`\leq` stopval is found, or stop maximizing a value :math:`\geq` stopval is found. - **xtol_abs**, :code:`float` - Design parameter tolerance - **xtol_rel**, :code:`float` - Relative design parameter tolerance .. _NLOPT_MMA_options: NLOPT_MMA --------- Description ~~~~~~~~~~~ Method of Moving Asymptotes (MMA)implemented in the NLOPT library `External link `__ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Options ~~~~~~~ - **ctol_abs**, :code:`float` - Absolute tolerance for constraints - **eq_tolerance**, :code:`float` - equality tolerance - **ftol_abs**, :code:`float` - Objective function tolerance - **ftol_rel**, :code:`float` - Relative objective function tolerance - **ineq_tolerance**, :code:`float` - inequality tolerance - **init_step**, :code:`float` - initial step size for derivavtive free algorithms increasing init_step will make the initial DOE in COBYLA wider steps in the design variables. By defaults, each variable is set to x0 + a perturbation that worths 0.25*(ub_i-x0_i) for i in xrange(len(x0)) - **max_iter**, :code:`int` - maximum number of iterations - **max_time**, :code:`float` - Maximum time - **normalize_design_space**, :code:`bool` - If True, scales variables in [0, 1] - **stopval**, :code:`float` - Stop when an objective value of at least stopval is found: stop minimizing when an objective value :math:`\leq` stopval is found, or stop maximizing a value :math:`\geq` stopval is found. - **xtol_abs**, :code:`float` - Design parameter tolerance - **xtol_rel**, :code:`float` - Relative design parameter tolerance .. _NLOPT_NEWUOA_options: NLOPT_NEWUOA ------------ Description ~~~~~~~~~~~ NEWUOA + bound constraints implemented in the NLOPT library `External link `__ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Options ~~~~~~~ - **ctol_abs**, :code:`float` - Absolute tolerance for constraints - **eq_tolerance**, :code:`float` - equality tolerance - **ftol_abs**, :code:`float` - Objective function tolerance - **ftol_rel**, :code:`float` - Relative objective function tolerance - **ineq_tolerance**, :code:`float` - inequality tolerance - **init_step**, :code:`float` - initial step size for derivavtive free algorithms increasing init_step will make the initial DOE in COBYLA wider steps in the design variables. By defaults, each variable is set to x0 + a perturbation that worths 0.25*(ub_i-x0_i) for i in xrange(len(x0)) - **max_iter**, :code:`int` - maximum number of iterations - **max_time**, :code:`float` - Maximum time - **normalize_design_space**, :code:`bool` - If True, scales variables in [0, 1] - **stopval**, :code:`float` - Stop when an objective value of at least stopval is found: stop minimizing when an objective value :math:`\leq` stopval is found, or stop maximizing a value :math:`\geq` stopval is found. - **xtol_abs**, :code:`float` - Design parameter tolerance - **xtol_rel**, :code:`float` - Relative design parameter tolerance .. _NLOPT_SLSQP_options: NLOPT_SLSQP ----------- Description ~~~~~~~~~~~ Sequential Least-Squares Quadratic Programming (SLSQP) implemented in the NLOPT library `External link `__ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Options ~~~~~~~ - **ctol_abs**, :code:`float` - Absolute tolerance for constraints - **eq_tolerance**, :code:`float` - equality tolerance - **ftol_abs**, :code:`float` - Objective function tolerance - **ftol_rel**, :code:`float` - Relative objective function tolerance - **ineq_tolerance**, :code:`float` - inequality tolerance - **init_step**, :code:`float` - initial step size for derivavtive free algorithms increasing init_step will make the initial DOE in COBYLA wider steps in the design variables. By defaults, each variable is set to x0 + a perturbation that worths 0.25*(ub_i-x0_i) for i in xrange(len(x0)) - **max_iter**, :code:`int` - maximum number of iterations - **max_time**, :code:`float` - Maximum time - **normalize_design_space**, :code:`bool` - If True, scales variables in [0, 1] - **stopval**, :code:`float` - Stop when an objective value of at least stopval is found: stop minimizing when an objective value :math:`\leq` stopval is found, or stop maximizing a value :math:`\geq` stopval is found. - **xtol_abs**, :code:`float` - Design parameter tolerance - **xtol_rel**, :code:`float` - Relative design parameter tolerance .. _SLSQP_options: SLSQP ----- Description ~~~~~~~~~~~ Sequential Least-Squares Quadratic Programming (SLSQP) implemented in the SciPy library `External link `__ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Options ~~~~~~~ - **disp**, :code:`int` - display information, (Default value = 0) - **eq_tolerance**, :code:`float` - equality tolerance - **ftol_rel**, :code:`float` - stop criteria, relative tolerance on the objective function, if abs(f(xk)-f(xk+1))/abs(f(xk))<= ftol_rel: stop (Default value = 1e-9) - **ineq_tolerance**, :code:`float` - inequality tolerance - **max_iter**, :code:`int` - maximum number of iterations, ie unique calls to f(x) - **normalize_design_space**, :code:`bool` - If True, scales variables in [0, 1] .. _TNC_options: TNC --- Description ~~~~~~~~~~~ Truncated Newton (TNC) algorithm implemented in SciPy library `External link `__ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Options ~~~~~~~ - **disp**, :code:`int` - display information, (Default value = 0) - **eq_tolerance**, :code:`float` - equality tolerance - **eta**, :code:`int` - severity of the linesearch, specific to TNC algorithm (Default value = -1.) - **ftol_rel**, :code:`float` - stop criteria, relative tolerance on the objective function, if abs(f(xk)-f(xk+1))/abs(f(xk))<= ftol_rel: stop (Default value = 1e-9) - **ineq_tolerance**, :code:`float` - inequality tolerance - **max_iter**, :code:`int` - maximum number of iterations, ie unique calls to f(x) - **maxCGit**, :code:`int` - Maximum Conjugate Gradient internal solver iterations (Default value = -1) - **minfev**, :code:`float` - Minimum function value estimate - **normalize_design_space**, :code:`bool` - If True, scales variables in [0, 1] - **offset**, :code:`float` - Value to subtract from each variable. - **pg_tol**, :code:`float` - stop criteria on the projected gradient norm (Default value = 1e-5) - **rescale**, :code:`float` - Scaling factor (in log10) used to trigger f value rescaling - **scale**, :code:`array` - Scaling factors to apply to each variable - **stepmx**, :code:`float` - Maximum step for the line search. - **xtol_rel**, :code:`float` - stop criteria, relative tolerance on the design variables, if norm(xk-xk+1)/norm(xk)<= xtol_rel: stop (Default value = 1e-9)