Syntax for Algebraic Option
When adding a named expression,
An algebraic expression is either a namedExpression, a constant, a name, an operator, two expressions separated by a binaryOperator, or an expression enclosed in parentheses.
An operator is an opName followed by arguments.
An argument is either empty parentheses, an expression enclosed by parentheses, or two expressions separated by a comma and enclosed by parentheses.
A binaryOperator is one of the following literals: ‘+’, ‘-’, ‘*’, ‘/’, '%', '^'
A name is either a project, design, or intrinsic variable (scalar or vector), or a geometry.
A constant can be one of the following:
- scalar literal; for example, “1.5e-10”
- complex number; for example, "3.5-1.0i" or “<(3.5, -1.0)>”
- 3D vector; for example, "<1.0, 2.0, 3.0>"
- complex 3D vector; for example, "<1.0-2.0i, 2.0-3.0i, 3.0-4.0i>" or "<(1.0, -2.0), (2.0, -3.0) ,(3.0, -4.0)>”
The syntax for an algebraic expression is summarized below.
expression : namedExpression
| constant
| name
| operator
| expression binaryOperator expression
| '(' expression ')'
operator : opName arguments
binaryOperator : + | - | * | / | % | ^
arguments : <empty>
| '(' expression ')'
| '(' expression ',' expression ')
Note the following:
%is used for the vector dot product; for example,Integrate(AllObjects, Real(E%H))*supports vectors on both sides as the operand and the cross-product. For example,Integrate(AllObjects, Mag(E*H))can be used instead ofIntegrate(AllObjects, Mag(Cross(E,H)).