ascii

16
Overview This tutorial guides you through the process of using ADAMS/Insight ASCII Conduit to interface between text files and ADAMS/Insight, part of the MSC.ADAMS ® suite of software. This guide assumes basic working knowledge of ADAMS/Insight, ADAMS/Solver .adm and .acf files, and ADAMS/Solver running in command-line mode. It also assumes you know how to negotiate a file structure. Introducing the Tutorial 3 Creating and Running an Experiment 11 Using ADAMS/Insight with the ASCII Conduit (ASC)

Transcript of ascii

Page 1: ascii

OverviewThis tutorial guides you through the process of using ADAMS/Insight ASCII Conduit to interface between text files and

ADAMS/Insight, part of the MSC.ADAMS® suite of software.

This guide assumes basic working knowledge of ADAMS/Insight, ADAMS/Solver .adm and .acf files, and ADAMS/Solver running in command-line mode. It also assumes you know how to negotiate a file structure.

■ Introducing the Tutorial 3

■ Creating and Running an Experiment 11

Using ADAMS/Insight with the ASCII Conduit (ASC)

Page 2: ascii

Using ADAMS/Insight with the ASCII Conduit (ASC)Copyright2

The information in this document is furnished for informational use only, may be revised from time to time, and

should not be construed as a commitment by MSC.Software Corporation. MSC.Software Corporation assumes no

responsibility or liability for any errors or inaccuracies that may appear in this document.

Copyright Information

This document contains proprietary and copyrighted information. MSC.Software Corporation permits licensees of

MSC.ADAMS®

software products to print out or copy this document or portions thereof solely for internal use in

connection with the licensed software. No part of this document may be copied for any other purpose or distributed or

translated into any other language without the prior written permission of MSC.Software Corporation.

Copyright © 2005 MSC.Software Corporation. All rights reserved. Printed in the United States of America.

Trademarks

ADAMS, EASY5, MSC, MSC., MSC.ADAMS, MSC.EASY5, and all product names in the MSC.ADAMS Product

Line are trademarks or registered trademarks of MSC.Software Corporation and/or its subsidiaries.

NASTRAN is a registered trademark of the National Aeronautics Space Administration. MSC.Nastran is an enhanced

proprietary version developed and maintained by MSC.Software Corporation. All other trademarks are the property of

their respective owners.

Government Use

Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in FAR 12.212

(Commercial Computer Software) and DFARS 227.7202 (Commercial Computer Software and Commercial

Computer Software Documentation), as applicable.

Page 3: ascii

1 Introducing the Tutorial

OverviewThis chapter introduces you to the tutorial and gets you started. The tutorial demonstrates how the ADAMS/Insight and ASCII conduit can be used in conjunction with ADAMS/Solver simulation files.

The sections in this tutorial are:

■ About ADAMS/Insight with ASCII Conduit, 4

■ About this Tutorial, 4

■ Getting Started, 5

■ Parameterizing the System, 7

This tutorial takes about one hour to complete.

Page 4: ascii

Using ADAMS/Insight with the ASCII Conduit (ASC)Introducing the Tutorial4

About ADAMS/Insight with ASCII ConduitADAMS/Insight is a stand-alone product that also works with ADAMS/Aircraft, ADAMS/Car, ADAMS/Chassis, ADAMS/Controls, ADAMS/Durability, ADAMS/Engine, and ADAMS/View. ADAMS/Insight lets you design sophisticated experiments for measuring the performance of your mechanical system. It also provides a collection of statistical tools for analyzing the results of your experiments so that you can better understand how to refine and improve your system.

Within the MSC.ADAMS analysis environment, there are conduits between ADAMS/Insight and the other MSC.ADAMS products (for example, ADAMS/Car, ADAMS/Chassis, and ADAMS/Engine). These conduits streamline the process by taking advantage of the inherent parametric strengths of the vertical application.

When these parametric applications are not accessible, you can use the ADAMS/Insight ASCII Conduit (ADAMS/Insight ASC). It provides the power of a streamlined parametric investigation process for systems that are defined by text files. For example, if you only have an .adm and .acf file of an analytical ADAMS/Solver system, you could use ADAMS/Insight ASC to easily execute various ADAMS/Insight investigation strategies. ADAMS/Insight ASC has an editor that enables you to import the ASCII files (.adm, .acf) and turn them into ASC templates, which together define an ASC system.

