Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Debugging Model

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Debugging Your Model

2 Adams/View
About Building Your Model Correctly

About Building Your Model Correctly


Consider the following tips as you build your model:
• Use the Crawl, Walk, Run Approach - As explained in the Modeling Process, you should start
out building a simple model and then add complexity as you are sure that the simple model
simulates correctly. For example, if your physical system has nonlinear bushings, start out by
creating linear bushings. After you've simulated the linear bushings, change them to nonlinear
bushings. Also, be sure to debug your model as you build it as explained in the later sections in
this chapter.
• Make Smart Modeling Choices - The design of a virtual model follows the same principles as
the design of a physical mechanical system. You want to be sure to make it simple. You want to
be sure that it contains the smallest number of parts and mimics the behavior that you are
studying in the physical system. Although Adams/View gives you the power to mimic the
behavior of your entire system, it is often better to only focus the system behaviors that you want
to study.
Be sure to ask yourself many questions as you build your model, including:
• What parts do I really need to include? You should only include those that affect the behavior of
the model. For example, ask yourself whether an anchor plate really matters in the virtual model.
• What forces do I include?
• How do my parts really interact?
• How can I validate my model? Is the model required to accurately portray behavior trends or is
absolute accuracy required?
Those of you with a finite element analysis background may want to consider whether or not certain parts
need to be modeled as flexible or can be approximated as rigid. Defining parts as rigid is easier and
provides a good first step even if you decide to convert them to flexible bodies after your initial
simulations are running smoothly.
Likewise, those of you with a CAD background may want to pay close attention when selecting which
parts are required for your mechanical model. You rarely need to include every nut and bolt from your
physical system or your CAD assembly.
Debugging Your Model 3
Debugging Your Model Before You Run a Simulation

Debugging Your Model Before You Run a Simulation


Adams/View provides you with several ways to view the connections in your model and verify your
model's correctness before running a Simulation.

View the Construction of Your Model


To view your model, you can:
• Use the Model Topology command to look at your model's topology - As you build your
model, you can display information about its topology, display how its parts are connected to
each other, and display detailed information about each object in the model, such as its parts,
constraints, and forces. For more information, see Viewing Model Topology Map Through
Information Window.
• Use the Table Editor to look at all objects in your model - The Table Editor provides a
spreadsheet-like overview of the objects that are in your model. It is a convenient way to inspect
or modify models, particularly large ones.

Check Your Model Using Model Verify


You can use the Model Verify tool to check for errors in your model, such as misaligned joints,
unconstrained parts, or massless parts in dynamic models. The Model Verify tool calculates the number
of degrees of freedom (DOF) in your model, as well as reports any redundant constraints. It is a good tool
to use periodically as you add detail to or refine your model. Learn about Verifying Your Model.

Visually Inspect Your Model


Adams/View uses broken screen icons to indicate joints or forces that are incorrectly defined. Therefore,
you can simply look at your model on the screen to see how it is constructed.

Check Your Function Expressions


The following are helpful tips for ways to debug your function when building function expressions:
• Verify a function - When working in the Function Builder in run-time mode, you can do a
cursory check of your function expression to determine if its syntax is correct. If the function
syntax is incorrect, Adams/View gives you an error message pointing out the problem area. For
more information on the Function Builder, see Adams/View Function Builder online help.
• Plot a function - The Adams/View Function Builder gives you the option to preview a plot of
your function. You can use the plotting feature whenever your function evaluates to multiple
values. You can plot all design-time functions and the run-time functions that are in the math
category and can be interpreted as design-time functions. For more information on the Function
Builder, see Adams/View Function Builder online help.
4 Adams/View
Debugging Your Model Before You Run a Simulation

• Create a measure of your entire function or key elements of it - In addition, you may find it
helpful to build measures of your entire function or key elements of it and view strip charts of the
measures as your simulation progresses.
For example, if you create a function that defines the force of a spring-damper, you can create an object
measure that tracks the force of the spring-damper over time. In addition, if you create a function that
defines an impact force, you can create a function measure of either the displacement or velocity term in
the impact function. Learn About Measures.
Debugging Your Model 5
Debugging Your Model Using Eprint

Debugging Your Model Using Eprint


Eprint prints a block of information for each kinematic, static, or dynamic step to a Command window and
to your ADAM/View Log file, aview.log. The information helps you monitor the simulation process and
to locate the source of the error if there is a problem. Each step consists of two phases:
• A forward step in time (the predictor for dynamics).
• The solution of the equations of motion (the corrector for dynamics).

Eprint displays the same information that the DEBUG command does when used with the argument
EPRINT. For more information, see the Adams/Solver online help.

