Evaluating expressions
GSA allows geometry and loading to be modified or defined using mathematical expressions. These are mathematical expressions which can define a variation as a function of position (x,y,x)
Normal mathematical notation is used in expressions:
e.g. 1000*sin(x) + y^2
Arithmetic operations
The arithmetic operators are
+ | addition |
- | subtraction |
* | multiplication |
/ | division |
^ | raise to power of |
Normal operator precedence is followed. The constants pi (3.14...) and g (9.81...) are defined. Parenthesis can be used to clarify the order of operations.
Mathematical functions
The following functions can be used:
sqrt(x) | square root |
abs(x) | absolute value |
exp(x) | e raised to power of |
ln(x) | natural logarithm |
log(x) | base 10 logarithm |
sin(x) | sine (in radians) |
cos(x) | cosine (in radians) |
tan(x) | tangent (in radians) |
asin(x) | inverse sine (in radians) |
acos(x) | inverse cosine (in radians) |
atan(x) | inverse tangent (in radians) |
atan(y,x) | inverse tangent of (y/x) (in radians) |
sinh(x) | hyperbolic sine |
cosh(x) | hyperbolic cosine |
tanh(x) | hyperbolic tangent |
asinh(x) | inverse hyperbolic sine |
acosh(x) | inverse hyperbolic cosine |
atanh(x) | inverse hyperbolic tangent |
radians(x) | conversion of degrees to radians |
degrees(x) | conversion of radians to degrees |
floor(x) | round a number down to integer value |
ceil(x) | round a number up to integer value |
sign(x) | return sign of number |
max(x,y) | maximum of two numbers |
min(x,y) | minimum of two numbers |
Conditional expressions
Conditional expressions can be specified in the form:
if( condition, true_expression, false_expression )
The conditional operators are >
, <
, !=
(or <>
), >=
, <=
, ==
(or =
) and the logical operators are &&
(and) and ||
(or). Conditional expressions can be nested.