Preparing for Parametric Analyses

Before running a parametric analysis, you may need to make some changes or additions to your model.

Controlling Variable Values

Before you run a Design study or Design of experiments (DOE), you must specify a range of values or list of values for each design variable used in the analysis. These determine the values that Adams View uses during the design study or DOE simulations. These values are called the levels of the variable.
Before you run an Optimization analysis, you can optionally specify a range of values to keep design variable values within particular limits.
If you specify only a value range (an upper and lower limit), then a design study and DOE use equally spaced levels starting from the lower limit and ending with the upper limit. You specify the number of levels to use when you run the design study or DOE.
If you want to use unequally spaced values or always use the same set of values, you can specify a list of the values for the design study and DOE to use. By default, the list of values takes precedence over the range in a design study or DOE.
If you specify a range, an optimization analysis only varies the variable value within that range, by default. An optimization ignores a list of values.
For each design variable, you also specify whether the range and allowed values (if any) are absolute (literal) values, increments relative to the standard value, or percentage increments relative to the standard value. For example, if the value of the variable is 5, and you enter any of the following, they all give an actual range of 4 to 6:
Absolute range of 4 to 6
Relative range of -1 to +1
Percent relative range of -20 to +20
Adams View may have set a default range when you created the design variable, so you may not need to change the variable to run a parametric analysis. It is a good idea, however, to review the settings for a variable before using it in a parametric analysis.
A good way to start is to set the variable range to include values you think are interesting and realistic for your design. Using a range gives you the most flexibility in selecting the number of values to use in a design study or DOE and it also keeps the optimization analysis from changing the variable to an unrealistic value.
If only a certain range of values is possible, use absolute limits to keep the variable within that fixed range. Otherwise, use relative or percent relative limits to include a reasonable amount above and below your initial value. Relative and percent-relative limits tie the range to the value of the variable, so if you change the value of the variable, the limits automatically change with it.
You control design variable values using the:

To control variable values using the Modify Design Variable dialog box:

1. On the ribbon menu, click the Design Exploration tab. From the Design Variable container, click the Design Variable icon .
Adams View displays the Database Navigator.
2. Select the design variable, and then select OK.
Adams View displays the Modify Design Variable dialog box and loads the current properties for the design variable you selected.
3. Set the Value Range option menu to absolute, relative, or percent-relative limits and enter the limits in the Min/Max or +/- Delta text boxes. Adams View applies the Value Range setting to both the range limits and the allowed values, if any.
4. If you want to allow an optimization to use any value for the variable, select Allow Optimization to ignore range.
 
Note:  
Selecting Allow Optimization to ignore range also disables the range for a design study and DOE, however, so you should turn off this option when you are preparing for a design study or DOE. If you try to start a design study or DOE while this option is selected, Adams View issues an error (unless you have also entered a list of values).
5. If you want to specify a list of values, select List of allowed values and enter the values in the text box that appears. To keep the list of values and still use the range for a design study and DOE, select the Allow Design Study to ignore list check box. By selecting Allow Design Study to ignore list, you can switch back and forth between using the range and the list of values without re-entering the list each time.
 
Note:  
The Value Range setting also affects the allowed values you enter. For example, if you selected a Value Range of percent relative, then Adams View interprets your entered allowed values as percentages relative to the standard value.
6. Select OK.

To control variable values 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 Variable.
3. Display all the variable properties for design variables:
Select Filters.
In the dialog box that appears, select Range, Allowed Values, and Delta Type.
Select OK.
The Table Editor displays columns for Range, Use_Range, Allowed_Values, Use_Allowed_Values, and Delta_Type.
 
