Sei sulla pagina 1di 45

Advanced Parametrics, Design

Sensitivity, and Optimization using


Adams/View
Course Notes for Politecnico di Milano

November 2015

Politecnico di Milano November 2015


SECTION 1
EXPRESSIONS: OVERVIEW
EXPRESSIONS: COMPUTE VALUES

• Compute values
– ADAMS/View performs the calculations
– Prevents errors
– Results in higher accuracy

• Example: Shaft speed converted from rpm to radians/sec


– You might write the following by hand:

500  --------   ------ ------------------------   2 --------- = 52.359878 ----------------------- 


rev 1 mi n rad rad
mi n 60 seconds rev sec onds

Politecnico di Milano November 2015


EXPRESSIONS: COMPUTE VALUES

• Example: Shaft speed converted from rpm to radians/sec


– In Adams/View, you would type the following expression:

Evaluated

Politecnico di Milano November 2015


EXPRESSIONS: PARAMETERIZE

• Parameterize a model
– Model characteristics can contain references to other data
– Dependencies are established
– One change propagates through the model
– Similar to defining a spreadsheet cell as a function of another cell
• Example

MOTION_1
FUNCTION
.shaft_speed
Design variable
.input_RPM
Design variable
– MOTION_1 references a design variable, .shaft_speed, which references
another design variable, .input_RPM.
– You could also reference the design variables above in other places in the
model at the same time. When you change a design variable, the change would
then be reflected in multiple places.
Politecnico di Milano November 2015
EXPRESSIONS: PARAMETERIZE

• Example: Shaft speed using a design variable to store the expression

• When Adams/View
reads an expression,
it either:
– Evaluates and then
stores it in the
database.
– Stores the expression
itself.

Politecnico di Milano November 2015


SYNTAX: DATA TYPES

• Integer • Object
– Whole numbers – Database objects
– Example: 3 – Example:
• Real .model_1.part_1.marker_2
– Most numeric values • Matrix
– Example: 3.14159 – One- or two-dimensional
• String collections of values of the same
– Character strings of varying type, or one of the other objects.
length – Example: (Array of strings)
– Example: “x” {“ {“x”, “y”}”}
– Example: (Array of reals)
{[1.1, 3.4], [2.2, 4.5], [2, 3.3]}

Politecnico di Milano November 2015


SYNTAX: OPERANDS

• Design-time functions
– System-supplied
• Example:
(LOC_RELATIVE_TO({0,0,0},.model_1.ground.marker_1))
(SIN(30d)*500)
(DB_DEFAULT(.system_defaults,“MODEL”))

– User-written
• Example:
MID_PT(marker_2,marker_3) marker_3)

Politecnico di Milano November 2015


SYNTAX: OPERANDS
• Database objects and their component values
– Examples:
Database access: Type:
.some_model.some_part.mass Real

.model_1.motion_1.comments

.model_1.circle_1.adams_id

.model_1.part_1.location

.model_1.joint_1.i

– Other useful operators:


• .name
• .parent

Politecnico di Milano November 2015


EXPRESSION BUILDER

• To test or prototype your


OR
expressions, you can
access the Function
Builder in expression-
building mode
(Expression Builder) by
selecting it from the Expression work area

Adams/View Tools menu,


or from the Design
Variable dialog box.

Expression
categories

Getting object data


Example
(Data dictionary)
Politecnico di Milano November 2015
FUNCTIONS OVERVIEW: 8 CATEGORIES

• Math • Database
– Apply to scalar numbers or – Facilitate your access to the
matrixes. database
• Location/Orientation • File
– Compute one or more – Allow you to read information from
locations or orientations from and write information to files.
a variety of input parameters
• Miscellaneous
• Modeling – Database functions
– Return a requested – Interface (GUI) functions
displacement measurement – String functions
between markers or parts
– System functions
• Matrix/Array
– Allow you to easily perform
common matrix operations
• String
– Allow you to manipulate
character strings

Politecnico di Milano November 2015


FUNCTIONS: LOCATION

• LOC_RELATIVE_TO
– Definition
• Returns an array of three numbers, representing a location, by transforming a
specified location that is relative to a coordinate system object.
– Format
• LOC_RELATIVE_TO(Location, Frame Object)
– Example
• LOC_RELATIVE_TO({16,8,0}, marker_2) (-4,22,0)


(16,8,0)

ŷ G
marker_2
ẑ (4,6,0)

(0,0,0)
ẑ G
x̂ G

Politecnico di Milano November 2015


FUNCTIONS: ORIENTATION

