ISIGHT: Chapter 4 getting started with iSIGHT Optimization

Source: Internet
Author: User

4.1 basic isight Optimization Problems

4.1.1 conditions for isight integration software

In general, as long as it is an executable file (*. EXE, *. BAT) isight, it can be driven. However, in order to automate the optimization process, the integrated numerical analysis software must be able to solve and compute the problem in the background, and the input and output files that explicitly contain the optimization variables must be included.

4.1.2 types of commonly used input files

For the currently available numerical analysis software, there are two types of files that can be used as input files:

Model Information File

As mentioned above, the numerical analysis software is generally divided into three modules. After numerical modeling, the pre-processing program generates a model information file as the input file of the solution module, this model file contains various information about the numeric model. Therefore, this file can be used as an input file during optimization. For example, MSC. Marc *. dat file, LS-DYNA *. K file, etc.

Command stream or process record file

In order to implement parameter modeling and analysis, many numerical analysis software also provides corresponding command operations while providing menu operations, and can read the command programming file for modeling and analysis, this file is often called a command stream file. In addition, some software can automatically record each step of the user's operations and output the corresponding command stream file. The software can also read the file for modeling and analysis, this command stream file is often called a process record file.

When model information files are used as input files for optimization, the model creation process is absent during each iteration, so the efficiency is relatively high! In the optimization of using the command stream or process record file as the input file, it takes a relatively long time to calculate it from modeling in each iteration analysis. However, it is precisely because each iteration analysis starts modeling and analysis from the beginning. Therefore, in the optimization design of relevant variables, modification to the model information file often cannot correctly reflect the changes of the model, therefore, the process record file is used as the input file.

4.2 general steps for isight Integration Optimization

Isight is used in engineering for Integration Optimization, including preparation, process integration, variable and algorithm settings, and process monitoring and result analysis.

4.2.1 preparations

Preparations before Integration Optimization include selection of numerical analysis software, initial calculation, and familiarity with related files.

Select appropriate numerical analysis software for optimization design and calculation based on the analysis and solving tasks required for optimization problems. When selecting integrated software, consider the following principles:

(1) Functions of the software. This is the primary issue. You should have a thorough understanding of whether the selected software has the required functions and meets the requirements of the isight integrated software.

(2) pre-and post-processing functions. This is very important. It is related to the ease of operation. To a certain extent, it is also an important factor that determines whether the computing is successful or not.

(3) Environment and Computer Configurations required by the software. This is also necessary for the normal operation of the software, of course, the software price should also be considered and compared.

After selecting the numerical analysis software, you often need to perform an initial model calculation in the numerical analysis software to generate the input and output files required for the next software integration.

Before proceeding to the next step of software integration, you must be familiar with the driver commands, input and output file formats for the integrated software solutions, it is necessary to clearly design the variable parameters, the position of the target function value in the input and output files, and the data format.

4.2.2 isight software integration

This part of work is to set the isight integration software code, specify the input and output files of the integrated software, and specify the isight to modify or read the location and format of the input and output files.

4.2.3 design variables and algorithm settings

It is also called mathematical modeling. Its main contents include optimization variable settings, Optimization Methods and Policy Selection. This part is the core work in optimization design, especially the selection of optimization methods. It is related to the efficiency of Optimization Computing or even success or failure, therefore, you must properly set optimization algorithms based on the characteristics of actual engineering problems during analysis.

4.2.4 solution and result analysis

During the integration and optimization process, the isight software provides a function for users to monitor the optimization process in real time. It provides a graphical representation of the target function as the design variable changes, such as charts and curves, and provides the software integration Daily Value file.

The above is only a simple explanation and explanation of the isight integration process. For more details, refer to the following chapters.

4.3 getting started with isight Optimization-water cup Optimization

The following uses a specific example of water cup optimization to describe in detail the operation steps of each process of integration optimization. We hope that through this example, the reader can have a preliminary understanding and grasp of iSIGHT integration optimization.

4.3.1 Problem Description

