Using Statements to Define Your Model
These sections explain how to use statements to define your model:
Formatting Statements
The figure below shows the general format for all Adams Solver statements.
Every statement, except the TITLE statement, includes a name that indicates the statement type. Most statements require:
■Slash (/) delimiter
■Identifier (id)
■One or more arguments (ARG1,...,ARGn)
Statement arguments can indicate:
■Condition
■Values (,...,vn)
■Character string (c) with values
■Expression (e)
About Arguments
You can classify arguments into three categories:
■Conditional - These arguments are of the form ARGUMENT.
■Assignment - These arguments are of one of two forms:
■ARGUMENT={v1[,...,vn]}
■ARGUMENT={c1[:...:cn]}
■Function expression - These arguments are of the form:
■ARG=e
■ARG=USER(r1[,...,r30])
A different set of arguments characterizes each Adams Solver statement. If you do not include mandatory arguments, Adams Solver outputs an error message and stops execution after the input phase. Some of the arguments in a statement may be optional; therefore, the number of arguments you use for a statement can vary. Argument order can also vary without changing the overall meaning of a statement. For example, the argument order in the statements below differ, but they provide Adams Solver with the same information.
REQUEST/04, FORCE, I=0304, J=0204
REQUEST/04, I=0304, FORCE, J=0204
Although it is unnecessary to order arguments in a consistent fashion, such a practice facilitates locating argument information. The following sections describe each argument category and its distinctive attributes
Conditional Arguments
Arguments that specify a quality are named conditional arguments. Conditional arguments do not explicitly contain any argument values. They consist solely of the argument key word. For example, consider the following SFORCE statement:
SFORCE/0104, I=0408, J=0109
,TRANSLATION
,FUNCTION=1422.0 * DM(0408, 0109) * * (-1.4) - 185.4
The conditional argument in this statement is TRANSLATION, which specifies that the force is translational instead of being rotational.
Assignment Arguments
Arguments that assign one or more values to a statement attribute are named assignment arguments. Each of these arguments consists of:
■Argument key word
■Equal sign
■Set of values you want to assign to the attribute
In example formats, lower-case terms indicate the types of values that are to follow the argument key word. The types of values can be:
■Identifiers (id1,...,idn)
■Cartesian coordinates (x, y, z)
■Angular values (a, b, c)
Which can take the form of:
■Integers (i1,...,in)
■Real numbers (r1,...,rn)
■Character strings (c1:...:cn)
In some cases, arguments accept more than one kind of value; their formats specify varying types (v1,...,vn). Regardless of the kinds of values you enter for an assignment argument, you must precede all values except the first with either a comma or a colon. A comma must separate numerical values and a colon must separate character strings. You may break assignment arguments for a statement before any comma or colon. If you break the argument before a comma, do not retain the separating comma.
The following PART statement includes the assignment arguments MASS, CM, IP, and QG:
PART/03, MASS=1, CM=0305
,IP=1.5,1.6,3, QG=2,0,0
Here, the value or values following indicate:
■MASS keyword indicates the value of the mass of the part.
■CM indicates the identifier of the part center-of-mass marker.
■IP indicates the three principal mass moments of inertia of the part about the part center-of-mass marker location.
■QG indicates the initial coordinates of the BCS of the part with respect to the global coordinate system.
Function Arguments
Arguments that allow you to define their values with a FORTRAN-like expression in the dataset or with an external user-written subroutine are called function-expression arguments. Each of these arguments consists of the argument, an equal sign, and an expression that Adams Solver can evaluate.
There are two types of function-expression arguments:
■Define an expression (e).
■Pass constants to a user-written evaluation subroutine (USER=).
The following are examples of the two types of function-expression arguments:
■The MOTION statement below, includes a function-expression argument that uses an expression to compute a MOTION.
MOTION/0201, JOINT=0201, FUNCTION=POLY(TIME,0,0,360D)
■The statement below includes a function-expression argument that defines constants Adams Solver is to pass to the user-written subroutine MOTSUB:
MOTION/0201, JOINT=0201, FUNCTION=USER(0, 0, 6.28)
In the first example, the expression specifies the four values Adams Solver is to pass to the POLY function to determine the motion. In most cases, defining an expression is easier than writing and then passing values to a user-written subroutine as done in the second example. To find out more about user-written subroutines and the Adams Solver utilities you can access from user-written subroutines, see
Welcome to Adams Solver Subroutines. You can break a function expression for continuation anywhere except:
■In the middle of a number
■In the middle of a function name
■Between a function name and the left parenthesis that follows it
If you break the expression before a comma, you must retain the comma (in addition to the continuation comma).
To terminate a function expression, you must put the function expression argument last in your statement or put a backslash at the end of the expression to explicitly specify the end of the expression.
Understanding Statement Syntax
Like all languages, the statements specifying a model definition must follow certain syntactical rules. Adams Solver relies on these rules to decode a statement and understand it. The next sections explain the syntactical rules that govern statement definitions and their interpretation:
Angles
■Adams Solver assumes all angular data is in radians, unless indicated otherwise.
■If you want to indicate that angular values are in degrees, follow the values with a D, as in these examples.
45.D
45D
1.E-3D
D does not specify double precision in Adams Solver as it does in FORTRAN. In Adams Solver, a D after a number indicates that the number is to be scaled by the factor

