You are on page 1of 35

1

Design Optimization Tutorial

Previous

Index

Next

1 Contents
This tutorial will allow the construction of a complete process flow on a simple case. The problem is related to the optimization of a welded beam, with references to: minimum cost minimum deflection at beam end satisfying constraints related to admissible stress Source code is provided to allow compilation on any platform (a C compiler is required) 1.1 Problem definition 1.2 Starting the system 1.3 Design Logic Creation 1.4 Handling Input Data 1.5 Handling Output Data 1.6 Actions Creation 1.7 Creating Constraints 1.8 Creating Objectives 1.9 Design of Experiment 1.10 Scheduler (Optimizer) 1.11 Run 1.12 Assessment

Previous

Top

Next

ES.TEC.O. S.r.l. ENGIN SOFT TECNOLOGIE PER L'OTTIMIZZAZIONE

Design Optimization Tutorial

Previous

Index

Next

1.1 Problem definition


As a general remark the user should think carefully to what are the free parameters of the problem and what are the measurable quantities of it. In this case the beam to be optimized is the one shown in Fig. T1.1.1.

Input Data 5 geometrical parameters (L, S, H, T, B) Load Value (F) Young Module (Young) Material Cost per Volume unit (Mc) Wel Cost per Volume unit (Wc) Output Data Displacement at the end of the Beam (Disp) Max Shear Stress (MaxS) Max Normal Stress (MaxT) Material Volume (Mvol) Weld Volume (Wvol) Fig. T1.1.1: a case of study. It is a rectangular section beam welded at one end and loaded at the other end. There are 5 parameters defining the geometry, one load value, the young modulus of the material, the weld and material costs (per unit volume).
3

The simulation program will provide the displacement of the beam, the maximum shear and normal stresses, the volume of the weld and of the beam. From the data flow point of view there will be 9 input values and 5 output values in total. The program, a sample of input file, and a sample of output file are available in the directory:
/.../FRONTIER25x/doc/html/tutorial/project

Previous

Top

Next

ES.TEC.O. S.r.l. ENGIN SOFT TECNOLOGIE PER L'OTTIMIZZAZIONE

Design Optimization Tutorial

Previous

Index

Next

1.2 Starting the system


To start the system, a proper environment should be settled. This can be done as follow: for sh, ksh users
export PATH=/.../FRONTIER25x/bin:$PATH

for csh, tcsh users


setenv PATH=/.../FRONTIER25x/bin:$PATH

for Microsoft Windows users, click on modeFRONTIER icon. Now the system can be activated by typing frontier with the following options:
Usage: frontier [options] [project file] Options: batch name.prj verbose nConcDes n clearDesDir evalDuplDes delErrorDes rsmPercentage r priority p nobuffer unixshell classic version fullversion help

Specify the project file to run in batch. The verbose output. Number n of Concurrent Design Evaluations [1,128] (Default=1). Clear the design directory after evaluation. Evaluate the already present designs. Delete the error designs from data base. RSM r Percentage [1,100] (Default=0). Priority of the running processes (0=High,19=Low) (Default=0). The Display double buffering is disabled. Uses an external Unixlike shell (Windows only). Uses The Classic Frontier Look and Feel. Prints out the Frontier version number. Prints out the Frontier full version data. This help screen.

The modeFRONTIER welcome screen will pop up and a noname.prj project is loaded.

Previous

Top

Next

ES.TEC.O. S.r.l. ENGIN SOFT TECNOLOGIE PER L'OTTIMIZZAZIONE

Design Optimization Tutorial

Previous

Index

Next

1.3 Design Logic Creation


The first project tool to be used is the Process Flow (Fig. T1.3.1).

Fig. T1.3.1: the Process Flow window. This can be activated by clicking on the corresponding tab identified by the icon or selecting Project|Process Flow from the menu. The window is divided into three parts: the top part ("Graphic Flow", marked in a aqua box): it is the desktop where the logic is created. the bottom part ("Logic Log/Summary", marked in a yellow box): click on one of the tabs to toggle between their respective panels.
6

