pyoptsparse_driver.py

OpenMDAO Wrapper for pyoptsparse. pyoptsparse is based on pyOpt, which is an object-oriented framework for formulating and solving nonlinear constrained optimization problems, with additional MPI capability. Note: only SNOPT is supported right now.

class openmdao.drivers.pyoptsparse_driver.pyOptSparseDriver[source]

Bases: openmdao.core.driver.Driver

Driver wrapper for pyoptsparse. pyoptsparse is based on pyOpt, which is an object-oriented framework for formulating and solving nonlinear constrained optimization problems, with additional MPI capability. Note: only SNOPT is supported right now.

Options:

equality_constraints : bool(True)

inequality_constraints : bool(True)

integer_design_vars : bool(False)

linear_constraints : bool(False)

multiple_objectives : bool(False)

two_sided_constraints : bool(True)

exit_flag : int(0)

0 for fail, 1 for ok

optimizer : str(‘SNOPT’)

Name of optimizers to use

print_results : bool(True)

Print pyOpt results if True

pyopt_diff : bool(True)

Set to True to let pyOpt calculate the gradient

title : str(‘Optimization using pyOpt_sparse’)

Title of this optimization run

gradfunc(dv_dict, func_dict)[source]

Function that evaluates and returns the gradient of the objective function and constraints. This function is passed to pyOpt’s Optimization object and is called from its optimizers.

Args:

dv_dict : dict

Dictionary of design variable values.

func_dict : dict

Dictionary of all functional variables evaluated at design point.

Returns:

sens_dict : dict

Dictionary of dictionaries for gradient of each dv/func pair

fail : int

0 for successful function evaluation 1 for unsuccessful function evaluation

objfunc(dv_dict)[source]

Function that evaluates and returns the objective function and constraints. This function is passed to pyOpt’s Optimization object and is called from its optimizers.

Args:

dv_dict : dict

Dictionary of design variable values.

Returns:

func_dict : dict

Dictionary of all functional variables evaluated at design point.

fail : int

0 for successful function evaluation 1 for unsuccessful function evaluation

run(problem)[source]

pyOpt execution. Note that pyOpt controls the execution, and the individual optimizers (i.e., SNOPT) control the iteration.

Args:

problem : Problem

Our parent Problem.