Supported Mathematical Functions, Operators and Constants

Multisim Help


Edition Date: February 2017
Part Number: 375482B-01
View Product Info

DOWNLOAD (Windows Only)


Multisim 14.0 and 14.0.1 Help
Multisim 14.1 Help
Multisim 14.2 Help

Mathematical functions:

Function Name
Alternate Name
Parameters
Description
Notes
if
(test,a,b)
If-else function. If the test returns true, the result is a, else it returns b.
Example:
B1 out 0 V={if(v(1)>5, v(1)**2, 0)}
sin
sine
( x )
Sine function.
asin
arcsin
( x )
Arc-sine function.
sinh
( x )
Hyperbolic sine function.
asinh
arcsinh
( x )
Arc-hyperbolic sine function.
cos
( x )
Cosine function.
acos
arccos
( x )
Arc-cosine function.
cosh
( x )
Hyperbolic cosine function.
acosh
arccosh
( x )
Arc-hyperbolic cosine function.
tan
( x )
Tangent function.
tanh
( x )
Hyperbolic tangent function.
atan
arctan
( x )
Arc-tangent function.
atanh
arctanh
( x )
Arc-hyperbolic tangent function.
atan2
( x, y )
Atan 2 function.
Same as:
  atan (x/y)
exp
( x )
Calculates the exponential ex.
expl
( x, y )
Calculates the exponential with a maximum value.
Same as:
  min (exp (x), y)
ln
( x )
The natural logarithm function.
log10
 
( x )
The base-10 logarithm function.
 
log
 
( x )
The generic logarithm function.
This function is included for legacy compatibility and its use is not recommended.
Normally this is the same as ln(x) except in 'B' arbitrary sources where it is log10(x). This behavior is also changed by the .SYNTAX statements.
sqrt
( x )
Square root function.
abs
( x )
Absolute value function.
sgn
sign
( x )
Sign or signum function.
if (x < 0)
  sgn(x) == -1
if (x > 0)
  sgn(x) == 1
if (x == 0)
  sgn(x) == 0
max
( x, y )
Returns the maximum of x and y.
min
( x, y )
Returns the minimum of x and y.
uramp
( x )
Ramp function, clips the value against a minimum of 0.
if (x < 0)
  uramp(x) == 0
if (x >= 0)
  uramp = x
u
stp, step
( x )
Step function.
if (x < 0)
  u(x) == 0
if (x > 0)
  u(x) == 1
if (x == 0)
  u(x) == 0.5
table
(expr, x1,y1, <x2,y2 <…>>)
Piecewise linear function. Specified x-values must be increasing in value from left to right.
Inputs below x1 result in an output equal to y1. Inputs above xn (the largest specified x-value), result in an output equal to yn. In other words, table function acts as a limiter in those regions.
Using this function in a Value-type Arbitrary source is functionally equivalent to using the Table-type source.
The following line:
E1 out 0 value={Table(v(in), -60m,-4,0,0,140m,43.3)}
is functionally equivalent to the following line:
E1 out 0 TABLE {v(in)} (-60m,-4,0,0,140m,43.3)
limit
( x, a, b )
Clips the input value x to the range (A,B).
pwr
( x, y )
The pwr function.
Same as:
  abs(x)^y
pwrs
( x, y )
The pwrs function.
if (x < 0)
  pwrs(x) == -(x**y)
if (x >= 0)
  pwrs(x) == (x**y)
ddt
 
(x)
Time Derivative
ddt(v(1)*v(CapVoltagenode))
sdt
 
(x)
Time Integral
1meg*sdt(I(Vsense)+8)
V
(node)
Voltage of a node.
Can only be used in non-linear controlled source expressions.
V
(node1, node2)
Voltage difference of two nodes.
Can only be used in non-linear controlled source expressions.
Same as:
  V(node1)-V(node2)
Example:
E1 out 0
value={V(1,2)*15}
I
(voltage source) or (inductor)
Current through a voltage source or an inductor.
Can only be used in non-linear controlled source expressions.
Example:
E1 out 0
value={I(Vsense)**2
+ I(E99)}
positive
( x )
Ensure positive function.
if (x < d)
  positive(x) = d
else
  positive(x) = x
where d is 1.0p
negative
( x )
Ensure negative function.
if (x > -d)
  negative(x) = -d
else
  negative(x) = x
where d is 1.0p
nonpos
( x )
Ensure not-positive function.
if (x > 0)
  nonpos(x) = 0
else
  nonpos(x) = x
nonneg
( x )
Ensure not-negative function.
if (x < 0)
  nonneg(x) = 0
else
  nonneg(x) = x
nonzero
( x )
Ensure non-zero function.
if (x < d) & (x >= 0)
  nonzero(x) = d
if (x > -d) & (x <= 0)
  nonzero(x) = -d
else
  nonzero(x) = x
where d is 1.0p
zero
( x )
Evaluates x but always returns a value of 0.0.
one
( x )
Evaluates x but always returns a value of 1.0.
schedule
(x1,y1, <x2,y2 <…>>)
Schedule function. Gives a value of yN for when time between xN and xN+1.
Time is simulation time.

Mathematical operators:

Symbol
Alternate Symbol
Description
Usage
+
 
Addition.
A + B
-
 
Subtraction.
A - B
/
 
Division.
A / B
*
 
Multiplication.
A * B
**
^
Exponentiation (power).
A ** B or A ^ B
These take the absolute value of the base. This is consistent with PSpice®.
This can be interpreted differently in other simulators.
<
 
Less than.
A < B
<=
 
Less than or equal to.
A <= B
>
 
Greater than.
A > B
>=
 
Greater than or equal to.
A >= B
==
 
Equal to.
A == B
!=
 
Not equal to.
A != B
&
 
Logical AND.
A & B
|
 
Logical OR.
A | B
xor
 
Logical XOR.
A XOR B
? :
 
Ternary if. This operator has two symbols and three operands.
A ? B : C
This is the same as IF(A,B,C).

Built-in constants:

Symbol
Description
Value
true
Boolean true value.
1.0
false
Boolean false value.
0.0
yes
Alternate form of boolean true value.
1.0
no
Alternate form of boolean false value.
0.0
pi
The constant pi.
3.14159265358979323846
e
The constant e.
2.71828182844590452353
c
Speed of light.
2.99792458e8
kelvin
Constant to convert between degrees Kelvin and Celsius, and vice versa.
-273.0
echarge
Electron charge.
1.602176487e-19
boltz
Boltzmann's constant.
1.3806503e-23
planck
Planck's constant.
6.62606896e-34
temp
Current temperature of the simulation in degrees Celsius.
The default is 27, but it can be changed from the simulation options.
time
Current time of the simulation in seconds.
Current time of the simulation in seconds (it is constant with respect to circuit variables).

Additional Notes

  • IMPORTANT! Unlike most mathematical languages, Multisim considers the unary minus to have higher precedence than exponentiation (power) operators ** and ^. This means that {-5**2} is +25 while {0-5**2} is -25. Although this is unintuitive, it is standard among SPICE simulators. Use brackets to ensure logical, readable expressions in this case.

 

Related Information

VALUE Type Source

Compatibility Modes

WAS THIS ARTICLE HELPFUL?

Not Helpful