ADAMS/Insight ASC is a general-purpose tool that helps you work with various analysis environments, from your own or inhouse-developed applications to commercial applications which accept an ASCII input deck.

About this TutorialIn this tutorial, you will use ADAMS/Insight ASC with ADAMS/Insight. You will start with two text files that describe a dynamics system. These text files are ADAMS/Solver input files that represent a bungy-jump event. An MSC.ADAMS model file (.adm) describes the dynamics system and the MSC.ADAMS control file (.acf) provides instructions to ADAMS/Solver of how to run the particular job. You will import the two text files into ADAMS/Insight ASC, making them ASC templates. Then, you will parameterize the two ASC templates (referencing attributes such as, numerical values of mass, free length, and stiffness). You will also parameterize text fields, such as simulation

Page 5: ascii

Using ADAMS/Insight with the ASCII Conduit (ASC)Introducing the Tutorial 5

titles and simulation names. Finally, you will use ADAMS/Insight to create a Web page, where you can interactively adjust the free length of a bungy cord to limit the travel distance of a jumper when he or she jumps.

Getting StartedHere you will create your working directory and copy over the necessary files.

Note: On Windows, you may need to set the permissions to Full Control to edit the tutorial files.

To get started:

Note: You can skip steps 1-3 below if you previously used the Help Copy Examples to feature to copy all of the tutorials for ADAMS/Insight.

1 Create a working directory called ain_examples/asc. This directory will contain all of the files for this tutorial.

2 Copy the following files from <install_dir>/ainsight/examples to the newly created working directory:

■ ain_tut_101_asc_adm.acf

■ ain_tut_101_asc_adm.adm

3 Copy the two MSC.ADAMS simulation files by performing one of the following from a command prompt in the ain_examples/asc directory:

■ On Windows:

❖ copy ain_tut_101_asc_adm.acf bungy.acf

❖ copy ain_tut_101_asc_adm.adm bungy.adm

■ On UNIX:

❖ cp ain_tut_101_asc_adm.acf bungy.acf

❖ cp ain_tut_101_asc_adm.adm bungy.adm

Page 6: ascii

Using ADAMS/Insight with the ASCII Conduit (ASC)Introducing the Tutorial6

4 Ensure that the simulation runs by submitting bungy.acf to ADAMS/Solver by entering the following from your working directory in the command window:

■ On Windows: adams ru-s bungy.acf

■ On UNIX: mdi -c ru-standard i bungy.acf exit

Page 7: ascii

Using ADAMS/Insight with the ASCII Conduit (ASC)Introducing the Tutorial 7

Parameterizing the SystemHere, you will create an ADAMS/Insight ASC system. You will first start the MSC.ADAMS/ASC editor and import two text files, bungy.adm and bungy.acf. You create an ASC template by importing a text file(s) into an ASC system. In this tutorial, you import two text files, which results in two ASC templates. (An ADAMS/Insight ASC system can have many ASC templates.)

Once you’ve created these ASC templates, you will use the ADAMS/Insight ASC editor to parameterize the ASC templates by annotating them. This process involves delineating regions of text in the templates. In this way, you can identify parts of the template that will subsequently be replaced. This substitution process occurs when variants of the nominal system are automatically generated as part of an investigation strategy.

To parameterize the system:

1 From the command prompt, start the ADAMS/Insight ASC Editor from the working directory as follows:

■ On Windows: adams ainsight -ascg

■ On UNIX: mdi -c ainsight -ascg exit

2 Do one of the following:

■ From the File menu, select Import.

■ Select the Import text file tool .

3 Select the file bungy.acf.

4 Select Open.

5 Using the same process, import the file bungy.adm.

Next, you will annotate the two ASCII templates by identifying the regions that will be substituted, as follows:

■ Highlight the text that is to be substituted.

■ Associate a variable with the highlighted text.

For example, if you have a string such as, 'PART/02 , MASS = 160.0, CM = 0203' and you want to alter the mass of the part, you would first highlight the numeric value of '160.0', and then right-click and assign the highlighted text to a variable

Page 8: ascii