Have you paid attention to common water cups? The bottom is round. Which of the following is stamped. Take a closer look, you will find that older water cups have a common feature: the bottom diameter = the height of the water cup.

 


Figure 4.3.1 simplified water cup Model

Why? The reason is very simple because only when this condition is met can the capacity of the cup be maximized when the raw material consumption is minimal. No, under certain conditions of materials, if the bottom area of the water cup is large, its height must be small. If the height increases, the bottom area is too big. How can we reconcile the conflicts between the two? In fact, this reflects a complete optimization process.

4.3.2 problem hypothesis and Model Simplification

Based on experience, we can consider that the cost of water cups is directly proportional to the surface area under certain conditions of materials. In order to control the cost, we can limit the cost. So our design problem is how to reasonably set the geometric size of the water cup to get the maximum volume at a certain cost.

The above problem is described in the optimization language:

Maximize V = π R2H

S. t S = 2 π RH + 2 π R2 <100

4.3.3 selection of integrated software

.

Before creating your own optimization task, you must first understand the numerical analysis software to be integrated. The main content includes the file location, driver command format, the format of the input and output files and the location of the optimization variables.

In this exercise, the executable program (cup.exe) is used to complete the computation. The content of the required computation is as follows:

Program Cup

Implicit none

Real R, H, Area, V

Character (len = 20): filenamein = "InPut.txt", filenameout = "OutPut.txt"

Logical alivein, aliveout

Inquire (file = filenamein, exist = alivein)

Inquire (file = filenameout, exist = aliveout)

If (alivein. and. aliveout) then

Write (*, *) "The required file exists! "

Else

Write (*, *) "The required file does not exist! "

End if

Open(unit%10,file%'input.txt ')

Read (10, "(15X, F12.9,/, 15X, F12.9)") R, H

Area = 2*3.14 * R * H + 2*3.14 * R

V = 3.14 * R * H

Open(unit%10,file%'output.txt ')

Write (10, "('the Area is: ', F17.9,/, 'the volume is:', F12.9)") Area, V

Stop

End

 

In this example, the integrated file is cup.exe under "D: \ Cup \ CupProgame. The execution process is shown in 1.

 

 

 

Figure 4.3.2 execution flowchart of Cup.exe

4.3.4 iSIGHT Integration Optimization

Before establishing an Integration Optimization Project, we created a folder Cup on disk D to store data files during the optimization process. And rename it CupInTemp. dat.

Tip:It is difficult for iSIGHT to recognize Chinese characters like most English software. Therefore, Chinese names cannot be obtained or stored in Chinese paths when naming a file. Otherwise, errors may occur during compilation!

4.3.4.1 add integration code

After the iSIGHT software is started, the task management page shown in 4.3.3 is displayed. The page is blank because we have not created an optimization task.

Figure 4.3.3 Task Management page

Figure 4.3.4 integration code addition page

2. Click the Process Integration button in Figure 4.3.3 To Go To The add integration code page and automatically create the task "Task1", as shown in 4.3.4.

3. Click the integrated code button on the toolbar in Figure 4.3.4 to add the integrated code. A file named"Simcode0"The integration code block appears in the workspace on the right of the Integration dialog box, as shown in 4.3.5.

Figure 4.3.5 interface after the integrated code is added

Note: To facilitate the description, we will use blocks to describe the icons on the Right of 4.3.5.

4. Double-click the task block in Figure 4.3.5 to display the integrated code, as shown in 4.3.6.

Figure 4.3.6 integrate code content

In the design process, we need to set the basic information (location and name) of the software used, and develop the rules for iSIGHT software to call the software, so as to ensure the smooth integration optimization.

5. Click the attribute button on the left of the integrated code block to bring up the code attribute Setting dialog box, as shown in 4.3.7.


Figure 4.3.7 integration code property Setting Dialog Box

Figure 4.3.8 path Setting Dialog Box

In Figure 4.3.7, the "simulation code-(path and) name" text box is used to enter information about the integrated code, including the name and location of the integrated code; the "Optional argument" option is used to input auxiliary commands for driver integration code, because some numerical analysis software also needs auxiliary commands to specify some information when calling the solver, for example, the name of the input or output file. The "Elapsed time limit (seconds)" option is used to set the overflow time. When the integrated code called by the software does not end the solution within the specified time, it considers the system error and ends the task.