.
■All output angular data defaults to radians, except for the rotational displacement data in the tabular output file. If you want to scale angular displacement output from degrees to radians, use the DSCALE argument on the OUTPUT command or statement.
Arguments
■Each argument indicates a condition, assigns a value, or evaluates an expression. Adams Solver has three basic types of arguments, described in
Formatting Statements.
■An equal sign separates the argument keyword from its values. Argument values can be in the form of numbers (with an E added to indicate scientific notation and/or a D added to indicate degrees), alphabetic characters, a combination of numbers and alphabetic characters, a string of words, and function expressions.
■Five or more consecutive blank spaces in an argument (except a function expression argument) cause Adams Solver to ignore the rest of the line (see
Blanks and Tabs).
■You can abbreviate arguments. Underscores in statement formats, explained in
Formatting Statements, indicate minimum allowable argument abbreviations.
■Adams Solver accepts both uppercase and lowercase letters for arguments.
■You can arrange arguments in any order within the statement to which they belong.
■You can break function expression arguments before any comma or colon. If you break the argument before a comma, retain the comma (in addition to the continuation comma). If you break the argument before a colon, retain the colon. (See
Continuations).
■You can break assignment arguments before any comma or colon. If you break the argument before a comma, do not retain the comma (in addition to the continuation comma). If you break the argument before a colon, retain the colon. (See
Continuations.)
■If you do not provide an optional argument or value, Adams Solver uses the default.
■Do not assign a real number value to an integer argument unless there is nothing except a zero after the decimal point. If you assign a real number with a fractional part after the decimal point to an integer argument, Adams Solver issues an error message.
■You can use scientific notation for both real and integer values.
■The following errors in the use of arguments cause Adams Solver to issue an error message and stop execution at the end of the input phase:
■You assign argument values that are not numbers of the permissible set of values for that argument.
■You input an invalid number of values for an argument.
■You input an ambiguous argument abbreviation.
■You input an invalid value type for an argument (for example, you input a character value, and the argument requires a numeric value; or you input a real number with a nonzero fractional part, and the argument requires an integer).
■You input two or more arguments that are mutually exclusive.
Blanks and Tabs
■Adams Solver ignores all data following five or more consecutive blank spaces on any line. There are two exceptions to this rule: function expressions and the TITLE statement.
■Do not put blanks in numerical values.
■Blank spaces provide spacing within statements, and blank lines provide spacing between groups of statements.
■You can have as many blank lines as you want in an Adams Solver dataset.
■Do not use tabs in Adams Solver statements. You can use tabs in comments.
Comments
■Use comments to describe statements and groups of statements. Adams Solver ignores comments.
■An exclamation point indicates to Adams Solver that the line is a comment.
■At least five consecutive blank spaces also indicate a comment everywhere, except within a function-expression argument. Within a function-expression argument, five blank spaces do not cause Adams Solver to stop reading the line.
■An Adams Solver dataset can have any number of consecutive or nonconsecutive comments.
■A comment can be on any line between the TITLE statement and END statement. (Adams Solver does not read beyond the END statement.) A comment can be in the middle of a statement or even in the middle of an argument, but if a comment is an entire continuation line, it must start with either a continuation character (See
Continuations below) or an exclamation mark.
Continuations
Commas in column one are used to indicate continuation lines. To continue a statement on the next line, break the line before any statement comma or colon and put a continuation comma in column one of the following line before the rest of the statement.
■If you break the statement at a comma directly preceding an argument, you do not need to retain the comma preceding the argument.
■If you break the statement before a comma within a function-expression argument, use both the comma separating the values within the argument and the continuation comma.
■If you break the statement before a comma within an assignment argument, use only one comma.
■If you break the statement before a colon in either type of argument, retain the colon.
Alternately, ampersands (&) can indicate continuation lines. To continue a statement on the next line, break the statement before any statement comma or colon and put an ampersand after the last statement character on the line to indicate that the following input line is a continuation of the line with the ampersand. Because Adams Solver ignores all comments, putting an ampersand after the comment does not indicate to Adams Solver that the following input line is a continuation line. You cannot use an ampersand to continue a function expression on the next line. If you must continue a function expression on the next line, use a comma in the first column of the new line as described above.
Delimiters
Delimiters allow Adams Solver to interpret input, and they make datasets easier to read. Adams Solver commonly requires or allows six delimiters:
■Slash - Separates a statement name from the remainder of the statement.
■Equal sign - Separates an argument key word from a value or a set of values.
■Comma - Separates arguments within a command and separates multiple integer values (i1,...,in) and multiple real values (r1,...,rn) within multiple valued arguments.
■Backslash - Instead of the comma, separates a function-expression argument from any arguments that follow it.
■Semicolon - Separates two statements on the same line.
The following errors in the use of delimiters cause Adams Solver to issue an error message and stop execution at the end of the input phase:
■You do not use a delimiter when it is required. For example, you omit the backslash between a function expression argument and the following argument.
■You use a delimiter when it is not allowed.
■You use two or more delimiters when only one is allowed. For example, you use two commas between two arguments on the same line.
Identifiers
■Identifiers distinguish statements of the same type.
■In a dataset, you should not have two or more statements with the same name and the same identifier (for example, two GRAPHICS statements with the same identifier). If your dataset does include two or more statements with the same name and the same identifier, Adams Solver issues one or more warning messages and stores the last instance only. Not all statement types require an identifier.
■If a statement type requires an identifier, the identifier string must follow a slash.
■The identifier you assign to a statement can be any positive integer with eight or fewer digits.
■The following errors in the use of identifiers cause Adams Solver to issue an error message and stop execution at the end of the input phase:
■You omit a statement identifier that Adams Solver requires.
■You use a statement identifier that is negative, is a real number, or is a positive integer with more than eight digits.
■If you include a statement identifier with a statement that does not require an identifier, Adams Solver issues a warning message and ignores the identifier.
Numbers
■A real number is a number with a decimal point and/or a fractional part behind the decimal point.
■A single plus or minus sign can precede any number or exponent. Use of the plus sign is optional.
■Numbers must not contain blanks or commas.
■If a number contains a decimal point and/or an exponent, Adams Solver interprets it as a real number.
■Adams Solver stores real numbers in a format that retains approximately fifteen significant digits in 64-bit machines.
■If a number does not contain either a decimal point or an exponent, Adams Solver interprets it as an integer. You may assign an integer value when Adams Solver expects a real argument. However, if you do this, Adams Solver converts the integer to a real number before storing it.
■Integer values input to Adams Solver must be greater than -231 -1 and less than +231 -1.
■You can assign a real number value when Adams Solver expects an integer if the fractional part of the real number is zero. If you do this, Adams Solver converts the real number to an integer before storing it.
■You can input exponents for real numbers and integers you assign to real arguments. The exponent indicates an integer power of ten by which Adams Solver is to multiply the mantissa. To indicate the exponent, immediately follow the number with an E (this is consistent with the E in FORTRAN). Then, follow the E with the positive or negative integer exponent. The allowable range for exponents depends on the particular computer on which you are running Adams Solver. The following are examples of numbers with valid exponents:
.314159E1
314159E01
314.159E-02
314159E+2
■Internally, Adams Solver uses radians for angular units. Adams Solver includes a degrees-to-radians conversion factor to allow for easy conversion of degree quantities to radian quantities. Put a D immediately following a number that you want Adams Solver to scale by that conversion factor. Adams Solver multiplies the number by

