Understanding Optimization Parameters
This page describes the different parameters to set when creating an Optimization.
Merit Function
- Minimize allows you to get the simulation measurement as close as possible to the target value.
- Maximize allows you to get the simulation measurement as far as possible from the target value.
The Merit function formula is
- Target: Optimization target
- Measure: Measured value of the target
- Weight: level of importance of the target according to the other targets
Mode
Random Search Algorithm
The Random search algorithm is a global optimization method based on random.
The Random search algorithm gives comparable results from one optimization run to another and can address all types of cases.
However, be aware that the random search algorithm has its own termination criteria. If this criteria is met before the termination criteria that you defined, the optimization stops. Indeed, at each optimization run, the algorithm compares the Merit function with the best result found. If after 15 runs, the result is the same, then the search area is divided by two and another run of optimization starts. When the search area is lower than 5% of the original search area, the optimization stops as it becomes inefficient to run optimizations due to convergence time.
Design of Experiment
Unlike the Random Search and the Plugin modes, the Design of Experiment is not an optimization algorithm as you do not have to define a Merit function and Stop Conditions because it only depends on the number of variable values you defined in the Excel file.
Plugin
The Plugin mode allows you to use an optimization algorithm you created yourself.
The Plugin mode is dedicated to advanced users who know how to create an optimization algorithm.
For more information on the Plugin mode, refer to Optimization Plugin. Optimization Plugin chapter will help you understand how to create a plugin algorithm with a complete optimization plugin example.
Variables
Simulation Variables
The Simulation Variables correspond to the Speos Light Simulation parameters which correspond to the numerical parameters of the Speos features from the Light Simulation tab used in the Speos simulation you select for the optimization.
Design Variables
The Design Variables correspond to the Optical Part Design parameters which correspond to the numerical parameters of the Optical Part Design features from the Design tab used in the Speos simulation you select for the optimization
Document Variables
Document Variables correspond to the input parameters that you can create into the SpaceClaim Groups panel.
- A Driving Dimension which is a parameter that has effect on the size or the position of the element.
- A Script Parameter that you created and which is used into a SpaceClaim script.
- Create a script group in the Groups panel.
Write down the script.
You can help yourself using the script Record tool that allows you to record parameters as a script in the script editor window.
- Create and name Script Parameters in the Groups panel.
- Edit the script to replace the parameters with the script parameters.
- Refer to Using Driving Dimensions in Ansys to understand the different ways of creating driving dimensions.
- Refer to Creating a Parameter Group to understand how to add and define a script parameter to a script.
Example: A Driving Dimension modifying the size of a geometry that is not included in the simulation. Setting the Driving Dimension as Document Variable will have no impact on the optimization.
Targets
Target correspond to the output elements on which you want to measure/evaluate/assess the impact of the variables defined.
These targets correspond to measures you created in the XMP results generated from the simulation that you want to include into the optimization. These measures correspond then to your initial measure generated with the configuration of the simulation before the optimization.
Weight: the weight corresponds to the level of importance of the target according to the other targets. The higher the number the more weight the target.
Keep Intermediate Results
Keep intermediate results allows you to keep the results corresponding to the different optimization iterations.
A subfolder is created with the name of the optimization function in the SPEOS output files directory. There is one result saved per iteration.
Use Maximum Time
Use maximum time allows you to define the maximum time in seconds to spend on the optimization process.
In case the time is over and the last simulation run has not yet finished, the optimization process finishes the simulation before stopping.
Use Maximum Number of Simulations
Use maximum number of simulations allows you to define the maximum number of simulations to run before stopping the stopping the optimization process.