To start Eprint from the Main toolbox:


1. From the Main Toolbox, select the Simulation tool .
2. Set the pull-down menu at the bottom of the toolbox to Eprint.

To start Eprint from the Main toolbar:


1. From the Simulate menu, select Interactive Controls.
2. Set the pull-down menu in the middle of the Simulation Controls dialog box to Eprint.
In both cases, a command window appears. It displays the most recent commands that
Adams/View executed.

Note: You can close the command window and use your aview.log file to view the debugging
information. Learn about Using the Adams/View Log File.
6 Adams/View
Using the Simulation Debugger

Using the Simulation Debugger


The Simulation Debugger has several options for how you want to view its debugging information:
• Running the Simulation Debugger
• Setting Up Tracking of Modeling Objects
• Stepping Through a Simulation
• Displaying Debugging Information in a Table
• Highlighting Objects During a Simulation
• Displaying Strip Charts of Adams/Solver Settings

You can select to view any or all of these options during a single simulation. Note, however, that the
options significantly slow down your simulation.

Note: You can only use the Simulation Debugger with an Adams/View interactive custom or
standard library, not an Adams/Solver stand-alone executable. Learn how to Set what type
of Adams/Solver to run.

Running the Simulation Debugger


There are several ways to access the Simulation Debugger. You can access it from the Settings menu or
through the Solver Settings dialog box.

To access the Simulation Debugger from the Settings menu:


1. From the Settings menu, point to Solver, and then select Debugging.
The Solver Settings dialog box appears with options for the Simulation Debugger.
2. Set Debugger to On.
3. Select OK.

To turn on the Simulation Debugger and Debug table from the Simulation Control
dialog box:
1. From the Simulate menu, select Interactive Controls.
2. Set the pull-down menu in the middle of the Simulations Control dialog box to Table.

To turn on the Simulation Debugger and Debug table from the Main toolbox:
1. On the Main Toolbox, select the Simulation tool .
2. Set the pull-down menu at the bottom of the toolbox to Table.
Debugging Your Model 7
Using the Simulation Debugger

Setting Up Tracking of Modeling Objects


As you run an Interactive Simulation, you can track modeling objects based on their having the most error
or the greatest change, acceleration, or force. You can display the objects in a table or highlight the
objects during a simulation. You can only select to track one element at a time. For more information on
how Adams/Solver tracks elements, see the DEBUG command in the Adams/Solver online help.

To set up the elements to be tracked:


1. From the Settings menu, point to Solver, and then select Debugging.
2. Set Track Maximum to one of the values explained below:
• Error - Track objects with the largest equation residual error. This number is an indicator of
how far Adams/Solver is from a solution. It should decrease with every iteration.
• Force - Track objects generating the greatest force. Includes forces and constraints.
• Change - Track variables with the most change.
• Acceleration - Track objects experiencing the greatest acceleration. Includes only parts.
3. Select OK.

Stepping Through a Simulation


You can set up the Simulation Debugger so it pauses after each Simulation Output step, time step, or
iteration so you can closely inspect the simulation behavior. You can step through a simulation with any
of the other debugger options selected, such as strip charts, tables, or object highlighting.

To step through a simulation:


1. From the Settings menu, point to Solver, and then select Debugging.
2. Select More and then set Single Step to Yes.
As you run a simulation, Adams/View displays a dialog box that gives you the option to continue
with the simulation or cancel it.
3. Select either Continue or Cancel.

Displaying Debugging Information in a Table


You can display debugging information in the Debug table (see Maximum Equation Error (Debug Table)
dialog box help). The table lets you track the object with the most error or the greatest amount of change,
acceleration, or force. You can also track Adams/Solver Integrator progress. The Debug table contains a
running count of the iterations needed to solve the equations of motion for the current simulation. You
can use the information as a measure of how many computations Adams/Solver is performing.
8 Adams/View
Using the Simulation Debugger

Displaying the Debug Table

To display the Debug table from the Solver Settings dialog box:
1. From the Settings menu, point to Solver, and then select Debugging.
2. In the Solver Settings dialog box, set Display to Table.
The Debug table appears.
3. Set Track Maximum to the element that you want to track. Learn about Setting Up Tracking of
Modeling Objects.
4. Run an interactive simulation as explained in Performing an Interactive Simulation.
5. Select Debug from the Simulation container on the Main Toolbox or the Simulation Controls
dialog box.

Setting Debug Table Options


You can set the following options for the information that the Debug table displays:
• Number of objects that can appear in the maximum element list. By default, Adams/View
displays three objects in the list at any one time.
• Number of elements that appeared in the last number of iterations.

