120 likes | 278 Views
SECTION 3 EXPRESSIONS: FUNCTIONS. EXPRESSIONS: FUNCTIONS. What’s in this section: Function Overview Function: Location Functions: Orientation Functions: Modeling Functions: User-written Expressions: Saving Your Work. FUNCTIONS OVERVIEW. Database Facilitate your access to the database
E N D
SECTION 3 EXPRESSIONS: FUNCTIONS
EXPRESSIONS: FUNCTIONS • What’s in this section: • Function Overview • Function: Location • Functions: Orientation • Functions: Modeling • Functions: User-written • Expressions: Saving Your Work
FUNCTIONS OVERVIEW • Database • Facilitate your access to the database • File • Allow you to read information from and write information to files • Miscellaneous • Database functions • Interface (GUI) functions • String functions • System functions • There are several functions of each type. In this section, we’ll cover some of the common types. Note:The are several functions of each type. In this section, we’ll cover some of the common types. • Eight Categories of Functions: • Math • Apply to scalar numbers or matrixes. • Location/Orientation • Compute one or more locations or orientations from a variety of input parameters • Modeling • Return a requested displacement measurement between markers or parts • Matrix/Array • Allow you to easily perform common matrix operations • String • Allow you to manipulate character strings
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)
FUNCTIONS: LOCATION (CONT.) • Example • LOC_RELATIVE_TO({16,8,0}, marker_2) Note: The Location is an array. In Workshop 6-Performing a Design Study, you will use another function to return an array. Using this method, you can nest functions.
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)
FUNCTIONS: ORIENTATION (CONT.) • Example • ORI_ALONG_AXIS(marker_1, marker_2, “y”) Note: From Frame and To Frame must be objects. They cannot be arrays.
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.
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) Note: For additional information on how to put a marker midway between two other markers, see the Knowledge Base Article 7219 available at: http://support.adams.com/kb/faq.asp?ID=7219.
FUNCTIONS: USER-WRITTEN (CONT.) • 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.
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. Note: For additional information on the advantages and disadvantages of the various file types, see the Knowledge Base Article 7248 available at:http://support.adams.com/kb/faq.asp?ID=7248.