• ORI_ALONG_AXIS
– Definition
• Returns the alignment of a specified axis from one coordinate system object to
another. ORI_ALONG_AXIS has an underlying parameter that allows it to
express the resulting orientation in the correct coordinate system object.
– Format
• ORI_ALONG_AXIS (From Frame, To Frame, Axis Name)
– Example
• ORI_ALONG_AXIS(marker_1, marker_2, “y”)
ŷ ẑ

marker_2
(400,300,0)
ŷ ŷ
ŷ G x̂
x̂ ŷ
(0,0,0)
ẑ marker_1
(250,150,0)

ẑG x̂G

Politecnico di Milano November 2015


FUNCTIONS: MODELING

• DM
– Definition
• Returns the magnitude of the translational displacement from one coordinate
system object to another.
– Format
• DM (Object 1, Object 2)
– Example
• DM (marker_O1, marker_O2)

• In this example, DM=13.

Politecnico di Milano November 2015


FUNCTIONS: USER-WRITTEN

• Two types of user-written functions


– Interpreted Functions
• Interpreted functions consist of text inserted into an expression when
ADAMS/View evaluates the expression.
• You can create these functions in the Command Window, using the FUNCTION
command.
• When you create them, you must specify the text of the function and the
parameter names.
• Example:
– MIDPT(marker_2, marker_3)
– Compiled Functions
• These functions are written in C or FORTRAN and linked into ADAMS/View.
• You can use these functions in the same way you would use the built-in
functions.

Politecnico di Milano November 2015


EXPRESSIONS: SAVING YOUR WORK

• ADAMS/View command file (.cmd)


– Command file format is the best way to archive and store models. It can be
slower, but it’s not prone to corruption.
– Expressions are at the bottom of the command file.
• ADAMS/View database file (.bin)
– Parameterized model resides in the ADAMS/View database.
– Opens quickly.
• ADAMS/Solver dataset file (.adm)
– Parametric expressions are not stored in an ADAMS/Solver dataset.
– Small size.

Politecnico di Milano November 2015


SECTION 2
PARAMETRICS: OVERVIEW
TOOLS FOR PARAMETRICS

• F(x) on Main Toolbox


– Ties the location of one object to another
– Options
• Collapse - Maintains no offset
LOC_RELATIVE_TO({0,0,0}, Frame Object)
• Maintain - Maintains existing offset
LOC_RELATIVE_TO({<existing offset>}, Frame Object)

Politecnico di Milano November 2015


TOOLS FOR PARAMETRICS

• F() on Main Toolbox


– Ties the location of one object to another
– Option 1: Same As
ORI_RELATIVE_TO
• Collapse - Maintains no offset
• Maintain - Maintains existing angular offset
– Option 2: Along Axis
ORI_ALONG_AXIS
• Step 1 - Choose axis in Main Toolbox
container
• Step 2 - Pick object to be parameterized
(slave)
• Step 3 - Choose axis start location
• Step 4 - Choose axis end location
– Option 3: In Plane
ORI_IN_PLANE

Politecnico di Milano November 2015


TOOLS FOR PARAMETRICS

• Use of construction points


– The difference between a marker and a point is that you can define location and
orientation on a marker, but can only define location on a point.
– Can belong to any part, but the grounded part is typically chosen.
– Typically used to tie mechanism information (geometry, joints, forces, and so
on) to that key location of interest.
• Options:
– Don’t Attach: Parametric relationships not formed at the location.
– Attach Near: Applies the LOC_RELATIVE_TO expression to locations of all
visible objects “close” to the point being created. The algorithm used to define
“close” is a function of screen coordinates, not mechanism length units. When
you right-click on an object, the Select dialog box opens, displaying the objects
that are considered “close” to that object. Notice in the example shown on the
next page, that as you zoom out, the number of “close” objects increases.

Politecnico di Milano November 2015


SECTION 3
DESIGN STUDY
DESIGN VARIABLES

• Overview
– Design variables
• Define independent parameters that can be tied to objects.
• Organize the critical parameters of the design into a concise list of values that
can be easily reviewed and modified.
– Example
• You can create a design variable called Cylinder_length to control the lengths of
all three cylinders as shown next:

Cylinder_length =150

Cylinder_length =300

Politecnico di Milano November 2015


DESIGN VARIABLES (CONT.)