To set the maximum number of objects:


• In the Show text box in the Debug table, enter the number of objects, and select Apply.

To set the history:


• In the History text box in the Debug table, enter the number of iterations to track, and select
Apply.

Highlighting Objects During a Simulation


Throughout a Simulation, you can highlight those objects experiencing the most error or the most change,
force, or acceleration, depending on the element you selected to track. If you selected to also display the
Debug table, the objects highlighted are the same objects shown at the top of the Element list in the
Debug table.

Note: Selecting highlighting of objects will significantly slow down your simulation.

To highlight objects:
1. Turn on the debugging tool as explained in Running the Simulation Debugger.
2. From the Solver Settings dialog box, set Track Maximum to select the element that you want to
track. Learn about Setting Up Tracking of Modeling Objects.
3. Set Display to Highlighting.
Debugging Your Model 9
Using the Simulation Debugger

4. Run an interactive simulation as explained in Performing an Interactive Simulation.


As the simulation runs, Adams/View highlights the objects.

Displaying Strip Charts of Adams/Solver Settings


You can display four types of debugging strip charts during an Interactive Simulation to help you debug
your simulation. The first three apply to any default Transient simulation, and the last one applies to a
static or quasi-static equilibrium simulation. The strip charts can provide you with insight into how the
Adams/Solver Integrator acts, particularly if you display strip charts of measures of modeling objects,
such as key forces and accelerations, side-by-side with the debugging strip charts.

To turn on the display of strip charts:


1. From the Settings menu, point to Solver, and then select Debugging.
2. At the bottom of the Solver Settings dialog box, select More.
3. From the Display Stripcharts area of the dialog box, select the type of strip chart you want to
display, as explained below. Learn about the Types of Strip Charts.
4. To help you interpret the solution-related information in the strip charts, see the DEBUG
command in the Adams/Solver online help.

Types of Strip Charts


The strip charts you can display are:
• Step Size - The Step Size strip chart displays the integrator step size (units of model time), as the
simulation progresses, on a logarithmic scale. The step size strip chart provides useful
information for debugging a model because, in general, the integrator step size becomes much
smaller in response to rapidly changing dynamics. Rapidly changing dynamics are, in some
cases, intentional (for example, contacts that engage or disengage over a short duration), but can
often be a symptom of modeling errors. For example, they can indicate that there is an incorrect
damping values in an IMPACT function that causes unrealistically high forces. It also can
indicate the use of discontinuous function expressions, such as an IF function.
For more information on the step size and how to control it, see Running an Interactive
Simulation.
• Iterations per Step - The Iterations per Step strip chart displays the number of iterations that
Adams/Solver needed to successfully progress to the next integration time step, over the course
of a simulation. These iterations occur during the corrector phase of the integration. For more
information on the phases in a dynamic simulation, see the INTEGRATOR statement in the
Adams/Solver online help.
The information in the Iterations per Step strip chart can provide you with several insights into
your model:
10 Adams/View
Using the Simulation Debugger

• If your simulation progresses with very few iterations at each time step, Adams/Solver is
having an easy time simulating your model. You can further increase performance or speed
by increasing the allowed maximum time step.
• If Adams/Solver requires many iterations for any particular step, it is likely encountering a
period of rapidly changing dynamics that can require corrective action as described for the
Step Size strip chart explained in the previous section.
• If you notice that Adams/Solver requires many iterations right from the beginning of a
simulation, it is likely that you have chosen an integration step size that is too large for the
dynamics in your model. You can obtain better performance if you choose a smaller time
step. For information on changing the time step, see Running an Interactive Simulation.
• Integrator order - The Integrator Order strip chart displays the order of the polynomial that
Adams/Solver uses during the predictor phase of integration. Adams/Solver uses a polynomial to
predict the future value of the state variables in an Adams model. In general, lower order
polynomials are required to successfully integrate more difficult portions of a simulation,
characterized either by nonlinearities or rapidly changing dynamics.
Similar to the Iterations per Step strip chart, if the Integrator Order strip chart shows the
consistent use of high-order (three or more) polynomials, you may be able to increase
performance by increasing the maximum allowed time step. If Adams/Solver consistently or
periodically uses low-order polynomials, it is symptomatic of a period of rapidly changing
dynamics that may require corrective action as described for the Step Size strip chart or the
integration step size may be too large for the dynamics in your model.
• Static Imbalance - The Static Imbalance strip chart displays the current imbalance in the
equilibrium equations that Adams/Solver computes during a static equilibrium simulation. A
static equilibrium simulation is an iterative process to compute a position in which your model
assumes a minimum energy configuration. Learn about Performing Static Equilibrium
Simulations.
The Static Imbalance strip chart displays a measure of how close the solution is coming to a
complete balance of the equilibrium equations at each equilibrium iteration, in units of your
selected force units.
You need to select Update Every Iteration to watch the iteration-by-iteration progress of an
equilibrium simulation. Learn about Setting Simulation Controls.
Debugging Your Model 11
Setting Simulation Display