Note:  
The Table Editor column headings are based on the Adams View command language and are more concise than the dialog box labels.
4. Change the properties of a design variable as explained the table below for the columns you displayed, and then select OK. Learn about Editing Objects Using the Table Editor.
Options for Controlling Design Variables
The column:
Does the following:
Range
Contains both the upper and lower limits.
Use_Range
Turns the range on and off. Turning the range off allows an optimization to use any value, but also hides the range from a design study or DOE. If you try to start a design study or DOE with the range turned off, Adams View issues an error unless you have also entered a list of values.
Allowed_Values
Contains the list of allowed values, if any.
Use_Allowed_Values
Turns the allowed values on and off. Turning the allowed values off allows a design study and DOE to use the range without losing the list of values.
Delta_Type
Sets absolute, relative, or percent-relative range limits and allowed values. You can enter absolute, relative, or percent_relative.

Computing a Measure of Performance (Objective)

To run a parametric analysis, you must measure the performance of your design and reduce it to a single value that Adams View can compute for each simulation. In an optimization, this is called the objective function or objective. In a design of experiment (DOE), this is called the response characteristic or response. We will use the term objective for all types of parametric analyses.
Learn more about finding and creating objectives:

Finding a Good Objective to Measure

Many useful objectives are easy to define. You may want to minimize the maximum loads on one or several components to improve product durability. You may want to minimize the time to run through a work cycle for a piece of machinery. Finding a good objective, however, is not always easy. How do you quantify a goal such as: Keep this component in position during a disturbance? Depending on your application, it might mean:
Keep the position from changing abruptly.
Keep the maximum movement small.
Return the component to position quickly.
In addition, improving one aspect can hurt others. It may take you some thought and experimentation to formulate the right objective for your needs.
On the other hand, if you are concerned about aspects of performance such as noise, wear, or operator comfort, you may need to do some investigation to be able to relate the objective to quantities you can measure in Adams View. Just as you model the mechanical aspects of your system, you may need to develop a model of the performance of your system.
In many cases, the System elements (differential equations, transfer functions, and so on) can be helpful in numerically integrating, filtering, or transforming model outputs into more useful objectives. Learn more about System Elements.

Using Measures for Objectives

Once you have determined what to compute, you must create either a measure or an objective object to compute the objective value for each Simulation.
The easiest way to compute an objective is to use a measure. When you run a design study, DOE, or optimization, you select the measure and specify whether to use the minimum, maximum, average, or last simulated value of the measure as the objective value.
Using measures, you can easily reference model outputs and do many types of computations on model outputs or other measures. The minimum, maximum, average, and last options allow you to select most points of interest from the measure's transient data. Learn About Measures.

Using Objective Objects

If a measure is not flexible enough, you can create an objective object instead. Objective objects have options for processing simulation results and are valuable when you want to do complex or multi-step computations on model outputs. The following sections explain the types of objectives you can create and how to create them:
Types of Objectives
Adams View gives you four options for the type of objective to create:
 
This type of function:
Is the following:
Minimum, maximum, average, last value, absolute minimum, and absolute maximum of a measure
This is the same as directly specifying the measure and value of interest. The only advantage to doing this with an objective, rather than directly, is that you can specify more than one objective for a DOE. The DOE allows any number of objective objects, but only one measure. So if you want to compute more than one objective value, you must create objective objects for each value.
Minimum, maximum, average, or last value of a result set component
This is similar to the measure option, but lets you reference any Adams Solver output data, such as data from a request. You enter just the name of the Result set component, for example req1.x. Adams View uses the result set component in the analysis for which Adams View is computing the objective function. Learn more about result set components.

This is similar to the measure option, but lets you reference any Adams Solver output data, such as data from a request. You enter just the name of the result set and component, for example req1.x. Adams View uses the result set component in the analysis for which Adams View is computing the objective function. For more on result set components, see About Simulation Output.

For example, if you wanted to monitor the maximum height attained by a certain point during a simulation, you would create a request to output the position of the point. If the request is REQ1 and the z component is the height, you would create an objective as follows:
result_set_component = "REQ1/Z"
output_characteristic = maximum
Adams View function
Adams View applies the specified Adams View function object to the simulation results allowing you to compute any scalar function of the model outputs. For example, this is useful for combining scalar values from different outputs, such as summing the maximums from several outputs.