Figure 4.3.9 attribute dialog box after adding the integrated code

6. Click "file menu" in Figure 4.3.7, and select the "Cup.exe" file under "D: \ Cup \ CupProgame" in the pop-up dialog box.

7. Click "OK" to bring up the "set new task path" dialog box, as shown in 4.3.8.

In order to facilitate management, we often create a separate file with a different location from the Integrated code to store the optimized data during optimization, at this time, the software asks the user if they want to put the optimized data in the folder where the integrated code is located. If the user confirms it, click "yes". If you want to place it in another location, click "No" and set the location.

8. Click "No" and create "D: \ Cup" as the working path of the problem. The interface shown in Figure 4.3.9 is returned.

9. Click "OK" in Figure 4.3.9 to return to the Process Integration page, as shown in Figure 5.5.10.

As shown in figure 5.5.10, the name of the integrated code block is changed to "Cup.exe"

4.3.4.2 define the input file

In Integration Optimization, defining only the information of the integrated code is often not enough, because iSIGHT software needs to call the integrated code multiple times with different R and H values according to the optimization algorithm, therefore, we need to "tell" iSIGHT how to operate these files.

1. Click the attribute button of the input block "Input0". The enter attribute dialog box is displayed, as shown in 4.3.11.

Before the iSIGHT software modifies the input file rules, we need to specify the work object, that is, define the input file information, including the input file name and storage location.

 

Figure 4.3.10 Process Integration page after the integrated code is added

2. Click the "File" button next to the "Template File" text box, and then select "CupInPutTempt. dat" under "CupPrograme" in the pop-up dialog box, and then confirm.

3. Click the "File" button next to the "Input File" text box, select "CupInPut.txt" under "CupPrograme" in the pop-up dialog box, and confirm. The input properties dialog box 4.3.12 is displayed.

Figure 4.3.11 enter Attributes dialog box

Figure 4.3.12 set input properties dialog box

Click "OK" in Figure 4.3.12 to return to the Process Integration page. Correspondingly, the input block is named "Input.txt ".

4. Click the "Input.txt" block content button "Input.txt" to bring up the file analysis dialog box, as shown in 4.3.13.

Contents. In addition, there is an icon in the right half, which represents the mouse in iSIGHT.

Figure 4.3.13 Input File Analysis dialog box

Next we will use the File Analysis dialog box to create an internal command to "tell" how to modify the input file.

5. Select The character "The radius is:" With The mouse, The action Type Selection dialog box is displayed, as shown in 4.3.14.

Figure 4.3.14 action Type Selection dialog box

Note: When selecting a character, it must contain spaces behind the colon.

As shown in figure 4.3.14, tag Search is activated and The selected character "The radius is:" also appears in The Search for text box. In the figure, the "ction" option is used to define the Direction of the mouse movement.

6. Click"Apply", Which is equivalent to" telling "move The mouse to The end of The character" The radius is.

Figure 4.3.15 replace TAG content

7. Activate"Replace"Replace the tag, as shown in 4.3.15.

8. Click"Replace next word"The front box, that is, let The software Replace The value behind The character" The radius is.

9"With"Enter: Radius in the text box, And make sure" Forward "in" Direction "is selected. After confirmation, return to the input file analysis dialog box, as shown in 4.3.16.

Figure 4.3.16 Input File Analysis dialog box

We can see that the Left action detail area lists the mouse actions we have defined, and the right side shows this change at the same time.

5 ~ 9 is used to search for The character "The radius is:" in The input file, and then use The value of The variable "Radius" to replace The value after The character "The radius is, the radius of the cup in the input file is modified.

The modification rules for the height of the water cup are formulated in the same way as above and will not be repeated again. The final result is 4.3.17.

Figure 4.3.17 final interface of Input File Analysis

 

Figure 4.3.18 output file attribute Setting Dialog Box

