Working with Variables > Defining an Expression
Using Intrinsic Functions in Expressions
HFSS recognizes a set of intrinsic trigonometric and mathematical functions that can be used to define expressions. Intrinsic function names are reserved, and may not be used as variable names.
The following intrinsic functions may be used to define expressions:
Function |
Description |
Syntax |
abs |
Absolute value (|x|) |
abs(x) |
sin |
Sine |
sin(x) |
cos |
Cosine |
cos(x) |
tan |
Tangent |
tan(x) |
asin |
Arcsine |
asin(x) |
acos |
Arccosine |
acos(x) |
atan |
Arctangent (in range
|
atan(x) |
atan2 |
Arctangent (in range
|
atan2(y,x) |
asinh |
Hyperbolic Arcsine |
asinh(x) |
atanh |
Hyperbolic Arctangent |
atanh(x) |
sinh |
Hyperbolic Sine |
sinh(x) |
cosh |
Hyperbolic Cosine |
cosh(x) |
tanh |
Hyperbolic Tangent |
tanh(x) |
even |
Returns 1 if integer part of the number is even; returns 0 otherwise. |
even(x) |
odd |
Returns 1 if integer part of the number is odd; returns 0 otherwise. |
odd(x) |
sgn |
Sign extraction |
sgn(x) |
exp |
Exponential (ex) |
exp(x) |
pow |
Raise to power (xy) |
pow(x,y) |
if |
If |
if(cond_exp,true_exp, false_exp) |
pwl |
Piecewise Linear |
pwl(dataset_exp, variable) |
pwl_periodic |
Piecewise Linear for periodic extrapolation on x |
pwl_periodic(dataset_exp, variable) |
sqrt |
Square Root |
sqrt(x) |
ln |
Natural Logarithm (The "log" function has been discontinued. If you use "log(x)" in an expression, the software automatically changes it to "ln(x)".) |
ln(x) |
log10 |
Logarithm base 10 |
log10(x) |
int |
Truncated integer function |
int(x) |
nint |
Nearest integer |
nint(x) |
max |
Maximum value of two parameters |
max(x,y) |
min |
Minimum value of two parameters |
min(x,y) |
mod |
Modulus |
mod(x,y) |
rem |
Fractional part (remainder) |
rem(x.y) |
Note |
If you do not specify units, all trigonometric functions interpret their arguments as radians. Likewise, inverse trigonometric functions’ return values are in given in radians. When the argument to a trigonometric expression is a variable, the units are assumed to be radians. If you want values interpreted in degrees, supply the argument with the unit name deg. |
Related Topics
Defining an Expression
-
国内最全面的HFSS培训课程,包含7套视频教程和2本教材,资深专家讲解,视频操作演示,结合最新工程案例,让HFSS学习不再难...【详细介绍】