The function must have one argument, which is an analysis object containing the results. Adams View evaluates the function with the argument set to the name of the actual analysis for which Adams View is computing the objective.

You can create a function object through the Command Navigator or use the command Function Create on the shortcut menu that appears in the Function text box of the Create Objective Design dialog box when you right-click the text box.

The following are two examples of creating objective functions.
 
Example 1: Function of Analysis Data
To compute the maximum height of a point using a function, first create a request as shown on the previous page for result set components, and then create a function using the following:
function_name = FUN1
text_of_expressions = "max(analysis.req1.z.values)"
argument_names = analysis
type = real
Then, create the objective as explained in Creating an Objective Object.
To compute the objective value, ADAM/View evaluates function FUN1, substituting the name of the actual analysis being evaluated. In this case, the expression for FUN1 computes the maximum z value reported in request REQ1.
 
Example 2: Function of Model Data
If you want to measure model data in an objective, you can create a function that includes references to model data. For example, to create a constraint to limit the total mass of parts and par5 to 50, first create a function as shown below:
function_name = FUN1
text_of_expression =".mod1.par4.mass + .mod1.par5.mass - 50.0"
argument_names = analysis
type = real
Note that you still specify one argument named analysis, even when you do not use analysis data.
Then, create the constraint as explained in Creating an Objective Object.
Adams View variable and macro
Adams View executes the macro you specify and uses the resulting value of the specified variable as the objective value. Entering a macro and variable lets you to execute a set of Adams View commands to compute the objective, which gives you access to any capability in Adams View, as well as external utilities through the System command.
The macro must have one parameter, and the parameter must be named analysis. Adams View invokes the macro with parameter analysis set to the name of the analysis for which Adams View is computing the objective. Your macro must perform the computations, and put the resulting objective value into the specified variable. For more information on creating macros and parameters, see About Creating Macros.
 
The following is an example of a variable and macro:
output_control create request &
   request_name = .model_1.req4 &
   adams_id = 1 &
   output_type = displacement &
   i_marker_name = .model_1.PART_3.MARKER_9 &
   j_marker_name = .model_1.ground.MARKER_6
variable create variable=.model_1.macro_objective_value &
   real_value = 0.0
macro create macro=.objective_macro &
   commands = "!$analysis:t=analysis", &
        "variable modify &", &
        " variable=.model_1.macro_objective_value &", &
        " real_value=(eval($analysis.req4.x[1] - 6))"
optimize objective create &
   objective_name = .model_1.OBJ_mac &
   variable_name = .model_1.macro_objective_value &
   macro_name = .objective_macro &
   comments = "macro-base objective"
Creating an Objective Object

To create an objective object:

1. On the ribbon menu, click the Design Exploration tab. From the Design Evaluation container, click the Create a Design Objective icon .
The Create Design Objective dialog box appears.
2. Set Definition by to the type of objective function that you want to use.
 
Notes:  
Objectives usually involve simulation results, but they are not required to do so. You can create an objective that depends only on the model data, such as overall weight or size. You can then use Adams View to vary, or even optimize, the design variables and immediately see the results on the model.

In this case, use the function or variable/macro option for the objective, and ignore the analysis argument or parameter that Adams View supplies. Because you do not need simulation results, you should also create a dummy simulation script that does nothing (see Creating a Simulation Script). Then, Adams View repeatedly sets the variables and evaluate the objective, but does not run any simulations.
3. Enter the name of the measure, result set component, function, or macro and variable. If you are entering a result set component, enter the name of the result set and component, for example req1.x.
4. If you are using a measure or result set component, set the Design Objective's value is the option menu to the selected value.
5. Select OK.

Creating Constraints (Optimization Only)

