Numerical Variable Statement
- Last UpdatedDec 08, 2025
- 3 minute read
For a general description of Numerical Variables, see Numerical Variables.
Numerical variables are used in very much the same way as for example, topology points, that means, they are created in a statement of their own and may then be used in subsequent statements belonging to the same panel.
Numerical variables are created via a statement type of their own, the NUM[ERICAL] statement. The numerical variables are stored in attributes of the panel they belong to. Thus, the NUM statement must be preceded by a PANEL or ONLY statement.
Syntax
|
NUMERICAL [,NO = <integer>] [VALUE = <real number>| EXP=<expression>| <topology_attribute>] [,COM = <comment>] ; |
|
|
Description |
|
|
NO |
Numerical constants will be numbered automatically and get the first free number (1, 2, ... ). If given the numerical constant will get the number given. |
|
VALUE |
The assigned values may be a constant, including FR-, LP-term or another N-term with or without offset. |
|
EXP |
A mathematical expression given as a string, (specified in detail below). This string must be surrounded by apostrophes and its length is restricted to 70 characters. However, the whole string must be given on the same line. Since the length of a line in the design language is restricted to 72 characters this means that a maximum size string must be given in a line of its own, for example, NUM, NO=5, EXP= 'xxxxxxxxxxxxxxx……………………………xxxxxxxxxxxxxxx' ; |
|
When a numerical value should be fetched from a topology point it is necessary to specify what attribute of the topology point that should be delivered. The attributes that may be fetched from a topology point are coordinates and angles. In case of coordinate it is necessary to specify the coordinate system in which the coordinate should be given (global xyz or local uv). <topology_attribute>::=<keyword>=<topology_ref> <keyword>::=X/Y/Z/U/V/T/T1/T2 for example, NUM, NO=1, X=P2; means that numerical variable 1 (N1) is assigned the x-coordinate of topology point number 2. T, T1 (=T) and T2 are used to fetch the direction angles associated with a topology point. |
|
|
COM |
An arbitrary comment string. |
The mathematical expression string may be built up by the following constituents:
-
Previously (in the panel) defined numerical variables (for example, N2)
-
A numerical constant (for example, 123, 12.3, 1E-6)
-
Arithmetical operators:
+
Unary plus operator, returns the value of its operand.
-
Unary negation operator, returns the negative value of its operand.
!
Logical NOT operator, returns the complement of its operand.
*
Multiplication operator, returns the first operand multiplied by the second.
/
Division operator, returns the first operand divided by the second.
+
Addition operator, returns the sum of the two operands.
-
Subtraction operator, returns the difference between the two operands.
==
Equal to operator, tests if the two operands are equal.
!=
Not equal to operator, tests if the two operands are not equal.
<
Less than operator, tests if the first operand is less than the second operand.
>
Greater than operator, tests if the first operand is greater than the second operand.
<=
Less than or equal to operator, tests if the first operand is less or equal to the second operand.
>=
Greater than or equal to operator, tests if the first operand is greater or equal to the second operand.
&&
Logical AND operator, returns true if both operands are true, otherwise false.
||
Logical OR operator, returns true if one of the operands are true, otherwise false.
? :
Conditional operator, returns the second operand if the first operand is true and otherwise the third operand.
-
Built-in functions:
abs(x)
Returns the absolute value of x.
acos(x)
Returns the arccosine of x in radians.
acosd(x)
Returns the arccosine of x in degrees.
asin(x)
Returns the arcsine of x in radians
asind(x)
Returns the arcsine of x in degrees.
atan2(x,y)
Returns the arctangent of x and y in radians.
atand2(x,y)
Returns the arctangent of x and y in degrees.
cos(x)
Returns the cosine of x. x should be given in radians.
cosd(x)
Returns the cosine of x. x should be given in degrees.
pow(x,y)
Returns x raised to the power of y (y is normally 2).
sin(x)
Returns the sine of x. x should be given in radians.
sind(x)
Returns the sine of x. x should be given in degrees.
sqrt(x)
Returns the square root of x.
tan(x)
Returns the tangent of x. x should be given in radians.
tand(x)
Returns the tangent of x. x should be given in degrees.
It should be observed that FR- and LP-terms cannot be used directly in expressions. They must be used via storing in numerical variables.
|
Example: |
|---|
|
NUM, NO=1, T=P2; NUM, NO=2(1)6, VAL=1000(1000)5000; NUM, VAL=LP21-100; NUM, VAL=N2 +1000; NUM, EXP='SIND(N1)*N2'; |