The "Logic Log" panel shows a text commenting the logic created so far and warnings or errors detected by the justintime logic compiler. The "Summary" panel shows a brief summary of the project, about its components and their relevant properties; thus it's possible to keep the entire process logic under control with just a glance. The left part (a "tool bar" marked in a fuchsia box): it includes all the components needed to create a working design logic. Since a successful logic starts from input data and ends with output data, it is better to define these entities first. These input/output variables can however be completed, modified, created or removed at any time during the logic creation process. To place a component on the Graphic Flow desktop, select it by clicking on the left tool bar, then click on the desktop as many times as the number of objects needed. Once a component is created, you can select it with a click, access its properties by a double click. With a RMB click a menu will popup menu, where you can select some actions to perform on the component: Toggle to toggle the object selected/unselected. Remove Node to remove the selected object from the logic flow. Remove Links to remove all links from the selected object to any other node previously linked to. To leave the "component insertion mode" click on the neutral icon on top of the Graphic Flow tool bar. Let's start creating 9 input variables and 5 output variables selecting the icons from the palette on the left and placing the items on the Process Flow area (Fig. T1.3.2). Note: from now on, an "RMB click" will indicate a click with the right mouse button, while an "LMB click" or simply "click" will indicate a click with the left mouse button.

Fig. T1.3.2: the Process Flow desktop with all variables placed.

Now set the input and output variables the correct names: to do this, enter the variable properties dialog, by double clicking on each variable object (Fig. T1.3.3).

Fig. T1.3.3: Input variable properties window. Variables names and properties can also be modified using the Summary Panel, RMB clicking on a free area of the Graphic Flow Desktop. In this example the Young module, S, F, Mc and Wc are kept constant. The base parameter gives the number of values that each variable can accept. In this case the beam thickness B can vary from 1 to 15 mm but on finite steps of 1 mm so the variable B will have:
B lower bound = 1 B upper bound = 15 B base = 15

Note: if the Lower Bound and Upper Bound properties are equal, the variable is kept constant and is not considered by the optimisation algorithms. After all input variables are renamed and set and all output variables are renamed, you can check the Summary panel and the result for input and output variable should look like (Fig. T1.3.4).

Fig. T1.3.4: the Summary Table for input and output variables. After the variables have been set up, the Process Flow Window should appear like in Fig. T1.3.5.

Fig. T1.3.5: the Process Flow window.

Previous

Top

Next

ES.TEC.O. S.r.l. ENGIN SOFT TECNOLOGIE PER L'OTTIMIZZAZIONE

Design Optimization Tutorial

Previous

Index

Next

1.4 Handling Input Data


The problem has 9 inputs that can be divided into: 5 constants (S, F, Young, Wc, Mc) 2 discrete variables (H, B) 2 "continuous" (a discretization of 1000 parts is used) variables (T, L). To provide data to the input variables, we need an input file. Select the Input File icon from the tool bar and click on the Graphic Flow Desktop to place it. A new input file object should be now present in the project. To enter the input file properties window, double click on its icon or click with the RMB to popup a menu, then select Properties. The input file object name must be changed to beam_input.dat, as this is the name of the file required by the application, then all the input variables can be connected as inputs to the file by clicking on their respective check boxes. By clicking the Apply button all changes to the logic are applied, the variables are connected and the system should look like Fig. T1.4.1.

10

Fig. T1.4.1: input File properties. Now the template file must be created. This can be done editing an existing input file using the Open button and looking for a suitable file. For this tutorial a correct input file can be found in:
/.../FRONTIER25x/doc/html/tutorial/project/beam_input.dat

11

Fig. T1.4.2: open file dialog. The selected file will be opened in an editor, with below a list of all input variables selected previously. To include a variable into the file follow this procedure: 1. click on the grid to select the variable to be included 2. highlight with the mouse pointer the corresponding value on the file editor 3. click with the RMB to show a popup menu and select Insert Variable (Fig. T1.4.3) 4. specify the correct format (Fig. T1.4.4)

