# HS-4230: Optimization Study with Discrete Variables

Learn how to use discrete variables.

Before you begin, copy the model files used in this tutorial from <hst.zip>/HS-4230/ to your working directory.

The objective of this tutorial is to maximize the minimum frequency of the first five modes of a plate. The input variables are the thickness of each of the three components, defined in the input deck via the PSHELL card. The thickness should be between 0.05 and 0.15; the initial thickness within the files is 0.1. The optimization type is size. Furthermore, optimum design should have input variables from a discrete set of 0.05, 0.08, 0.11, and 0.14 for all three thicknesses. By default, HyperStudy will add the values from the lower and upper bounds to this set. Hence the resulting set is 0.05, 0.08, 0.11, 0.14, and 0.15. Delete any of these values if needed.

## Perform the Study Setup

1. Start HyperStudy.
2. Start a new study in the following ways:
• From the menu bar, click File > New.
• On the ribbon, click .
3. In the Add Study dialog, enter a study name, select a location for the study, and click OK.
4. Go to the Define Models step.
5. Add a Parameterized File model.
1. From the Directory, drag-and-drop the plate.tpl file into the work area.
2. In the Solver input file column, enter plate.fem.
This is the name of the solver input file HyperStudy writes during the evaluation.
3. In the Solver execution script column, select OptiStruct (os).
6. Click Import Variables.
Three input variables are imported from the plate.tpl resource file.
7. Go to the Define Input Variables step.
8. Change Property 21 to be discrete.
1. Click the Modes tab.
2. In the Modes column of Property 21, select Discrete.
3. In the Values column of Property 21, click (...).
4. Click Step Size, enter 0.03, and click Set.
5. Click OK.
9. Repeat step 8 for Property 22 and Property 23.

## Perform Nominal Run

1. Go to the Test Models step.
2. Click Run Definition.
An approaches/setup_1-def/ directory is created inside the study Directory. The approaches/setup_1-def/run__00001/m_1 directory contains the input file, which is the result of the nominal run.

## Create and Evaluate Output Responses

In this step you will create two output responses.

1. Go to the Define Output Responses step.
2. Create the Freq1 output response.
1. From the Directory, drag-and-drop the plate.out file, located in approaches/setup_1-def/run__00001/m_1, into the work area.
2. In the File Assistant dialog, set the Reading technology to Altair® HyperWorks® and click Next.
3. Select Single item in a time series, then click Next.
4. Define the following options and click Next.
• Set Type to Frequency.
• Set Request to Mode 1.
• Set Component to Value.
5. Label the output response Freq1.
6. Set Expression to First Element.
7. Click Finish.
3. Create the Volume output response.
1. From the Directory, drag-and-drop the plate.out file, located in approaches/setup_1-def/run__00001/m_1, into the work area.
2. In the File Assistant dialog, set the Reading technology to Altair® HyperWorks® and click Next.
3. Select Single item in a time series, then click Next.
4. Define the following options and click Next.
• Set Type to Volume.
• Set Request to Volume.
• Set Component to Value.
5. Label the output response Value.
6. Set Expression to First Element.
7. Click Finish.
4. Click Evaluate to extract the response values.

## Run Optimization

1. In the Explorer, right-click and select Add from the context menu.
2. In the Add dialog, select Optimization.
3. For Definition from, select Setup and click OK.
2. Go to the Optimization > Definition > Define Output Responses step.
3. Click the Objectives/Constraints - Goals tab.
4. Apply an objective on the Volume output response.
2. In the Apply On column, select Volume (r_2).
3. In the Type column, select Minimize.
5. Apply a constraint to the Freq1 output response.
2. In the Apply On column, select Freq1.
3. In the Type column, select Constraint.
4. deterministic
5. In column 1, select >= (less than or equal to).
6. In column 2, enter 32.
6. Go to the Optimization > Specifications step.
7. In the work area, set the Mode to Adaptive Response Surface Method (ARSM).
Note: Only the methods that are valid for the problem formulation are enabled.
8. Click Apply.
9. Go to the Optimization > Evaluate step.
11. Click the Iteration History tab to monitor the progress of the Optimization iteration.

## Run DOE

Run a DOE to find the the true best design.

1. In the Explorer, right-click and select Add from the context menu.