10. Click "Save (need)" under the "File" menu in Figure 4.3.17 to Save the File, and then click "Close" under the same menu to return to the process integration interface.

We have completed the analysis of the input file. Next we will set the output file accordingly to "tell" How isight operates on it.

4.3.4.3 output file Analysis

1. Click the attribute button of the output block "output0" to bring up the INPUT attribute dialog box, as shown in 4.3.18.

2. Click "file" in Figure 4.3.18, select "output.txt" under "cupprograme" in the pop-up dialog box, and return to the process integration interface after confirmation.

3. Click "output.txt" to bring up the file analysis dialog box, as shown in 4.3.19.

4.3.19 output file Analysis page

4. Select the character "the area is:" With the mouse, the dialog box shown in 4.3.20 is displayed.

Figure 4.3.20 action Type Selection dialog box

5. Click "Apply" under figure 4.3.20 ".

6. Click the reading tab in Figure 4.3.20, as shown in Figure 4.3.21.

Figure 4.3.21 read the label content

7. In the "store into parameter" text box, enter "area" and click "OK" to return to the file analysis dialog box 4.3.22.

Figure 4.3.22 output file analysis dialog box

4 ~ The function of 7 is to let the software search for the character "the area is:" In the output file, then read the value behind it and assign the value to the variable "area ".

 

Figure 4.3.23 output file analysis dialog box after setting

The rule for setting another value in the result file is similar to the above and will not be repeated here. The final output file analysis dialog box 4.3.23 is shown.

8. Click "Save (need)" under the "file" menu in Figure 4.3.23 to save the file, and then click "close" under the same menu to return to the process integration interface, 4.3.24.

The arrow in the figure indicates the data flow direction in an iteration. Double-click the arrow above the block "Input.txt" to display the data flow dialog box shown in Figure 4.3.25a. Figure a) indicates that T sends the parameters "Heihgt" and "Radius" to the input file "Input.txt.

We have completed all the work of process integration.

 

Figure 4.3.24 Process Integration page

A) B)

C) d)

4.3.25 data stream window

4.3.4.4 optimize variable and algorithm settings

In order to complete software integration and data flow definition, we will use the variable dialog box, task Security Settings, and database dialog box to optimize the change, Volume algorithm, and some auxiliary options.

1. Click "work bar" on the task management page"Parameters"Button, variable dialog box, as shown in 4.3.26.

In Figure 4.3.26, "Obj" is the target function option, which is used to set the target function and its properties. "type" is used to set the types of optimization variables, including integer, discrete, and discrete; "Upper (Lower) bound" is used to define the Upper (Lower) Limit of the variable, while "Current Value" is used to set the initial Value of the variable.

2. Click the gray button at the intersection of the "Obj" column and "Volume" line to turn the gray button into a downward arrow (arrow down, indicates that you want to make an appointment with the smaller value of the variable.) Click the next button to turn it into an up arrow (indicating that you want to make an appointment with the larger value of the variable ).

3. Click the gray block on the left of the intersection of the row where the variable "Area" is located and the "Upper Bound" column, and enter the value 100 in the column on the right.

Figure 4.3.26 variable setting page

5. Enter the initial values and upper and lower limits in the row where the variable "Radius" is located, which are 0.5, and 10 respectively.

Figure 4.3.27 optimization variable settings

6. Enter the initial values and upper and lower limits in the row where the variable "height" is located, which are 0.5, and 10 respectively.

After the preceding settings, the variables 4.3.27 are shown.

After the variables are set, the next step is to select the optimization solution.

1. Click the task solution button in the work bar of the task management interface. The task solution dialog box is displayed, as shown in 4.3.28.

In Figure 4.3.28, the task solution details area on the left is shown. in the upper part of the right is the task setting area, while in the lower part is the optimization algorithm details area.

The purpose of this example is to find the design size that can maximize the capacity of the water cup. Therefore, select "optimization" in the "performance" block as the task ".

In addition, because our problem is relatively simple, we can use the software recommendation algorithm to obtain the desired results.

