3.1.2   Variables

Optimisation Variables can be configured in the Variables tab of Configure Optimiser dialogue and are displayed in the Variables list.

The Variables list contains all variables defined in the UDO script and its optimisation settings. If the variable is the string variable – it will be not available for the optimisation because string variable cannot be modified during optimisation.

The Edit button invokes Edit Variable dialogue for changing parameters of the selected variable.

Only enabled (checked) variables will be used in the optimisation or parameters sweep.

The Value parameter means that it will be the default initial value for the optimisation (unless the default value will be taken from cache what is indicating Starting Point - best point from cache message).

The Value parameter for parameters sweep (Grid Search option) will change to Steps per Range what indicates number of values taken for parameters sweep from the declared Lower ÷ Upper range.

The Lower and Upper parameters mean minimum and maximum acceptable value of the variable.

The Resolution for the variable is the user’s declaration that changes in variable value by less than Resolution will not bring significant changes to the goal function. Thus QW-OptimiserPlus will not be trying to calculate the goal function for a particular set of values of the variables, if its cache contains a result of calculation with the values of all variables within their respective resolutions from this set of values. Defining coarse resolution saves computing time, but setting it too coarse may decrease the accuracy of finding the Goal Function minimum.

The Show parameter indicates if variable name and value at consecutive optimisation steps will be shown in Optimiser Info during the optimisation process. This is controlled by Show and Hide buttons.

The choice between optimisation and parameters sweep can be done using Optimise and Grid Search options.

The UDO Path displays the path to the UDO script.

 

By default, when configuring a new optimisation project (which does not have its projectname.xyp file), the software first assumes the first case and looks for the UDO file: projectname.udo in the project directory. If such a UDO file exists, the projectname.udo appears in the UDO Path line. The parameters defined in its header are automatically loaded as variables into the Variables tab. Their names will be shown in the Name column. Their values in the Value column are taken as follows:

- if the projectname.ud3 file exists in the project directory, and the name of a particular variable is found in this file, then the corresponding value is also taken from this file;

- if the projectname.ud3 file does not exist in the project directory, or the name of a particular variable is not found in this file, then the default value of this variable from the UDO file header is taken.

The projectname.ud3 file helps maintaining consistency of all variable values:

- values last set by the user in QW-Editor,

- values shown in the Variables tab,

- and values actually used during optimisation.

The projectname.ud3 file is saved upon each Save or Export command of QW-Editor, if the project contains an object of the same projectname. Hence projectname.ud3 contains the values of parameters last set by the user for this object in the project.

Note that the values of variables Enabled for optimisation are provided at each optimisation step by QW-OptimiserPlus to QW-Editor, which modifies the geometry accordingly and creates a new mesh for the next simulation. However, the values of variables not enabled are not provided by QW‑OptimiserPlus and QW-Editor would maintain their values saved in the projectname.pro file. These values may be different than those in the projectname.ud3 file, and visible in the Variables list, if changes were made by the user between the last Save and the last Export command in QW-Editor. If the projectname.ud3 file exists in the project directory, and the object named projectname exists in the project, then parameters of this object are overwritten with those taken from the projectname.ud3 file.

If the projectname.udo file does not exist in the project directory at first configuration of the optimisation, then theUDO Path line is empty. The user may load variables from a different UDO file using Load UDO… button. It opens a browser for locating a proper UDO file. Note that a file of any name (but with *.udo extension), from any directory may be selected. After choosing *.udo file, the UDO Variables dialogue will appear.

Imagine that variables of an optimisation project are configured with a specific UDO file, and then this file is accidentally deleted. When the user re-enters the Configure Optimiser dialogue and its Variables tab to re-configure the variables, a warning UDO Path - NOT FOUND will appear.

If the first parameter from the loaded UDO file is a string, then the software suspects it may be the object name. Therefore, if the value of this variable is different than the project name, a warning will be issued upon pressing OK button in the Configure Optimiser dialogue. The user may ignore this warning if a different string variable, not the object name, was intentionally defined as the first parameter in the UDO file. Otherwise the object name should be changed to be the same as the project name.

 

During the optimisation process, QW-OptimiserPlus accumulates the results of optimisation for various values of the optimised variables in Optimiser Cache. If the user has previously optimised a particular project, and then configures it again from a modified or different UDO file, the existing optimisation cache becomes invalid. Thus after Load UDO… command, QW-OptimiserPlus prompts the user to clear the cache.

 

If there is no cache for the optimised project, optimisation will start from the point corresponding to values of the enabled variables shown in the Value column andtherefore the line in its lower part provides a corresponding message: “No cache file / Starting point – from Value column in Variables Tab”. If the project has been previously optimised, and QW-Optimiser finds a valid cache file, then the starting point for optimisation will be the best point from cache. The message will say: “Cache file present / Starting point – best point from cache”. However, if any of the enabled variables is changed via the Edit button, optimisation will start from the point corresponding to values of enabled variables shown in the Value column, even if cache exists. The message will say accordingly: “… / Starting point - from Value column in Variables Tab”.

The Configure Optimiser dialogue technically allows one to Edit all variables. Note however that changing any settings for variables not included in the optimisation (for which the Enable box is not checked) does not have any effect on the optimisation process. If such changes have been made by the user, QW-OptimiserPlus will issue a warning upon OK command from the Configure Optimiser dialogue.