11a. User Customized Optimization Example

WISDEM offers a long list of design variables, figures of merit, and constraints that users can call in their analysis_options.yaml. The full list is specified in the modeling_options.yaml <https://github.com/NLRWindSystems/WISDEM/blob/develop/examples/02_reference_turbines/modeling_options.yaml>. In addition, WISDEM now offers the option to build your own optimization problem by setting any available input as a design variable and any available output as either a constraint or a figure of merit. This example 11 shows how to build your customized analysis_options.yaml.

In this example, we start from a 5MW land-based wind turbine that was developed within the Big Adaptive Rotor project (for more details refer to https://github.com/NREL/BAR_Designs) and we ask WISDEM to optimize the rated power of the turbine to minimize the levelized value of energy (LVOE) while keeping the turbine capital cost (TCC) within certain limits. Note that the focus of this example is on the capability of WISDEM, more than on the actual problem setup.

The focus of this example is on the file analysis_options_custom.yaml.

The field general lists the standard output folder and naming convention.

general:
    folder_output: user_custom
    fname_output: BAR_USC_user_custom

The field design_variables shows how the user can define a list of design variables. Here the user will need to identify what input to select among the ones available in WISDEM. To do so, it might be useful to open an existing output file of WISDEM (if you do not have any, run any other example) and parse the file looking for your desired design variables. Note that for every entry, the user should set the desired values for lower and upper bounds. In addition, a reference value should be specified for quantities whose order of magnitude is not 1. Check the OpenMDAO user manual and tutorials if you are not familiar with this field. Lastly, for design variables made of arrays the user can also specify the indices of the array that contain the active design variables. Leave out this entry for scalars and for arrays where each element should be actively optimized.

design_variables:
    user:
      - name: configuration.rated_power
        lower_bound: [4.e+6]
        upper_bound: [6.e+6]
        ref: [5.e+6]
        # indices:
        

The merit_figure consists of only one entry (not a list of entries!) and in this case we set LVOE as the metric to be minimize. If you want to maximize a metric, set the max_flag to True. Again, quantities far away from 1 should have the ref entry set.

merit_figure_user: 
    name: financese.lvoe
    max_flag: False
    ref: 1.e-2


The field constraints lists the user-defined constraints. In this example we ask for the TCC to stay within 1,000 and 1,500 USD/kW.

constraints:
    user:
      - name: tcc.turbine_cost_kW
        lower_bound: [1.0e+3]
        upper_bound: [1.5e+3]
        # indices: 

The yaml file is closed with some standard optimization options listed in the driver section.

driver:
    optimization:
        flag: True         # Flag to enable optimization
        tol: 1.e-5          # Optimality tolerance
        # max_major_iter: 10  # Maximum number of major design iterations (SNOPT)
        # max_minor_iter: 100 # Maximum number of minor design iterations (SNOPT)
        max_iter: 1         # Maximum number of iterations (SLSQP)
        solver: SLSQP       # Optimization solver. Other options are 'SLSQP' - 'CONMIN'
        step_size: 1.e-3    # Step size for finite differencing
        form: central       # Finite differencing mode, either forward or central

recorder:
    flag: True             # Flag to activate OpenMDAO recorder
    file_name: log_opt.sql # Name of OpenMDAO recorder

For more details about this example, please feel free to post questions on GitHub!