h2integrate.core.pose_optimization#
This file is based on the WISDEM file of the same name: WISDEM/WISDEM and also based off of the H2Integrate file of the same name originally adapted by Jared Thomas.
Classes
|
This class contains a collection of methods for setting up an OpenMDAO optimization problem for a H2Integrate simulation. |
- class h2integrate.core.pose_optimization.PoseOptimization(config)#
This class contains a collection of methods for setting up an OpenMDAO optimization problem for a H2Integrate simulation.
- Parameters:
config -- instance of a H2Integrate config containing all desired simulation set up
- get_number_design_variables()#
This method counts the number of design variables required given the provided set up and returns the result
- Returns:
int -- number of design variables
- _get_step_size()#
If a step size for the driver-level finite differencing is provided, use that step size. Otherwise use a default value.
- Returns:
step size (float) -- step size for optimization
- _set_optimizer_properties(opt_prob, options_keys=[], opt_settings_keys=[], mapped_keys={})#
Set the optimizer properties, both the driver.options and driver.opt_settings. See OpenMDAO documentation on drivers to determine which settings are set by either options or opt_settings.
- Parameters:
opt_prob (OpenMDAO problem object) -- The hybrid plant OpenMDAO problem object.
options_keys (list, optional) -- List of keys for driver opt_settings to be set. Defaults to [].
opt_settings_keys (list, optional) -- List of keys for driver options to be set. Defaults to [].
mapped_keys (dict, optional) --
Key pairs where the yaml name differs from what's expected
by the driver. Specifically, the key is what's given in the yaml and the value is what's expected by the driver. Defaults to {}.
- Returns:
opt_prob (OpenMDAO problem object) --
- The updated openmdao problem
object with driver settings applied.
- set_driver(opt_prob)#
set which optimization driver to use and set options
- Parameters:
opt_prob (openmdao problem instance) -- openmdao problem class instance for current optimization problem
- Raises:
ImportError -- An optimization algorithm from pyoptsparse was selected, but pyoptsparse is not installed
ImportError -- An optimization algorithm from pyoptsparse was selected, but the algorithm code is not currently installed within pyoptsparse
ImportError -- An optimization algorithm was requested from NLopt, but NLopt is not currently installed.
ValueError -- The selected optimizer is not yet supported.
Exception -- The specified generator type for the OpenMDAO design of experiments is unsupported.
- Returns:
opt_prob (openmdao problem instance) --
- openmdao problem class instance,
edited from input with desired driver and driver options
- set_objective(opt_prob)#
Set merit figure. Each objective has its own scaling. Check first for user override.
The optimization is always minimizing the objective. If you wish to maximize the objective, use a negative ref or scaler value in the config.
- Parameters:
opt_prob (openmdao problem instance) -- openmdao problem instance for current optimization problem
- Returns:
opt_prob (openmdao problem instance) --
- openmdao problem instance for
current optimization problem with objective set
- set_design_variables(opt_prob)#
Set optimization design variables.
- Parameters:
opt_prob (openmdao problem instance) -- openmdao problem instance for current optimization problem
- Returns:
opt_prob (openmdao problem instance) --
- openmdao problem instance for
current optimization problem with design variables set
- set_constraints(opt_prob)#
sets up optimization constraints for the h2integrate optimization problem
- Parameters:
opt_prob (openmdao problem instance) -- openmdao problem instance for current optimization problem
- Raises:
Exception -- all design variables must have at least one of an upper and lower bound specified
- Returns:
opt_prob (openmdao problem instance) --
- openmdao problem instance for
current optimization problem edited to include constraint setup
- set_recorders(opt_prob)#
sets up a recorder for the openmdao problem as desired in the input yaml
- Parameters:
opt_prob (openmdao problem instance) -- openmdao problem instance for current optimization problem
- Returns:
opt_prob (openmdao problem instance) --
- openmdao problem instance for
current optimization problem edited to include a set up recorder
- set_restart(opt_prob)#
Prepares to restart from last recorded iteration if the original problem was set up for warm start
- Parameters:
opt_prob (openmdao problem instance) -- openmdao problem instance for
problem (current optimization)
- Returns:
opt_prob (openmdao problem instance) --
- openmdao problem instance
for current optimization problem set up for warm start