12

Fig. T1.4.3: a selected variable and its corresponding value.

Fig. T1.4.4: selecting a number format. Repeat until all input variables are properly linked to the input file, the result will be like in Fig. T1.4.5.

13

Fig. T1.4.5: all input variables are inserted. Note: pay attention to the check boxes close to the variable names. As the input variable insertion process progresses, the system marks checked every variable correctly inserted. Note: the system will not allow the insertion of variables if special characters are included into the selected string. The endofline is also a special character, the number must be precisely selected! Click on the Ok button to accept all changes. To define the output variables in the output file, follow similar procedure.

Previous

Top

Next

ES.TEC.O. S.r.l. ENGIN SOFT TECNOLOGIE PER L'OTTIMIZZAZIONE

14

Design Optimization Tutorial

Previous

Index

Next

1.5 Handling Output Data


To provide data to the output variables, we need an output file. Select the Output File icon from the tool bar and click on the Graphic Flow Desktop to place it. A new output file object should now be present in the project. To enter the output file properties window, double click on its icon or click with the RMB to popup a menu, then select Properties. The output file object name must be changed to beam_output.dat, then all the output variables can be connected as outputs of the file by clicking on their respective check boxes. By clicking the Apply button all changes to the logic are applied, the variables are connected and the system should look like Fig. T1.5.1.

Fig. T1.5.1: output File properties. Now all output variables must be mined from the output file. First select a suitable file using the Browse button in the Output File properties window, then select a suitable file and click on the Select button, see (Fig. T1.5.2). For this tutorial a correct output file can be found in:
15

/.../FRONTIER25x/doc/html/tutorial/project/beam_output.dat

Fig. T1.5.2: open file dialog. At this point, a Template Output Editor window will show, where the selected file will be edited to mine all output variables previously selected (they are shown in the grid below the text) as seen in Fig. T1.5.3.

Fig. T1.5.3: setting relative position. To mine an output variable from the file follow this procedure: 1. click on the grid to select the variable to be mined 2. highlight with the mouse pointer a corresponding word inside the file. This mark will be the point where the parser will start to search the output value for that output variable. Note: a variable position can be either absolute (i.e. its value is in an absolute position in the file structure) or relative (i.e. its value is relative to a certain keyword inside the file). 3. click with the RMB to show a popup menu and select Relative Position
16

4. highlight with the mouse pointer the value corresponding to the variable just defined 5. click with the RMB to show a popup menu and select Select Relative (Fig. T1.5.4)

Fig. T1.5.4: setting relative value. Repeat until all output variables are properly mined from the output file, the result will be like in Fig. T1.5.5.

Fig. T1.5.5: all output variables are selected. Note: pay attention to the check boxes close to the variable names. As the output variable mining process progresses, the system marks checked every variable correctly mined, until all are done. Click on the Ok button to accept all changes, now the Graphic Flow Desktop should look like in Fig. T1.5.6.

17

Fig. T1.5.6: the Process Flow after the output variable mining.

Previous

Top

Next

ES.TEC.O. S.r.l. ENGIN SOFT TECNOLOGIE PER L'OTTIMIZZAZIONE

18

Design Optimization Tutorial

Previous

Index

Next

1.6 Actions Creation


Now we need a device to manage the execution of the external solver: an Application. Select from the tool bar a New Application object and place it on the Graphic Flow Desktop. To complete the logic flow of the process, we need to set a starting point and at least one ending point. So we need to select from the Tool bar a Start Logic item and two Logic Completed objects , one will mark a successful end of the solver, the other one will mark an unsuccessful end. Note: enter the properties window of one of the Logic Completed items just placed, and change the End Logic value from Completed to Failed; its corresponding icon will turn into , indicating a failed end. The New Application object must be configured, to do this double click on its icon on the desktop to show up its properties dialog (Fig. T1.6.1). Rename the application weldedbeam and perform the following operations: Select Start Logic item to indicate that the weldedbeam node is going to be the first to be executed. Check the input file item beam_input.dat to provide the application with the proper input data. Check the output file item beam_output.dat to specify the application output data, and specify an application exit condition (=0). Check the Completed Logic item End25 and specify an application exit condition (=0). Check the Failed Logic item End26 and specify an application exit condition (<>0).