before storing it.
You can use this conversion factor for any number in the dataset, including numbers in function expressions. But this conversion factor is especially useful when you are assigning values to arguments that expect angular quantities. For example, Adams Solver converts the argument:
REULER = 90D, 180.0D, 2.70E+2D
to
REULER = 1.5708, 3.1416, 4.714
before storing the information. D does not specify double precision in Adams Solver as it does in FORTRAN.
■The following errors in the use of numbers cause Adams Solver to issue an error message and stop execution at the end of the input phase:
■You include a fractional part other than zero in a real number you input for an integer argument value.
■You include a blank or a comma in a number.
■A statement must begin in one of the first five columns of the line. If it does not, Adams Solver treats it as a comment and does not read it.
■Statements can be defined only between column 1 and column 80.
■To continue a statement that is longer than eighty columns, use an ampersand (&) after the last statement character in the line to be continued or use a comma as the first character in all continuation lines (see
Continuations). If you use the ampersand, the last statement character can be in the seventy-ninth column at most because the ampersand would then have to be in the eightieth column.
■Adams Solver can read two or more statements on the same line if they are separated by semicolons.
■You can abbreviate statement names. Underscores in statement formats, indicate minimum allowable abbreviations. See
C++ Statements.
■Adams Solver accepts both upper- and lower-case letters for statement names.
■Because the TITLE statement is read but not executed, it can include any combination of printable characters and blank spaces.
■The following errors in the use of statements cause Adams Solver to issue an error message and stop execution at the end of the input phase:
■You do not include all required arguments in a statement.
■You put two or more statements on the same line without semicolons separating them.
■You continue a statement on the following line without either an ampersand at the end of the first line or a comma at the beginning of the following line.