This tutorial allows you to solve the Kursawe function using ASCII, Python, MATLAB, and Excel in optiSLang.
This tutorial demonstrates how to do the following:
Calculate the first Kursawe function using Python
Calculate the first part of the second Kursawe function using MATLAB
Calculate the second part of the second Kursawe function using ASCII
Combine all functions using Excel
Before you start the tutorial, download the kursawe_integrations zip file from here , and extract it to your working directory.
To set up and run the tutorial, perform the following steps:
- Creating a New Project
- Selecting the Python Input File
- Selecting the Python Parameters and Response
- Editing the Python Parameter Properties
- Defining the Python Optimization Criteria
- Completing the Python Solver Wizard
- Saving the Project
- Starting the MATLAB Solver Wizard
- Selecting the MATLAB Input File
- Selecting the MATLAB Parameters and Response
- Completing the MATLAB Solver Wizard
- Starting the ASCII Solver Wizard
- Selecting the ASCII Input File
- Defining the ASCII Input Parameters
- Selecting the ASCII Output File
- Selecting the ASCII Output Slot Value
- Defining the ASCII Optimization Criteria
- Importing the ASCII Solver Call File
- Completing the ASCII Solver Wizard
- Completing the Excel Integration
- Creating the Solver Chain Template
In the Select input file dialog box, browse to the kursawe_integrations folder and select kursawe1.py.
Click
.
From the Detect assignments drop-down list, select .
In the Python 2 table, select rows x_1, x_2, and x_3 and drag them to the Parameter pane.
In the Python 2 table, select row kursawe_1 and drag it to the Responses pane.
Click
.
To highlight all of the parameters in the table, do one of the following:
Click the name of the first parameter, press Shift, and then click the name of the parameter the last row.
Click the name of the first parameter, then with the mouse key pressed, pull down to the last parameter and release the mouse key.
While pressing the Shift key, double-click the range numbers in row 3.
Change the lower bound to
-5
and the upper bound to5
.Press Enter.
The range of all of the parameters changes to -5 and 5.
Click
.
Do not adjust or add to the currently displayed values for parameters, responses, and criteria.
Click
.
Leave the Create a template from solver chain check box clear. You will create a solver chain template in a later step.
Click
.The solver chain is displayed in the Scenery pane.
To save the project, click .
Browse to the location to save the project and type a project name in the File name field.
Click
.
From the Wizards pane, drag the Solver wizard to the kursawe1 system and let it drop.
From the solver list, click
.
In the Select input file dialog box, browse to the kursawe_integrations folder and select kursawe2_1.m.
Click
.
From the Detect assignments drop-down list, select .
In the MATLAB table, select rows x_1, x_2, and x_3 and drag them to the Parameter pane.
In the MATLAB table, select row kursawe_2_1 and drag it to the Responses pane.
Click
.
Do not adjust the current parameter properties.
Click
.Do not adjust or add to the currently displayed values for parameters, responses, and criteria.
Click
.Leave the Create a template from solver chain check box clear. You will create a solver chain template in a later step.
Click
.The extended solver chain is displayed in the Scenery pane.
To save the project, click .
From the Wizards pane, drag the Solver wizard to the kursawe1 system and let it drop.
From the solver list, click
.
In the Select input file dialog box, browse to the kursawe_integrations folder and select kursawe2_2.s.
Click
.
Select the Copy Mode check box.
In the text editor, highlight the value of x_1 (0.00000000).
In the Name list, select x_1.
To register the parameter, click Add.
Repeat this procedure for parameters x_2 and x_3.
Click
.Do not adjust the current parameter properties.
Click
.
In the Select output file dialog box, browse to the kursawe_integrations folder and select kursawe2_2.txt.
Click
.
From the File format list, ensure is selected and click .
In the text editor, highlight the value in row 6 (0.00000000)
Click the arrow next to Use as response and select from the menu.
The value is displayed in the Output slots pane.
Click
.
Do not adjust or add to the currently displayed values for parameters, responses, and criteria.
Click
.
To the right of the Absolute path field, click the orange folder.
Browse to the kursawe_integrations folder and select kursawe.bat.
Click Open.
Click Import.
Click
.
Leave the Create a template from solver chain check box clear. You will create a solver chain template in a later step.
Click
.The extended solver chain is displayed in the Scenery pane.
To save the project, click .
Under Modules, expand and .
Drag the Excel integration node onto the output of the MATLAB solver output and let it drop.
From the menu bar, select
> > .Hover over the right side of the kursawe_2_1 node.
Click kursawe_2_1 and drag it onto New slot on the left side of the Excel node.
Hover over the right side of the kursawe_2_2 node.
Click kursawe_2_2 and drag it onto New slot on the left side of the Excel node.
Double-click the Excel node.
To the right of the Absolute path field, click the orange folder.
Browse to the kursawe_integrations folder and select kursawe2_combine.xls.
Click Open.
Switch to the Spreadsheet tab.
Drag the kursawe_2_1 input slot onto the B1 cell.
Drag the kursawe_2_2 input slot onto the B2 cell.
Highlight cells A5 and B5 and drag them to the Responses pane.
To close the dialog box, click
.