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.
User Requested Exception.
This exception indicates that the user has requested that SNOPT/pyoptsparse ceases model execution and reports to SNOPT that execution should be terminated.
Initialize self. See help(type(self)) for accurate signature.
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
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. pypptsparse has interfaces to the following optimizers: ALPSO, CONMIN, FSQP, IPOPT, NLPQLP, NSGA2, PSQP, SLSQP, SNOPT, NLPY_AUGLAG, NOMAD, ParOpt. Note that some of these are not open source and therefore not included in the pyoptsparse source code.
- pyOptSparseDriver supports the following:
(bool) Flag that indicates failure of most recent optimization.
(str or None) File location for saving pyopt_sparse optimization history. Default is None for no output.
(str) Optional file to hot start the optimization.
(dict) Dictionary for setting optimizer-specific options.
(Solution) Pyopt_sparse solution object.
- **kwargsdict of keyword arguments
Keyword arguments that will be mapped into the Driver options.
Add a recorder to the driver.
A recorder instance.
Clean up resources prior to exit.
declare_coloring(num_full_jacs=3, tol=1e-25, orders=None, perturb_size=1e-09, min_improve_pct=5.0, show_summary=True, show_sparsity=False)¶
Set options for total deriv coloring.
Number of times to repeat partial jacobian computation when computing sparsity.
Tolerance used to determine if an array entry is nonzero during sparsity determination.
Number of orders above and below the tolerance to check during the tolerance sweep.
Size of input/output perturbation during generation of sparsity.
If coloring does not improve (decrease) the number of solves more than the given percentage, coloring will not be used.
If True, display summary information after generating coloring.
If True, display sparsity with coloring info after generating coloring.
get_constraint_values(ctype='all', lintype='all', driver_scaling=True)¶
Return constraint values.
Default is ‘all’. Optionally return just the inequality constraints with ‘ineq’ or the equality constraints with ‘eq’.
Default is ‘all’. Optionally return just the linear constraints with ‘linear’ or the nonlinear constraints with ‘nonlinear’.
When True, return values that are scaled according to either the adder and scaler or the ref and ref0 values that were specified when add_design_var, add_objective, and add_constraint were called on the model. Default is True.
Dictionary containing values of each constraint.
Return the design variable values.
- get_remotebool or None
If True, retrieve the value even if it is on a remote process. Note that if the variable is remote on ANY process, this function must be called on EVERY process in the Problem’s MPI communicator. If False, only retrieve the value if it is on the current process, or only the part of the value that’s on the current process for a distributed variable.
Dictionary containing values of each design variable.
Return objective values.
Dictionary containing values of each objective.
Return info to prepend to messages.
Info to prepend to messages.
Record an iteration of the current Driver.
Note that pyOpt controls the execution, and the individual optimizers (e.g., SNOPT) control the iteration.
Failure flag; True if failed to converge, False is successful.
set_design_var(name, value, set_remote=True)¶
Set the value of a design variable.
Global pathname of the design variable.
- valuefloat or ndarray
Value for the design variable.
If True, set the global value of the variable (value must be of the global size). If False, set the local value of the variable (value must be of the local size).
Tell the driver to use a precomputed coloring.
A coloring filename. If no arg is passed, filename will be determined automatically.