Using ADAMS/Insight with the ASCII Conduit (ASC)Introducing the Tutorial8

(by either creating a new variable, or referencing an existing variable displayed in the shortcut menu). When creating a new variable, you can define the following:

❖ Name: Descriptive name of the variable.

❖ Format: Controls how the value will be printed. The convention follows the C printf() convention of %d for integer, %f for float, %e scientific, and %s for string. On UNIX, use the man printf command to get more information on this numeric formatting convention. In most cases, you don’t need to modify the default value.

❖ Value: Default value that was originally highlighted.

❖ Description: Optional supplemental information regarding the particular variable.

Note: The double curly brace delimiters '{{' '}}' that appear in the text file are the default delimiters. You can change them on a template-by-template basis in the template properties.

6 From the Template menu, select bungy.adm.

7 Highlight the numeric value of the mass of the jumper (160.0).

8 Right-click and select Create.

The Create Variable dialog box appears.

9 Change the value of the Name text box from F_05 to mass.

10 Leave the default values in the remaining text boxes.

11 Select OK.

The corresponding text is modified as follows:

From:

PART/02 , MASS = 160.0, CM = 0203

To:

PART/02 , MASS = {{mass=160.000000}}, CM = 0203

12 Highlight the numeric value of the function of the free-length variable.

Page 9: ascii

Using ADAMS/Insight with the ASCII Conduit (ASC)Introducing the Tutorial 9

13 Right-click and select Create.

14 In the Name text box, enter free_length.

15 Select OK.

16 Select the IC value of the free-length variable.

17 Right-click, point to Replace, and then select the variable free_length.

The following shows how the corresponding text was modified:

From: VARIABLE/01, IC=100.0, FUNCTION=100.0

To: VARIABLE/01, IC={{free_length}}, FUNCTION={{free_length=100.000000}}

18 Create another variable for the stiffness by repeating the steps above, using the following parameters:

From: VARIABLE/02, IC=4.0, FUNCTION=4.0

To: VARIABLE/02, IC={{stiffness}}, FUNCTION={{stiffness=4.000000}}

19 To parameterize the title of the simulation, add the predefined variable of ascTrialName to the title description so that the first line of bungy.adm ASC Template looks as follows:

Bungy Jump (ADAMS/Insight ASCII Conduit) {{ascTrialName}}__bungy.adm

Note: Be sure that there are two underscores between the closing curly brace and bungy.

The parameterization of the bungy.adm ASC template is complete. Now, you parameterize the analysis names specified in the bungy.acf ASC template (first you open the appropriate ASC template and then parameterize it).

20 From the Template menu, select bungy.acf.

Page 10: ascii

Using ADAMS/Insight with the ASCII Conduit (ASC)Introducing the Tutorial10

21 Parameterize the first two lines of the bungy.acf ASC template so they look like the following:

{{ascTrialName}}__bungy.adm{{ascTrialName}}__bungy

Note: Be sure that there are two underscores between the closing curly brace and bungy.

22 Specify ASC template properties specific to the bungy.acf ASC template: from the Edit menu, select Template Properties.

The Template Properties dialog box appears.

23 Now you will specify how the simulations will be run. Do this by completing the following text boxes:

■ On Windows:

❖ Execution Prefix: adams ru-s

■ On UNIX:

❖ Execution Prefix: mdi -c ru-stan i

❖ Execution Postfix: exit

24 Enter a Python dictionary definition in the Post Operations (Dict) text box.

This string specifies what happens after the simulations are complete. Specifically, what parts of the simulation results files will be interrogated or how the postprocessing will occur. The results are retrieved from the solver files and specific values are placed in the Work Space.

Tip: You can see an example of this string on a commented-out line in the bungy.adm file. Cut and paste this string into the Post Operations (Dict) text box.

25 Select OK.

Now you will specify some optional ASC system attributes, such as a name and description. This can be helpful for future reference.

26 From the File menu, select ASC Properties.

The ASC System Properties dialog box appears.

Page 11: ascii

Using ADAMS/Insight with the ASCII Conduit (ASC)Introducing the Tutorial 11

27 Complete the text boxes as follows:

■ Name: Jump

■ Description: Bungy jump tutorial example

28 To save the ASC system properties, select OK.