Setting Simulation Display


To help you view a simulation, you should be sure to set up Adams/View to:
• Update Every Iteration
• Make Icons Visible During Simulation
• Use Force Graphics

Update Every Iteration


You will find it helpful to set up the display of your simulation so you can view the simulation at different
times. For example, you need to select the option, Update Every Iteration, to watch the iteration-by-
iteration progress of an equilibrium simulation. For more information, see Setting Simulation Controls.

Make Icons Visible During Simulation


To help you monitor the behavior of modeling objects, you should turn on the display of screen icons.
You have a variety of options for how you want to set up the display. Learn about Setting Screen Icon
Display. Note, however, that turning on the display of screen icons significantly slows down your
simulation.

Use Force Graphics


Adams/View, by default, creates force and torque graphics that illustrate the magnitude and direction of
your applied force. It creates the graphics during a simulation and an animation. You will find these
graphics very helpful for debugging force elements, such as IMPACT functions. We recommend that you
do not turn off the graphics. Learn about Setting Up Force Graphics.
12 Adams/View
Possible Errors when Using Adams/View

Possible Errors when Using Adams/View


The above are some common errors in Adams/View.
• Errors in Geometric Associativity
• Errors as a Result of Mass Properties
• Errors from Incorrect Gravity and Inconsistent Units

For tips on how to build modeling objects so that you avoid problems when building or simulating your
model, see:
• Tips on Constraining Your Model
• Tips on Creating Higher-Pair Constraints
• Tips on Creating Motions
• Tips on Running an Interactive Simulation

Errors in Geometric Associativity


It is possible for you to create geometry or markers on the wrong part. If this occurs, your simulation
results can be invalid. If geometry belongs to the wrong part, it can change the mass properties and,
therefore, the dynamics of the model. If markers belong to the wrong part, you can get erroneous loads
or connections.

To ensure that you assigned geometry and markers to the correct parts, do one of the
following:

• Use the Model Topology by Connection tool to check the connections of your parts.
• Turn on icons during animations and watch carefully how markers move.

To assign geometry and markers to the correct part:


• Rename the markers so they belong to the correct part.

Errors as a Result of Mass Properties


Adams/View automatically calculates mass and inertia properties for geometric bodies that you create in
Adams/View. It does not, however, assign mass and inertia properties to geometric bodies that you
imported into Adams/View. For example, it does not assign mass and inertia to IGES geometry that you
imported.

To check and set mass and inertia:


• Use the Aggregate Mass command to perform a quick check of the total mass and inertia for
your entire model or any subset of parts. Learn about Calculating Aggregate Mass of Parts.
Debugging Your Model 13
Possible Errors when Using Adams/View

• Use the Table Editor to display all parts in your model so you can perform a quick check of each
part's mass and inertia and quickly fix the individual part masses and inertia. Learn about Editing
Objects Using the Table Editor.
• Use the Modify command to check an individual part's mass and inertia and to change it as
appropriate. Learn about modifying mass and inertia for rigid bodies in Modifying Part
Properties.

Errors from Incorrect Gravity and Inconsistent Units


Make sure the magnitude and direction that you selected for gravity is appropriate for your model. In
addition, make sure that the units that you are using are consistent throughout the model for:
• Time
• Geometric elements
• Mass
• Stiffness and damping

For example, often you set your length units in meters but data for bushing stiffness are given in Newtons
per millimeters. In this case, you need to convert your units.
Also, be sure that the constants that you use in applied force expressions and user-written subroutines are
consistent with the current set of Adams/View units. Adams/View does not change the units of constants
if you change the default units settings.
In addition, make sure that you select a set of units that minimizes the difference in magnitude (scale) of
all of your input data. For example, if you are modeling the vibration of a 75-ton industrial press, you
might want to select mass = Kilopounds mass and displacement = inches.
If you divide the mass (about 150 klbm) by the expected vibration magnitude (1.5 inches), you obtain a
model scale number of approximately 100, which is well within the range for an easy numerical solution.
Using grams and meters in the same model would result in a scale number of about 109; other units would
be even worse. Poorly scaled models can present numerical difficulties to Adams/Solver, and you should
avoid them.

You might also like