Configuring the Nonlinear Optimization block
Main property page
To open the block property page (the page on which the block configuration is specified), either double click on the block, or right-click on the block and select Block Properties, or alternatively select the block and press alt+enter.
Select block
-
The Selected block combo box at the top will hold a list of all the blocks in the current superblock that can be optimized.
-
A valid block must be selected to configure the rest of the block.
Cost function tab
-
The Nonlinear Optimization block opens on the Cost function tab.
-
The cost function is typed in the Cost function edit box
-
The generate RMS cost function button will open the Generate RMS cost function dialog. This button will be disabled when the Input fields list box contain less fields than the Optimized block output fields list box.
-
To check the cost function expression for errors, click on the Check button next to the edit box. If errors were found, they will be displayed in a message box.
-
The Input fields list box contains a list of all the field names in the input port of the Nonlinear Optimization block.
-
The Selected block input fields list box contain the list of all the field names in the input port of the selected block. These field names will be prefixed with ‘I_’.
-
The Selected block output fields list box contain the list of all the field names in the output port of the selected block. These field names will be prefixed with ‘O_’
-
To minimise the cost function, select the Minimum radio button.
-
To maximise the cost function, select the Maximise radio button.
Generate RMS cost function dialog
-
Click on the Generate RMS cost function button on the Cost function tab to display the Generate RMS cost function dialog.
-
This dialog will help you to generate RMS (Root mean square) cost functions automatically.
-
The block will automatically try to associate fields from the Nonlinear Optimization blocks input port, with fields of the selected blocks output port.
-
Fields that were not matched will have blank entries in the Associated field column in the list control on the left hand side.
-
To assign a field to one of the output fields, select the field you wish to associate in the right hand list box. Then select the field in the left hand list control. Now click on the assign button ‘<’.
-
To remove an association, select the field you wish to remove the association of in the list control on the left hand side. Now click on the ‘>’ button.
-
Click on the OK button to generate the RMS cost function. This button will only be enabled if all the fields in the selected blocks output port are associated with fields in the input port of the Nonlinear Optimization block.
-
Click on the Cancel button if you want to revert back to the original cost function.
Return to top
Examples of generated cost functions:
If you selected the Class as the associated field for O_NewClass field, then the resulting cost function will be:
abs( O_NewClass – Class )
If you had two fields, say O_Output1 and O_Output2 and associated them with Output1 and Output2, the resulting cost function will be:
sqrt( ( ( O_Output1 – Output1 )^2 + ( O_Output2 – Output2 ) ^2 ) / 2 )
Constraints tab
-
The list control will display a list of all the input fields to the selected block. By default all fields will be considered as fields which may be optimized.
-
The list box will list all the fields in the input port of the Nonlinear Optimization block.
-
To change the Minimum and Maximum values of a field, click on the value to open the edit box, and enter the new minimum/maximum value. This edit box will not be shown if the field was selected as a non optimized field.
-
The Nonlinear Optimization block will only consider values for an input field that falls in the range [minimum, maximum].
-
To change the Constant of a field, click on the value to open the edit box. This edit box will not be shown if the field is selected as an optimized field.
-
The Constant value may be any floating point value, or any field name which appear in the right hand list box. (The list of input fields to the Nonlinear Optimization block).
-
To change fields from non optimized fields to optimized fields, select the fields and click on the [Optimize] button
-
To change fields from optimized fields to non optimized fields, select the fields and click on the [Do not optimize] button.
-
To select all the fields in the list control, click on the Select all button.
-
To set the constant value of a non optimized field to the value of the input field, select the non optimized field in the list control. Then select the input field in the list box which will contain the constant value for the fields. Then click on the [<] button.
-
There must be at least one field which can be optimized, otherwise the block will not be runnable.
Optimization trigger tab
-
The Available fields list box will display all the fields in the input port of the Nonlinear Optimization block, which will not be trigger fields for optimization.
-
The Selected fields list box will display all the fields in the input port of the Nonlinear Optimization block, which will be trigger fields for Optimization.
-
To select fields as trigger fields, select the fields in the Available fields list box, and click on the ‘>’ button.
-
To select all the input fields as trigger fields, click on the ‘>>’ button.
-
To deselect fields as trigger fields, select the fields in the Selected fields list box, and click on the ‘<’ button.
-
To deselect all the trigger fields, click on the ‘<<’ button.
-
At least one field must be selected as a trigger field, otherwise the block will not be runnable.
Related topics: