turboflow.pysolver_view.optimization_wrappers module

turboflow.pysolver_view.optimization_wrappers.NLOPT_SOLVERS = ['auglag', 'auglag_eq', 'bobyqa', 'ccsaq', 'cobyla', 'lbfgs', 'mma', 'neldermead', 'newuoa', 'newuoa_bound', 'praxis', 'sbplx', 'slsqp', 'tnewton', 'tnewton_precond', 'tnewton_precond_restart', 'tnewton_restart', 'var1', 'var2']

List of valid NLOpt solvers (interfaced through Pygmo)

turboflow.pysolver_view.optimization_wrappers.PYGMO_SOLVERS = ['ipopt', 'snopt', 'de', 'sga', 'pso']

List of valid Pygmo solvers

turboflow.pysolver_view.optimization_wrappers.SCIPY_SOLVERS = ['nelder-mead', 'powell', 'cg', 'bfgs', 'newton-cg', 'l-bfgs-b', 'tnc', 'cobyla', 'slsqp', 'trust-constr', 'dogleg', 'trust-ncg', 'trust-krylov', 'trust-exact']

List of valid Scipy solvers

turboflow.pysolver_view.optimization_wrappers.convert_pygmo_to_scipy_bounds(pygmo_bounds)[source]

Create a function that converts bounds from Pygmo format to SciPy format.

Parameters:
pygmo_methodcallable

A method that, when called, returns a tuple containing two lists: the first list of lower bounds and the second of upper bounds (Pygmo convention).

Returns:
callable

A function that, when called, returns a list of tuples where each tuple contains the lower and upper bound for each decision variable (Scipy convention).

turboflow.pysolver_view.optimization_wrappers.minimize_nlopt(problem, x0, method, options)[source]

Optimize a given problem using the specified NLOpt optimization method.

Parameters:
problemOptimizationProblem

An object representing the problem.

x0array_like

Initial guess for the decision variables.

methodstr

The name of the Pygmo solver to use. Must be one of the solvers defined in the NLOPT_SOLVERS list.

optionsdict

Configuration options for the solver. Options vary depending on the solver used.

Returns:
tuple

A tuple (success, message) where ‘success’ is a boolean indicating if the optimization was successful, and ‘message’ is a string describing the outcome.

Raises:
ValueError

If an invalid solver name is specified.

turboflow.pysolver_view.optimization_wrappers.minimize_pygmo(problem, x0, method, options)[source]

Optimize a given problem using the specified Pygmo optimization method.

Parameters:
problemOptimizationProblem

An object representing the problem.

x0array_like

Initial guess for the decision variables.

methodstr

The name of the Pygmo solver to use. Must be one of the solvers defined in the PYGMO_SOLVERS list.

optionsdict

Configuration options for the solver. Options vary depending on the solver used.

Returns:
tuple

A tuple (success, message) where ‘success’ is a boolean indicating if the optimization was successful, and ‘message’ is a string describing the outcome.

Raises:
ValueError

If an invalid solver name is specified.

turboflow.pysolver_view.optimization_wrappers.minimize_scipy(problem, x0, method, options)[source]

Optimize a given problem using the specified SciPy method.

Parameters:
problemOptimizationProblem

An object representing the problem.

x0array_like

Initial guess for the decision variables.

methodstr

The name of the Scipy solver to use. Must be one of the solvers defined in the SCIPY_SOLVERS list.

optionsdict

Configuration options for the solver. Options vary depending on the solver used.

Returns:
tuple

A tuple (success, message) where ‘success’ is a boolean indicating if the optimization was successful, and ‘message’ is a string describing the outcome.

Raises:
ValueError

If an invalid solver is specified.