Function Name

Alternate Name

Parameters

Description

Notes

if

—

(test,a,b)

Ifelse 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 )

Arcsine function.

—

sinh

—

( x )

Hyperbolic sine function.

—

asinh

arcsinh

( x )

Archyperbolic sine function.

—

cos

—

( x )

Cosine function.

—

acos

arccos

( x )

Arccosine function.

—

cosh

—

( x )

Hyperbolic cosine function.

—

acosh

arccosh

( x )

Archyperbolic cosine function.

—

tan

—

( x )

Tangent function.

—

tanh

—

( x )

Hyperbolic tangent function.

—

atan

arctan

( x )

Arctangent function.

—

atanh

arctanh

( x )

Archyperbolic tangent function.

—

atan2

—

( x, y )

Atan 2 function.

Same as:
atan (x/y)

exp

—

( x )

Calculates the exponential e^{x}.

—

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 base10 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 xvalues 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 xvalue), result in an output equal to yn. In other words, table function acts as a limiter in those regions.
Using this function in a Valuetype Arbitrary source is functionally equivalent to using the Tabletype 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 nonlinear controlled source expressions.

V

—

(node1, node2)

Voltage difference of two nodes.

Can only be used in nonlinear 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 nonlinear 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 notpositive function.

if (x > 0) nonpos(x) = 0 else nonpos(x) = x

nonneg

—

( x )

Ensure notnegative function.

if (x < 0) nonneg(x) = 0 else nonneg(x) = x

nonzero

—

( x )

Ensure nonzero 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.
