## Lab 6: Discrete and Dependent Variables

### Goals

The primary goal of this exercise is to learn how to use discrete and dependent variables in an optimization problem.

Perform an optimization study as described in Exercise 6 of the HEEDS Training Guide (below).

### Turn In  机械工程代写

Your assignment should be typed. Use a 12 pt font and 1 inch margins. On the first page, include the pledge in the form below:

Pledge: I have neither given nor received any unauthorized assistance on this lab assignment.

Based on this lab exercise, answer the following questions in short answer format.

a.Whatdo the results of this optimization study imply about the selection of golf equipment (e.g., club and ball hardness) for this particular hole?

Hint: What club selection and smash factor values are most common for the best designs (shots)?  机械工程代写

b.What is the approximate cost (distance penalty) of choosing the wrongclub?

Hints: Compare the DistanceToHole of designs that don’t use the optimal club choice to those that do. Compare groups of designs (shots) to arrive at your conclusions.

c.Consider a structural optimization problem. If sheet metal is available in only specific thicknesses, how should you represent a thickness variable (bespecific)?

d.What are some advantages of using a discretized representation of acontinuous variable?

e.Providetwo (2) examples of using discrete variables (not discretized continuous variables) in real engineering applications. Describe each one briefly.

f.Provide two (2) examples of using dependent variables in real engineering applications. Describe each one briefly.

### Exercise 6: Dependent and Discrete Variables  机械工程代写

In this exercise, we will optimize an unconstrained golf problem that contains dependent and discrete variables. The details of this problem are described below.

The initial speed of the golf ball when it leaves the club face depends not only on the speed of the club head, but also on the hardness of the ball relative to the hardness of the club face. In general, the harder the ball relative to the club face hardness, the greater the initial speed of the ball for a given club head speed. This increase in ball speed due to the club and ball properties is referred to here as the smash factor.

#### The smash factor can be considered an amplification of the club-head velocity to the ball velocity. The relationship is:

Tee Ball Speed = (Club Head Speed) * (Smash Factor)

In the current study, we will treat Club Head Speed and Smash Factor as independent variables to be determined by HEEDS MDO. But SwingSim expects an input value for Tee Ball Speed. So we will define Tee Ball Speed as a dependent variable according to the above formula. The value for Tee Ball Speed will then be calculated by HEEDS prior to each evaluation, according to the new values of Club Head Speed and Smash Factor for that evaluation.  机械工程代写

Golfers carry several different golf clubs in their bag. Since each club has a different club face angle (or angle of attack), one way to control the Tee Launch Angle of a golf shot is by selecting the appropriate club. A list of common clubs and their respective club face angles are given in the table below:

 Club: Driver 1-Iron 2-Iron 3-Iron 4-Iron 5-Iron 6-Iron 7-Iron 8-Iron 9-Iron Angle: 10.5° 16.5° 19° 22.5° 26.5° 30° 34° 38° 42° 46.5°

In the current study, we will represent Launch Angle as a discrete variable, with the available angles being those corresponding to a particular club, as in the above table.

With these new definitions, the optimization statement for this problem can be written as:

Objective: Minimize final Ball Distance to the Hole (achieve a hole-in-one)

Constraints: None

#### Variables:

80 ≤ Club Head Speed (mph) ≤ 105

1 ≤ Smash Factor ≤ 1.5

-10 ≤ Tee Target Angle (deg) ≤ 10

Tee Launch Angle (deg) discrete: [10.5, 16.5, 19, 22.5, 26.5, 30, 34, 38, 42, 46.5] Tee Ball Speed (mph) dependent: = (Club Head Speed) * (Smash Factor)

Model: SwingSim: Hole 1

### Step 1: Creating a new HEEDS MDOproject机械工程代写

Since this study is carried out for Hole 1 and we have already built the process automation steps for Hole 1 in Exercise 2, let’s start with the model from that study.

A new file called: E6_Dependent_Discrete_Variables_starter has been created in the working directory for Exercise 6. This file should be the same as your completed model from Exercise 2, except for the name.

2. To open the starting file for Exercise 6, click on the File tab and selectOpen.
3. Navigate to the Working Directory for Exercise6:

#### …\HEEDS_MDO_Introduction_Projects\ E6_Dependent_and_Discrete_Variables\ E6_Working_Directory

1. Open the projectE6_Dependent_Discrete_Variables_starter.

Except for the title, this project should be the same as your completed Exercise 2 project.