Fig. T1.6.1: application properties. So far we setup a logic flow, in which an application named weldedbeam is executed first, it gathers all the input data it needs from a file named beam_input.dat. Upon successful exit of the application (exit condition =0), the output file, named beam_output.dat, is created, the output variables are extracted and a logic completed signal is sent to modeFRONTIER. Otherwise (exit condition 0) a logic failed signal is sent to modeFRONTIER. Click the Apply button to accept all changes, the project flow will result like in Fig. T1.6.2.
19

Fig. T1.6.2: New Application configured. Now the Logic Log reports an error: a script file for the weldedbeam node is missing. A script file is needed in order to launch the application, it can be very simple or more sophisticated according to the user needs. In this case we have to create one simple script file executing the program weldedbeam (see Fig. T1.6.3): Enter the weldedbeam properties window. Select the Edit button and a simple text editor will show. Write a simple batch of commands, of which the most essential is the call to the weldedbeam executable file. Select the Ok button to confirm all changes. Note: so far it was assumed that the file
/.../FRONTIER25x/doc/html/tutorial/project/weldedbeam

was a correct executable file. Anyhow remember to compile this file to make it executable on your own computer architecture and Operating System. A source file for the weldedbeam application is provided with this tutorial and can be found in

20

/.../FRONTIER25x/doc/html/tutorial/project/weldedbeam.c

Fig. T1.6.3: Application Script Editor. When all the modifications have been accepted, the Logic Log will show no further errors. Now the logic is laid dowm correctly and can be used.

Previous

Top

Next

ES.TEC.O. S.r.l. ENGIN SOFT TECNOLOGIE PER L'OTTIMIZZAZIONE

21

Design Optimization Tutorial

Previous

Index

Next

1.7 Creating Constraints


The problem considered in this tutorial must complain to some constraints, for the results to be possible and convenient. So let's take in consideration three simple facts: 1. BH > 0 to make the welding feasible 2. MaxS 60 to ensure the integrity of the welded part 3. MaxT 100 to ensure the integrity of the beam To perform this, three constraints must be added in the Graphic Flow: select the constraint icon from the tool bar and place three new objects on the Graphic Flow Desktop. Every constraint should be edited and connected in the flow, as we have done for the other components. As an example, we'll define the constraint on the variables B and H: BH > 0. Enter the constraint Properties dialog ( Fig. T1.7.1) to change them in this way: rename the constraint BH set User Expression to BH set Type to Greater Than set Value to 0 set Tolerance to 0 (the tolerance value is the tolerance that could be accepted in constraint violation if a significant improvement in objectives is found). Click the Apply button to accept all changes.

Fig. T1.7.1: Constraint Properties window. We also need to connect this constraint to its corresponding Input Variables in the graphic flow (B and H), so enter the Input Variables Properties window for B and H and mark checked BH in the Possible output nodes list. Do the same for the other constraints. Introducing a constraint named Shear for the max shear output and a constraint named Normal for the normal shear output.

Previous

Top

Next

ES.TEC.O. S.r.l. ENGIN SOFT TECNOLOGIE PER L'OTTIMIZZAZIONE

22

Design Optimization Tutorial

Previous

Index

Next

1.8 Creating Objectives


We set some objectives to achieve through the optimization process of this problem: minimize the cost (by reducing the weld and the material volumes) minimize displacement at the beam end To render these goals in the process flow, we add two Objectives : 1. the displacement (D) to be minimized 2. the total cost (Cost) to be minimized. Every objective should be edited, as we have done for the other components. For example, we'll define the objective for the total cost, expressed as: Mc*Mvol+Wc*Wvol. Enter the objective properties dialog ( Fig. T1.8.1) and change them like this: rename the objective Cost set Type to To Minimize select User Expression and write the expression Mc*Mvol+Wc*Wvol Click the Apply button to accept all changes.