• Features
– Range
– List of allowed values
• Enter a discrete list of values to use in the
design study.
– Allow design study to ignore list
• Lets you switch back and forth between
using a range and using a list of values,
without re-entering the list each time.
– Default levels
• If you specify a range only, ADAMS/View
uses equally spaced levels across the
range. You specify the number of default
levels.
• If you specify a list of values and Ignore
List is not selected, ADAMS/View runs a
simulation using each value, ignoring the
number of default levels specified.

Politecnico di Milano November 2015


DESIGN STUDIES OVERVIEW
• Trial and error method (manual iterations)

• Design study method (automated iterations)

Politecnico di Milano November 2015


DESIGN STUDIES OVERVIEW

• Definition of a design study


– Varies a single design variable (V) across a range of values.
– Runs a simulation at each value.
– Reports the performance measure for each simulation.
• From the results generated, you can determine
– The best value for V among the values simulated.
– The approximate design sensitivity of V (rate of change of performance measure
with respect to V).

Politecnico di Milano November 2015


SPECIFYING AN OBJECTIVE
• Measures
– Select a measure and specify whether to use the minimum, maximum, average,
or last simulated value of the measure as the objective value.
– You can easily reference the model outputs and perform many types of
computations on model outputs or other measures.
– You must specify the value of interest every time you perform a multi-run.
• Objective
– Objective objects are valuable when you want to do complex or multi-step
computations on model outputs.
– Use objective objects when measures are not flexible enough.
– Unlike using the measures method, objectives store the value of interest.
– Defined using:
• Measure
– Specify the characteristics directly (minimum, maximum, last value, and so on).
• Result Set Component (new or existing)
– Specify the characteristics directly (minimum, maximum, average, and so on).
• ADAMS/View Function
– Specify the characteristics indirectly.
• ADAMS/View variable and macro
– Specify the characteristics indirectly.
Politecnico di Milano November 2015
EXECUTION DISPLAY SETTINGS

• Update graphics
• Strip charts
• Show report

• Update graphics
– When you want to update the model:
– Never
– At Simulation End
• Most often used for multi-run simulations
– At Output Step
– At Contact / Output Step
– At Integration Step
– At Iteration

Politecnico di Milano November 2015


EXECUTION DISPLAY SETTINGS (CONT.)

• Strip Charts
– Chart objective
Depending on the type of parametric analysis, displays a strip chart of the following:
• Objective value versus variable value for a design study.
• Objective value versus trial for a DOE.
• Objective value versus iteration number for an optimization.
– Chart variables
Displays a strip chart of the following for each design variable:
• Variable value versus trial or iteration number.
– Save curves
Clears all displayed measures at the
beginning of the parametric analysis
and automatically saves the curve
from each trial or iteration.

Politecnico di Milano November 2015


EXECUTION DISPLAY SETTINGS (CONT.)

• Show Report
– Automatically displays a tabular report at the end of the parametric simulation.
Note: You can use the Tabular Report tool to display this table at any time,
write it to a file, and control its format.

Politecnico di Milano November 2015


OUTPUT SETTINGS

• Individual versus multi-run simulation


– Both can save analyses

Individual Simulation Settings

Multi-run Simulation Settings

Politecnico di Milano November 2015


OUTPUT SETTINGS (CONT.)

• Individual versus multi-run simulation


– Only individual can show ADAMS/Solver messages and save ADAMS/Solver
files

Politecnico di Milano November 2015


OUTPUT SETTINGS (CONT.)

• Multi-run simulation results set


– Analogous format for DOE and optimization studies
– Structure for design studies:

• Stop On Errors
– Stops the analyses if ADAMS/Solver
encounters an error during the simulation.

Politecnico di Milano November 2015


SETTING DESIGN VARIABLES TO TRIAL VALUES
• Sets the design variable values
to match those used in a
specified trial, and updates the
model graphics to reflect the
new values.

Politecnico di Milano November 2015


PLOTTING

• Measure/objective value versus run


– Plots measure or objective versus the variable value, trial number, or iteration
number.
• Measure versus time
– Plots measure or objective versus time with a curve for each trial or iteration.
– Must have specified a measure or an objective that refers to a measure or result
set component (not a macro or function).
– Must have saved results
from individual

Politecnico di Milano November 2015


SECTION 4
DESIGN OF EXPERIMENTS
DESIGN OF EXPERIMENTS (DOE) OVERVIEW

• What is DOE?
– DOE is a collection of procedures and statistical tools for planning experiments
and analyzing the results.
– DOE shows the effects of varying several design variables simultaneously.
• Types
– Screening: Identifies which factors and combinations of factors most affect the
behavior of the system.
– Robust design: Methodology developed by Dr. Genichi Taguchi for improving
quality by controlling the effects of variations in a system.
– Response surface methods (RSM): Fit polynomials to the results of the runs,
which gives you an easy-to-use approximation of your system’s behavior.

