3.7. Parametric Expressions

Parametric expressions involve operations among parameters and numbers such as addition, subtraction, multiplication, and division. For example:

X=A+B
P=(R2+R1)/2
D=-B+(E**2)-(4*A*C)     ! Evaluates to D = -B + E2 - 4AC
XYZ=(A<B)+Y**2          ! Evaluates to XYZ = A + Y2 if A is less than B;
                        ! otherwise to XYZ = B + Y2 
INC=A1+(31.4/9)
M=((X2-X1)**2-(Y2-Y1)**2)/2

The following is a complete list of APDL operators:

Operator Operation
+ Addition
_ Subtraction
* Multiplication
/ Division
** Exponentiation
< Less-Than Comparison
> Greater-Than Comparison

You can also use parentheses for clarity and for "nesting" of operations, as shown above. The order in which the Mechanical APDL program evaluates an expression is as follows:

  1. Operations in parentheses (innermost first)

  2. Exponentiation (in order, from right to left)

  3. Multiplication and division (in order, from left to right)

  4. Unary association (such as +A or -A)

  5. Addition and subtraction (in order, from left to right)

  6. Logical evaluation (in order, from left to right)

Thus an expression such as Y2=A+B**C/D*E is evaluated in this order: B**C first, /D second, *E third, and +A last. For clarity, you should use parentheses in expressions such as these. Parentheses can be nested up to four levels deep, and up to nine operations can be performed within each set of parentheses. As a general rule, avoid using blank spaces between operators in expressions. In particular, never include a blank space before the * character because the rest of the input line (beginning with the *) is interpreted as a comment and is therefore ignored. (Do not use this convention as a comment; use an exclamation point (!) for this purpose.)