Fig. T1.8.1: Objective Cost Properties window. Do the same for the objective D (Fig. T1.8.2).

Fig. T1.8.2: Objective D Properties window.

23

Finally the Logic is completed and the desktop should look like in Fig. T1.8.3. Note: no error or warning messages should appear in the logic log, no objects should have a yellow border!

Fig. T1.8.3: Final logic layout.

Previous

Top

Next

ES.TEC.O. S.r.l. ENGIN SOFT TECNOLOGIE PER L'OTTIMIZZAZIONE

24

Design Optimization Tutorial

Previous

Index

Next

1.9 Design of Experiment (DOE)


Before starting the optimization process, we need a first set of values for the parameters taken into account by the optimization process. This first set of values is necessary to perform the simulation and evaluate the results, in order to develop the simulation through the range of parameters closer to the goals fixed. There is a tool that provides a mean to generate a first set of values to start from, it is the Design of Experiments (DOE). To enter the DOE page, select from the menu Project|DOE or click on the DOE tab identified by the icon There is a list of possible DOE, providing different ways to develop the DOE and they are: .

User Sequence: based on a custom user sequence, the user must specify the number of designs and provide the values for each design. Random Sequence: random values will be generated for the number of designs required. Sobol: based on a pseudorandom Sobol sequence, it assures a uniform distribution of the starting values. Monte Carlo: based on a Gaussian distribution process. Full Factorial: this is a systematic series of experiments. In case of large numbers of variables, a lot of cases are generated: nlevel^ninputs. Reduced Factorial: based on a 2 level reduced factorial sequence. Cubic Face Centered: based on the Cubic Face Centered method, is equivalent to a full factorial with 2 levels plus the center of each hyper face. BoxBehnken: based on the BoxBenhken method. Latin Square: based on the GraecoLatin square method. Taguchi Matrix based on Taguchi orthogonal array. Plackett Burman based on PlackettBurman orthogonal array. Once created, the table can be manually modified by editing the values. Operations as cut are possible, as well the values can be imported from a file. Fig. T1.9.1 shows a case with 10 initial designs generated using the Sobol algorithm. , copy , paste

25

Fig. T1.9.1: a Sobol generated DOE. You can change the design execution order of the set of DOE values in this way: select and highlight with a click the row in the table you want to move RMB click to show the pop up menu select the action you want to perform When you want to import the values from a file (usually named *.des), be sure it is an ASCII file and that the data are arranged in a table as the one below:
<ID> 000000 000001 000002 H 8 4 12 L 2.652352352352e+001 1.476176176176e+001 3.828528528529e+001 S 10 10 10 T 3.002002002002e+001 2.001001001001e+001 4.003003003003e+001 B 8 4.5 11.5 F 150 150 150 Wc 1 1 1 Mc 0.001 0.001 0.001 Young 2.1e+005 2.1e+005 2.1e+005

Names and values can be separated by comma, blank, tab you must define a <ID> column, that identifies the ID of the imported designs.
26

The parser will import only columns with a name that corresponds to the name of input or output variables defined in the Process Flow window. Note: a table without an <ID> column will not be read!

Previous

Top

Next

ES.TEC.O. S.r.l. ENGIN SOFT TECNOLOGIE PER L'OTTIMIZZAZIONE

27

Design Optimization Tutorial

Previous

Index

Next

1.10 Scheduler (Optimizer)


