Using Design Variables
Design variables let you invent your own independent parameters and tie modeling objects to them. For example, if you have three cylinders in your model that you want to keep the same length, you can create a design variable called cylinder_length and control all three cylinder lengths with the design variable.
Design variables also let you organize the critical parameters in your design into a concise list of values that you can easily review and modify. In addition, you can use
Parametric analyses to automatically execute a series of simulations that vary your design variables.
Design variables are Adams View variable objects. Variable objects are general-purpose places to store data or expressions. A design variable is a variable you use specifically to parameterize your model. This chapter and the parameterization tools use the term design variable. Some tools, such as the
Command Navigator and the
Table Editor, apply to all variables, however. In those contexts, you see just the term variable. It it applies to all variables, including design variables.
Creating Design Variables
You create
Design variables using the
Create/Modify Design Variable dialog box or the Create Design Variable command that appears in the shortcut menu of any text box that accepts a design variable.
■The Create Design Variable dialog box lets you select the type of design variable you want and assign a value to the variable. It does not place the variable in your model where it is to be used, however.
■The Create Design Variable command on the shortcut menu lets you create a design variable and places the variable in your model where it will be used, all in one operation. It uses default values for your variable. You must modify the variable to change its type or name.
You should choose whichever method is most convenient:
Creating Design Variables using a Dialog Box
The following procedure explains how to create a design variable using a dialog box. You can create a design variable of the following types: real, integer, string, and object. For real and integer variables, you can also specify information about how to vary the value during a parametric analysis. These options are described in
Controlling Variable Values.
To create a design variable using the Create Design Variable dialog box:
1. On the ribbon menu, click the
Design Exploration tab. From the
Design Variable container, click the
Design Variable icon
.
2. In the Name text box, enter the name of the design variable. Adams View creates a default name for you. Select the type of design variable to create.
3. If you selected the type real, optionally select the type of units.
5. Select OK.
Adams View creates the design variable.
Now that you've created a design variable, you'll need to reference it in your model. You can enter the design variable directly, using the Reference Design Variable command, or you can type it into a text box. You can also use the Function Builder to create a more complex expression using the design variable. When you reference your design variable, Adams View places parentheses () around the variable because you are creating a simple expression that references the value of the design variable.
To reference a design variable in your model:
1. Display the text box containing the value you want to parameterize:
■If you are creating a new object, select a tool from the Main toolbox to display a settings container or display the appropriate create dialog box.
■If you are parameterizing an existing object, modify the object to display its modify dialog box.
■If you are using the
Table Editor, select the cell to parameterize and place your cursor in the Input text box.
2. Right-click the text box representing the value to be parameterized, point to Parameterize, and then select Reference Design Variable.
Adams View displays the
Database Navigator.
3. Select the design variable you just created, and then select OK.
Adams View inserts an expression such as (.my_model.my_design_var) into the text box.
4. Create or modify the object as appropriate.
Adams View creates or modifies the object using your design variable for the value you selected.
Creating a Design Variable using the Shortcut Menu
You can use the Create Design Variable command on the shortcut menu to create a design variable and place the appropriate expression in a text box all in one operation. Adams View uses the value currently in the text box as the standard value.
To create a design variable using the Create Design Variable option:
1. Display the text box for the value you want to parameterize.
■If you are creating a new object, select a tool from the
Main toolbox to display a settings container or display the appropriate create dialog box.
■If you are parameterizing an existing object, display its modify dialog box.
■If you are using the
Table Editor, select the cell to parameterize, and then place your cursor in the
Input text box.
2. Enter the desired value for the variable into the text box, if necessary.
3. Right-click the text box, point to Parameterize, and then select Create Design Variable.
Adams View creates a new design variable with a default name and the value that was in the text box and inserts an expression such as (.my_model.DV_1) into the text box.
4. Create or modify the object as appropriate.
Adams View creates or modifies the object using your design variable for the value you selected.
Modifying Design Variables
You can modify a design variable, such as change its standard value. You can use the
Create/Modify Design Variable dialog box or the
Table Editor.
To modify a design variable using the Modify Design Variable dialog box:
1. Click the
Design Exploration tab. From the
Instrumentation container, click the
Design Variable tool
. or
(Classic interface) From the Build menu, select Design Variable, and then point to Modify.
2. Select the design variable you want to modify, and then select OK.
Adams View displays the
Create/Modify Design Variable dialog box and loads the current properties for the design variable you selected.
4. Select OK.
If you changed the value of the design variable, Adams View immediately updates any objects that refer to the design variable.
To modify a design variable using the Table Editor:
1. From the Tools menu, select Table Editor.
The Table Editor appears.
2. To display the variables in your model, at the bottom of the Table Editor window, select the Variable check box.
4. Select OK.
If you changed the value of a design variable, Adams View immediately updates any objects that refer to the design variable.
Note: | By default, the Table Editor displays only variables of the type real in your model. You can display other types of variables, such as string, object, or integer, and control the columns that are displayed using the Filters button, which displays the Variables Table Editor Filters dialog box. Learn about Setting Types of Objects Displayed in the Table Editor. |
Using Design Variables with Points
As explained in
Using Points, points are an easy way to parameterize the geometry of your model. To vary a point in a
parametric analysis, however, you must create
Design variables for one or more coordinates of the point.
To parameterize a point coordinate:
Modify the point.
Adams View displays the
Table Editor showing the points in your model.
2. Select the cell for the coordinate you want to parameterize.
Adams View displays the cell value in the Input text box.
3. Right-click the Input text box, point to Parameterize, point to Create Design Variable, and then select Real.
Adams View creates a new design variable with a default name and the value that was in the text box and inserts an expression, such as (.my_model.DV_1), into the text box.
4. Select OK.
Adams View modifies the point to use the design variable as the coordinate value.