29 Save the ASC system to disk.

a From the File menu, select Save As.

b In the File name text box, enter j_asc.

c Select Save.

This creates a file on disk called j_asc.xml. This is the ASC system with the two ASC templates. You can view this file using a text editor or a browser.

32 From the File menu select Export Experiment.

This automatically generates an ADAMS/Insight experiment with the factors and responses you defined in the ASC system. The default ADAMS/Insight experiment file is called j_asc_exp.xml.

Note: Look in the window that you used to start the ADAMS/Insight ASC editor for warning messages. Make corrections as necessary.

33 Perform one of the following:

■ To continue with the tutorial, see Creating the Experiment on page 14.

■ To quit the tutorial and exit the ASC Editor, from the File menu, select Exit.

Page 12: ascii

Using ADAMS/Insight with the ASCII Conduit (ASC)Introducing the Tutorial12

Page 13: ascii

2 Creating and Running an Experiment

OverviewIn this chapter, you’ll create an experiment and run through a number of trials that you set up in the experiment.

The sections in this tutorial are:

■ Creating the Experiment, 14

■ Running Your Experiment, 15

■ Importing and Reviewing the Results, 16

Page 14: ascii

Using ADAMS/Insight with the ASCII Conduit (ASC)Creating and Running an Experiment14

Creating the ExperimentHere you will create your experiment.

To create your experiment:

1 Start ADAMS/Insight from the ASCII Conduit by selecting the

ADAMS/Insight tool.

Your experiment will automatically open in ADAMS/Insight. Note the inclusion factors and responses.

2 Select the desired investigation strategy:

■ In the treeview, expand Design, and then select Specification.

■ In the Design Specification form, select Full Factorial as the DOE Design Type.

3 Generate the workspace.

You should now have a workspace with 8 trials.

4 From the Simulation menu, point to Build, and then select All to write the ASC Multi-Event Regulator (ASC-MER) file.

The *_mer.py file is generated in the current directory. This Python script file works with the ASC system file, and can be used to build, run, and postprocess the ASC systems defined in the _mer.py file. You can run it from the command line using the MSC.ADAMS Python commands, or from the ASC system editor using the toolbar buttons diff, run one, and run all.

Note: For more information on the options available with the _mer.py file, execute one of the following commands:

❖ On Windows: adams python j_asc_exp_mer.py -h

❖ On UNIX: mdi -c python j_asc_exp_mer.py -h exit

5 At the prompt, select Yes to process the ASC system file j_asc.xml.

6 Click OK.

7 From the File menu, select Exit, being sure to save your experiment.

Page 15: ascii

Using ADAMS/Insight with the ASCII Conduit (ASC)Creating and Running an Experiment 15

Running Your ExperimentHere you will run the ASC Multi-Event Regulator (_mer.py) file, test the configuration and run trials.

To run the ASC Multi-Event Regulator file:

1 Open a command window and change to the ain_examples/asc working directory.

Note: To get help, enter one of the following:

❖ On Windows: adams python j_asc_exp_mer.py -h

❖ On UNIX: mdi -c python j_asc_exp_mer.py -h exit

2 To test the configuration and only run the first trial, enter one of the following commands:

■ On Windows: adams python j_asc_exp_mer.py

■ On UNIX: mdi -c python j_asc_exp_mer.py exit

The results of this operation are placed in a subdirectory with the default prefix of tst.

3 To run all trials, enter one of the following:

■ On Windows: adams python j_asc_exp_mer.py -t

■ On UNIX: mdi -c python j_asc_exp_mer.py -t exit

To check that the results files were created, change to the tst_dir subdirectory and view its contents.

Note: You can also use the toolbar icons to run the trials.

Page 16: ascii

Using ADAMS/Insight with the ASCII Conduit (ASC)Creating and Running an Experiment16

Importing and Reviewing the ResultsHere you will import the results into ADAMS/Insight and then review them.

To import and review the results:

1 Start ADAMS/Insight from the ASCII Conduit by selecting the

ADAMS/Insight tool.

2 From the File menu, point to Simulation, and then select Load All.

ADAMS/Insight displays the Work Space.

3 Fit the results.

4 Export the model to an .htm file.

5 Review the model in a Web browser.