Before the system is ready to start the execution of the analysis, you have to choose a scheduler that will lead the simulation process. To enter the Design Scheduler page, select from the menu Project|Schedulers or click the Schedulers tab identified by the icon , here you can select the scheduler (optimizer) that best fits your needs. The list on the left shows all available optimizers, select one and its parameters will show in the right window. You can change the optimizer parameters, when you have finished click the Apply Scheduler button. To reset all changes made to the parameters, click the Default Parameters button. For this tutorial a Multi Objective Optimizer (see Fig. T1.10.1) was selected with 32 generations (so the scheduler will perform less than 32 x 10 analysis as 10 was the size of the DOE). The choice of 4 concurrent design evaluations lets multiple analysis to be performed in parallel. The other optimisers are singleobjective and therefore modifications to the objectives definitions should be made to allow the usage of SIMPLEX or BFGS.

28

Fig. T1.10.1: MOGA optimizer properties.

Previous

Top

Next

ES.TEC.O. S.r.l. ENGIN SOFT TECNOLOGIE PER L'OTTIMIZZAZIONE

29

Design Optimization Tutorial

Previous

Index

Next

1.11 Run
Now we want to run the optimization: enter the Run Analysis window clicking the Run tab identified by the icon or select from the menu Project|Run. To start the analysis cycle, press the Run button at the bottom of the window, you will have to save the project before the run is started (see Fig. T1.11.1). Save the project and press the Run button to start the optimization.

Fig. T1.11.1: ready to run. While the simulation is running, the Run Analysis window will display all the important log informations.
30

The top frame displays all the messages coming from the scheduler and the process flow (solver stdout, stderr, pwd, logic error messages etc.). You can navigate through all the generated designs following the proper links. The bottom frame shows the current Process Table (Pid, Id, Design ID, Design PWD, Elapsed Time). If you want to kill one of the tasks currently running, select the task from the Process Table and click the Stop Process button. Note: to stop the whole analysis, click the Stop All Processes button.

Previous

Top

Next

ES.TEC.O. S.r.l. ENGIN SOFT TECNOLOGIE PER L'OTTIMIZZAZIONE

31

Design Optimization Tutorial

Previous

Index

Next

1.12 Assessment
You can monitor the optimization process while it is running or after it finished. Enter the design space clicking on the Design Space tab identified by the icon or selecting Assessment|Design Space from the main menu. The Design Space table shows the results obtained so far (Fig. T1.12.1) and below a summary of the current situation (number of designs, failed, broken, errors etc)

Fig. T1.12.1: design space. As those values are not really easy to understand at a glance, you can use a tool that let you create several types of charts, so the results will be more evident. Click on the Chart icon to access the chart desktop (Fig. T1.12.2) where you can place dynamic charts. Different types of graphs can be created using any of the values available in the table: scatter plot, history plot and parallel coordinate plot. The designs that are violating the constraints are plotted in blue, the feasible solutions are plotted in white. Clicking on a design point will mark it for further operations.

32

Fig. T1.12.2: Chart Desktop. As a post processing example, the parallel coordinate graph is here shown enlarged with the marked Pareto design in yellow. A design filter can be built moving the red lines with the mouse. You can zoom in the graph by pressing the SHIFT key and click on the chart. To restore press R key (see Fig. T1.12.3).

33

Fig. T1.12.3: Filtered Chart. In the Design Space window, we can apply a specific filter selecting from the main menu Assessment|Mark|Mark Pareto Designs|Only Real: this filter will select all the non dominated solutions in the database. When the system is not running you can change the specifications for objectives and constraints, and the changes are reflected in the visualisation and database of the Design Space table. Supposing you are satisfied by design 54 and you want to refine the solution, you can keep the displacement as a constraint and use the cost as a single objective, then use SIMPLEX scheduler to look for further improvements: 1. select design 54 from the Design Space table and copy it 2. go to the DOE window 3. select all designs and cut them to delete them 4. paste the design in the table 5. go to the design flow window, modify constraints and objectives 6. go to the scheduler window and select SIMPLEX 7. run again the optimization 8. go to the Design Space to see the data

Previous

Top

Next

34

ES.TEC.O. S.r.l. ENGIN SOFT TECNOLOGIE PER L'OTTIMIZZAZIONE

35

You might also like