1. Rename the project as: E6_Dependent_Discrete_Variables, still within the same working directory. The file will be saved with a .heeds

To create a new study:

1. Clickon the Study  In the tree, right-click the Single_Evaluation study and select Copy Study.
2. Enter Optimization_Study_DV as the name of the new study. (DV stands for Discrete Variable and Dependent)
3. Change the Study type to ParameterOptimization.

### Step 2: Updating the Project Definitions  机械工程代写

To match our problem statement above, we will define two new variables and adjust the definition of two others.

#### Defining two new variables

1. In the Parameters tab add two new continuous variables: ClubHeadSpeed and SmashFactor with ranges as defined above. Set the baseline values for these two variables to be 95 and 1.25, respectively.

#### Defining a dependent variable

1. For TeeBallSpeed, change the Type toDependent.
2. In the properties pane for TeeBallSpeed,enter

The definition appears in the Formula column for the variable.

When creating a formula, you can select the variable names from the dropdown in the calculator instead of typing them.  机械工程代写

#### Defining discrete variables and managing sets

A discrete variable is assigned a value from among a set of allowable values, as follows:

1. For TeeLaunchAngle, change the Type toDiscrete.
2. To  define the set of discrete choices, clickon the  {a} Manage Sets button in the Tools area of the ribbon.
3. In the Manage Sets dialog box, click the

A set named Set_1 is created.

4.Click the name of the set and rename itLoftAngles.

5.Click the button repeatedly until you create 10 items.

6.Define the items as shown to theright:

Note that the set is Ordered because there is a distinct trend among the choices (loft angle is increasing). In cases for which there is no clear trend among the choices, you should select Unordered. This knowledge is used by some search algorithms (e.g., SHERPA) to speed the search.  机械工程代写

1. Close the Manage Sets dialog box.
2. To complete the definition of TeeLaunchAngle: In theSet field for TeeLaunchAngle, select LoftAngles from the drop down list.Leave the baseline as the first value in the set. This is also the default choice for a discrete variable.The launch angle is now defined as a discrete variable with a prescribed set of choices, each one corresponding to a given club selection.
##### The variables definitions should now look similar to this:

Note that ClubHeadSpeed and SmashFactor do not need to be tagged. These variables enter the model through the formula for TeeBallSpeed, which is already tagged.

Also, when we changed the variable Type for TeeBallSpeed and TeeLaunchAngle, we did not affect the tags associated with these variables. We only changed the possible values of the variables.

#### Defining the optimization study

1. Click the Study
2. In the Variables sub-tab, change the resolution of the variables asfollows:    机械工程代写

#### TeeTargetAngle: 2001

SmashFactor: 51

We could also have defined these resolutions in the Parameters tab.

1. In the Responses sub-tab, define the objective as minimizing There are no constraints for thisproblem.
2. Inthe Methods sub-tab, leave the method set to SHERPA and change the Number of evaluations to 250.

SHERPA is able to effectively solve “mixed problems” that contain both continuous and discrete variables.

#### Removing the Shared Designs

The current study was created by making a copy of a previous study, which was a descendant of an original study, called Single_Evaluation. This original study was an Evaluation Only study, in which only specific designs are evaluated. HEEDS achieves this through a nice feature called Shared Designs, which has other useful applications that are discussed in our Advanced Training Course. When we make a copy of a study that has shared designs, the shared designs are copied into the new study. In the current project, we need to either eliminate the shared design or update it according to our new variable definitions. Let’s eliminate it, as follows:

1. Click the Run tab.
2. Click the button in the toolbar.
3. Select the Design Set calledSet_1.
4. Click the (delete) button at the bottom of the Design Set column and answer Yes to the dialogue. The shared designs are now eliminated.
5. Weare now ready to Save and Run the  Don’t forget to monitor the results during the study.

### Step 4: Post-Processing the Results in HEEDSPOST机械工程代写

Open HEEDS POST and answer the following questions.

1. What do the results imply about the selection of golf equipment (e.g., club and ball hardness) for this particularhole?

Hint: What club selection and smash factor values are most common for the best designs (shots)?

1. Whatis the approximate cost (distance penalty) of choosing the wrong club?

Hint: Compare the DistanceToHole of designs that don’t use the optimal club choice.

### DiscussionQuestions

1. If sheet metal is available in only specific thicknesses, how should you represent a thickness variable?

1. What are the advantages of using a discretized representationof a continuous variable?

1. Provide two examples of using a discrete variable in your engineering applications.

1. Providetwo examples of using a dependent variable or response in your engineering applications.