Register External Optimizers

HyperStudy supports external optimizers with Python-based API. In order to use HyperStudy with external optimizers, they must be registered.

Register external optimizers in HyperStudy or by editing the preferences file.

Register External Optimizers in HyperStudy

  1. From the menu bar, click Edit > Register Optimizer.
    The Register External Optimizer dialog opens.
  2. Add an external optimizer.
    1. Click Add External Optimizer.
    2. In the Add dialog, enter a label for the optimizer and click OK.
  3. In the Path column, enter the location of the external optimizer to be registered.
  4. Click Close to exit the external optimizer registration.

Register External Optimizers by Editing the Preferences File

Register external optimizers in the *BeginExternalOptimizerDefaults() section of the preferences_study.mvw file.

  1. In a text editor, open the preferences_study.mvw file.
    Tip: You can find the preferences_study.mvw file in the HyperWorks installation directory under <install directory>/hw/prefinc/.
  2. Search for the syntax *BeginExternalOptimizerDefaults().
  3. If you are working with a Windows operating system, append the first list of *RegisterExternalOptimizer statements. Otherwise, you will need to append the second list of *RegisterExternalOptimizer statements.
  4. Immediately following the existing *RegisterExternalOptimizer statements, register further external optimizers using the following syntax:
    *RegisterExternalOptimizer (label,"varname","python_script")
    where:
    label
    Unique name for the optimizer.
    varname
    Name used within HyperStudy to reference the optimizer.
    Note: This name must be enclosed in double quotes.
    python_script
    Full path of the external optimizer, including file name and extension.
  5. Save the preferences_study.mvw file.

Register scipy_minimize.py in the Preferences File

In this example, the scipy_minimize.pye executable is added to the default list of registered external optimizer for a Windows operating system.
*BeginExternalOptimizerDefaults()
   *RegisterExternalOptimizer(SciPy_Opt, "scipy_minimize", "C:/Temp/scipy_minimize.py")          
*EndExternalOptimizerDefaults()