2. Select "optimization" in the "performance" block for the task, and click "OK" at the bottom to return to the task management page.

Figure 4.3.28 task solution dialog box

4.3.4.5 database option Definition

During the execution of the Design Exploration Plan, a large amount of data is generated during the analysis of design issues. The data can be stored in isight database files, and database files can be generated automatically or specified by the user. This greatly enhances the operation and management flexibility, it greatly reduces the time required to obtain a better feasible design scheme.

Figure 4.3.29 database Settings dialog box

Perform the following steps to configure a database:

1. Click "Database" in the work bar on the task management page."Dialog Box shown in Figure 4.3.29 is displayed.

In Figure 4.3.29, the "database mode" option is used to set the storage format of the database in iteration. "APPEND" is the continuation mode, and "Overwrite" is the overwrite mode. The "database storage option" option is used to set the data storage content and format.

2. In the "Select Database File Name" text box, enter the Database Name: Cup. db.

3. Click "OK" at the bottom of Figure 4.3.29 to return to the task management page.

4.3.4.6 process monitoring settings

1. Click "work bar" on the task management page"Monitor"Monitoring button, the monitoring Settings dialog box shown in 4.3.30 is displayed.

Figure 4.3.30 monitoring Settings dialog box

We want to know the changes of each design variable in the design search process, so we only need to list the values of each variable in the form of a table.

Figure 4.3.31 insert table dialog box

  1. Click"Table"Table, the insert table dialog box shown in Figure 4.3.31 is displayed.

3. Select "Table Type"Custom", And click" OK "to return to the monitoring Settings dialog box, as shown in 4.3.32.

Figure 4.3.32 monitoring Setting dialog box after table insertion

4. Right-click the table"Custom table", Select" in the pop-up menu"Fit to window"Option, then the final monitoring interface 4.3.33 is shown,

Figure 4.3.33 Process Monitoring page

4.3.4.7 perform computation

Before executing the computation, we need to save the file.

1. Set the task management interface to the current interface, and click "Save" under the "File" menu to Save.

2. Click "Execute" on the toolbar of the task management interface to start the task execution.

3. Reset the task monitoring interface to the current working interface to view the design search process in real time.

After more than calls to cup.exe, the analysis is complete, as shown in the final monitoring page 4.3.34. At the end of the solution, the execution result report is displayed, as shown in 4.3.35.

Figure 4.3.34 monitoring page at the end of Solution

Note: The most specific solution result in Figure 4.3.35 is not necessarily the optimal one.

Figure 4.3.35 task execution result report

4.3.4.8 view the optimal solution

The purpose of our solution is to obtain the radius and height that can maximize the capacity of the water cup. Therefore, we need to know the values of these variables corresponding to the optimal solution. The following two methods are available:

1. view the task execution result report in Figure 4.3.35;

2. Click the parameter button on the task management interface to go to the variable Setting dialog box. In this example, the Parameter Setting Dialog Box 4.3.36 is displayed. The value corresponding to each parameter in the figure is the optimal solution corresponding to the optimal result.

 

Figure 4.3.36 Parameter Setting dialog box after task completion

4.4.3 Result Analysis and Evaluation

The most fundamental requirement of a design scheme is that it is feasible and can be optimized only on the basis of feasibility. Therefore, we must evaluate the correctness and reliability of the obtained optimal solution.

In this example, the exact solution can be obtained by using the mathematical method. Next we will solve it. Based on actual experience, our optimization model is equivalent to the following model:

(1)

(2)

Available in (2) format,

(3)

Sort (3) into (1:

(4)

For the Extreme Value problem where formula (4) is a polynomial, the radius straight when the maximum value is obtained can be obtained through the derivation of it:

(5)

The formula (5) is brought into (3) and the formula H ≈ 4.6743 can be obtained.

We use iSIGHT to obtain the corresponding optimal variable values of 2.3041 and 4.6067. The differences between the two values are 0.0086% and 1.446%, respectively. It can be seen that the iSIGHT optimization results are completely reliable! However, let's give an answer to our first question.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.