Politecnico di Milano November 2015


TRIALS DEFINED BY
• Built-in DOE technique
– DOE technique
• Full Factorial: Simulates every possible combination of levels = LF
• User-defined Algorithms: Run simulations based on algorithms you define.

• Direct input
– Does not directly specify factor values.
– Specifies indexes to the levels for each factor. The indexes center on zero. This means that for a
two-level factor, the only possible values are -1 and +1; for three-levels, -1, 0 and +1; for four-
levels, -2, -1, +1, +2; and so on.
– Example

• File input
– Specify the name of the file containing the trial matrix.
– First line of file must contain:
• number of factors
• number of levels
• number of runs
Politecnico di Milano November 2015
METHODS OF DEFINING DESIGN VARIABLES

• Specify Range
– Adams/View will then work behind the scenes to
evenly space your values according to the number
of levels specified.
– Value Range by:
• Absolute Min and Max Values
• +/- Delta Relative to Value
• +/- Percent Relative to Value
– The minimum and maximum values are always
included.

Politecnico di Milano November 2015


METHODS OF DEFINING DESIGN VARIABLES
• List of Allowed Values:
– Allows for unequally spaced values.
– Allows you to always use the same set of values.
– Is recommended to give you full control of
the values used during the DOE process.
– Options:
• Manually type values you want Adams/View to
use
• Let Adams/View generate a list for you:
– Min, Max, Std: Your list will consist of the minimum
value, the maximum value, and the standard value.
– Equally Spaced: Creates a list of equally spaced
values based on the following options:
– Total number of Values: Enter the number of
values in the list.
– Incl. Min: Select to include the minimum number in
the list.
– Incl. Max: Select to include the maximum number
in the list.

Politecnico di Milano November 2015


SECTION 5
OPTIMIZATION
OPTIMIZATION OVERVIEW

• Optimization adjusts design variables to minimize or maximize a


particular aspect of your model’s performance.
• It involves:
– Determining which objective function you want to minimize or maximize,
– Selecting the design variables you want to change, and
– Specifying the constraint functions that must be satisfied.
• Examples of objectives you might want to optimize are:
– Execution time
– Energy (effort) required
– Total material costs
– Comfort
– Stability

Politecnico di Milano November 2015


CONSTRAINTS

• Design variables
– Purpose and setup for optimization studies is the same as for design studies
and DOEs.
– By default, Adams/View uses the design variable lower and upper limit (that is,
the range) as constraints for optimization studies.
– You can tell Adams/View to “Allow Optimization to ignore range.”
Note: Only available for DOT or user-defined algorithms.
• Constraint functions
– Setup is analogous to Objective Functions.
– During optimization study, ADAMS/View ensures that evaluated constraint
functions are always negative, and therefore not violated.

Politecnico di Milano November 2015


OPTIMIZATION SETTINGS

• Algorithm types
• Convergence tolerance
• Iterations
• Differencing
• Debugging
• Minimum converged

– OPTDES_GRG: Uses OPTDES Generalized Reduced Gradient.


– OPTDES_SQP: Uses OPTDES Sequential Quadratic Programming.
Note: These algorithms require that design variables have range limits, because they work in scaled space.

Politecnico di Milano November 2015


OPTIMIZATION SETTINGS

• Convergence Tolerance
– The limit below which subsequent differences of the objective must fall before
an optimization is considered successful.
– Satisfied when:
ABS(objective[new] - objective[new-1]) < convergence tolerance.

• Iterations:
– Maximum
• Tells the optimizer algorithm how many iterations it should take before it admits
failure.
– Rescale
• The number of iterations after which the design variable values are rescaled.
• If you set the value to -1, scaling is turned off.
Note: Option is only available for DOT and user-defined algorithms.

Politecnico di Milano November 2015


OPTIMIZATION SETTINGS
• Differencing
– Technique
• Controls how the optimizer computes gradients for the design functions.
– Increment
• Specifies the size of the increment to use when performing finite differencing to
compute gradients.

• Debugging
– Sends detailed optimizer diagnostics to the window that launched ADAMS/View.

• Minimum Converged
– The number of consecutive iterations for which the absolute or relative
convergence criteria must be met to indicate convergence.
– Only applicable for the DOT Sequential Linear Programming method.
Politecnico di Milano November 2015

Potrebbero piacerti anche