If you are preparing for an Optimization, you can create constraint objects to limit the changes that the optimizer can make. Often an optimization finds a configuration that optimizes the objective you provided, but is unrealistic because it violates overall design constraints such as weight, size, speed, or force limits.
To avoid results that violate the design constraints, you can create constraints for the optimization. The optimization analysis improves the objective as much as possible without violating the constraints.
 
Note:  
You do not need to create an explicit constraint to limit the value of a design variable. You can do this directly by setting properties for the variable. See Controlling Variable Values.
Each constraint object creates an inequality constraint. The optimization keeps the value of the constraint less than or equal to zero. You can create an equality constraint, in effect, by creating a pair of constraint objects, each the negative of the other.
Constraints can involve the simulation results, but are not required to do so. You can constrain overall size, weight, or other factors that depend only on model data. In these cases, use the function or macro/variable option for the constraint, and ignore the analysis data that Adams View supplies. Instead, compute the constraint directly from the appropriate model data.

To create a constraint object:

1. On the ribbon menu, click the Design Exploration tab. From the Design Evaluation container, click the Create a Design Constraint icon .
2. Follow the procedures for creating an objective object as explained in Creating an Objective Object.

Creating a Simulation Script

As those sections explain, there are three types of scripts: simple run, Adams View, and Adams Solver. You can use a script of any type for a parametric analysis. An Adams View script can be particularly useful for complex parametric analysis.
An Adams View script usually contains one or more Adams View simulation commands, but it can contain other commands as well. For example, if you want to activate or deactivate portions of your model before each simulation you can include those commands before the simulation commands. If you want to do some post-processing of results before computing the objective, you can add those commands after the simulation commands.
If you do not need a simulation to evaluate your model, you can even use a script with no simulation commands or no commands at all. Perhaps your objective is a function of model data only and you want to see the effects of the design variables on the model itself. In this case, you can use a dummy script with only a blank line or comments in it. In addition, if you want to evaluate your model with an outside program, your script can contain commands to write data, run an external utility, and read results back into Adams View.

Ensuring Accurate Run Results

It may seem strange at first, but Adams View can introduce seemingly random variations in results from run to run that affect the results of your parameteric analysis. This can lead to erratic results from any parametric analysis and poor performance from the Optimization analysis in particular.
Even with the correct setup of simulation parameters, when you change a design variable even a small amount, you can trigger other variations that obscure the actual effects of the design variable change.
An optimization is especially sensitive to these variations because it generates small differences itself to approximate derivatives. By default, an optimization perturbs design variables by .1% to compute derivatives. If the resulting output is not consistent to at least four digits, the derivative is inaccurate and the optimization flounders or fails.
It is important to understand these variations and minimize them as much as possible. Three common sources of unexpected variations are:
Adams Solver error tolerances that are too large.
Output steps that are too large.
Simulations that end too soon.
You should first check your settings for Adams Solver error tolerances, such as digits of precision under Dynamic on the Solver Settings dialog box. An error tolerance that is acceptable for a single run may not accurately show the effects of a small design variable change. When Adams View changes a design variable, the results of the new simulation are still within the tolerance you specified, but if that tolerance is large compared to the change due to the design variable, then comparing the results may be useless. Learn about Setting Simulation Controls.
If your objective is the minimum or maximum value of an output, check the size of your output steps. Adams View reports the smallest or largest value seen at an output step. If your output step size is too large, the reported value may not be accurate and may suddenly jump from output point to output point as the model varies, giving discontinuous results.
Make sure that there are enough output steps to capture the peak or valley of the output. If not, you can decrease the step size for the whole simulation, or if the minimum or maximum point falls in a predictable time range, you can run the simulation in several parts and decrease the step size only in the portion containing the minimum or maximum.
If your objective is the last value of an output, check to make sure the simulation is not ending too soon. If the output should reach a steady state, make sure that it really converges to an accurate value for all simulations.
In all these cases, you may need to experiment to find the right setting. For example, you might try a design study over a small range and check if the response is smooth and fairly linear. If not, you may need to adjust one or more of these settings.