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
-
From the menu bar, click .
The Register External Optimizer dialog opens.
-
Add an external optimizer.
- Click Add External Optimizer.
- In the Add dialog, enter a label for the optimizer and click OK.
- In the Path column, enter the location of the external optimizer to be registered.
- 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.
-
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/.
-
Search for the syntax
*BeginExternalOptimizerDefaults().
- 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.
-
Immediately following the existing
*RegisterExternalOptimizer statements, register further
external optimizers using the following syntax:
where:*RegisterExternalOptimizer (label,"varname","python_script")
- 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.
- 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()