SimcenterKnowledge

Expressions > Inputs to expressions

Complex numbers in expressions

You can use complex numbers in CAE expressions. Although complex numbers are intended to define material properties and boundary conditions for acoustics analysis, they are potentially applicable to other applications that use complex math.

Imaginary function

To define a complex number, you must use the imaginary function. The syntax for the imaginary function is i(v), where v is a real-valued or complex-valued argument.

For example, to enter 5+8i in the formula, type:

5+i(8)

You can embed the imaginary function in another imaginary function.

For example, if you type the following in the formula for an expression:

i(i(3))

the software evaluates the result to be –3.

If you type:

i(5+i(3))

the software evaluates the result to be –3+5i.

If you type:

i(i(5+i(3)))

the software evaluates the result to be –5–3i.

Note:

The expression system does not support magnitude/phase representation of complex numbers.

You can use the field function to reference fields with complex dependent domains in CAE expressions. The syntax for the field function is fd("field name").

For example, suppose Table_field is a table field with a complex dependent domain. To use Table_field in the formula for your expression, type:

fd(“Table_field”)

The CAE expression system evaluates Table_field at the current value for the independent domain and returns a complex result.

You can embed the field function in the imaginary function.

For example, if you type:

i(fd(“Table_field”))

the real part of the result is minus the imaginary part of the field lookup, and the imaginary part of the result is the real part of the field lookup.

Mathematical operations for complex numbers

The following table lists the algebraic, logical, and conditional operations that you can use with complex numbers in CAE expressions.

Operator Description Example
Algebraic operators:
+ Addition (5+i(7))+(4+i(6))
Subtraction (5+i(7))-(4+i(6))
* Multiplication (5+i(7))*(4+i(6))
/ Division (5+i(7))/(4+i(6))
^ Exponentiation (5+i(7))^2
Logical operators:Note: For logical operators, a complex number is considered zero if both the real and imaginary parts are zero.
== Equal pressure==6+i(3)
= Not equal
&& And 16+i(9)&&-6+-i(4)
Conditional operator:
if (condition) then (action) else (action) If/else structure if pressure==100+i(25) then 1500 else 2000
if pressure

Functions for complex arguments

The following table lists the mathematical, lookup, and utility functions that you can use with complex arguments in CAE expressions.

Function Description Example
Mathematical functions:
ABS(v) Returns the modulus of the complex number abs(–5+i(3))
AVG(v1,v2,v3,......) Returns a complex number whose real part is the arithmetic mean of the real parts of the arguments, and whose imaginary part is the arithmetic mean of the imaginary parts of the arguments avg(1+i(2),2+i(6))
COS(v) Returns the cosine of the argument cos(3+i(4))
i(v) Defines the imaginary part of a complex number i(5)
EXP(v) Returns the exponential function evaluated for the argument exp(1+i(2))
LOG(v) Returns the natural logarithm for the argument log(1+i(2))
PI() Returns the number π (1) pi()
SIN(v) Returns the sine of the argument sin(3+i(4))
SQRT(v) Returns the square root of the argument(2) sqrt(4+i(9))
TAN(v) Returns the tangent of the argument tan(3+i(4))
Lookup functions:
fd(“field name”) Returns the value for a field fd(“field_1”)
Utility functions:
RADIANS(v) Multiplies the argument by 2π/360 radians(20+i(30))
REMU(v) Strips the units from an expression remu(p1)p1[mm]=5+i(7)
(1) Even though the pi function has no argument, you must include the parentheses. (2) Only dimensionless input or input with dimensions that are perfect squares is allowed.
How do I

Change rename and variable prefix settings

Find units and unit designations

Specify a thermal plugin function

Learn more

Inputs to expressions

Restrictions on auto-generated expressions

Fields in expressions

Units in expressions

Migrating expressions that include angular measures

Inconsistent units warnings

Look up more details

Mathematical functions in expressions

Lookup functions in expressions

Utility functions in expressions

Thermal-flow functions in expressions

Auto-generated expressions

Field function

Mapped field function

Mathematical operators in expressions

Temperatures in expressions

Quick links

Command reference

Pre/Post video examples

Bulk Entry Descriptions

Simcenter 3D tutorials

Browse Simcenter 3D help by product area

Complex numbers in expressions, Simcenter 3D 2021.1 Series

© 2020 Siemens

window.mainLanguage="en_US"

window.delivId=""

window.projectId=""

MathJax.Hub.Config({ TeX: { extensions: ["autoload-all.js"] }, tex2jax: { displayMath: [ ] }, "SVG": { scale: 125 } });

Source: https://docs.sw.siemens.com/en-US/doc/289054037/PL20200601120302950.advanced/xid1097916 · retrieved 2026-07-17