OK

# Mathematical expressions

You can create arbitrary mathematical expressions consisting of various functions and operators and apply the results to device parameters.

The functions and operators in the expression can operate on numerical constants, on circuit parameters, and, when used within the Arbitrary Source device, on live circuit variables. Refer to the Supported mathematical functions, operators and constants section for a list of supported mathematical functions, operators and pre-defined constants.

Within the Arbitrary Source device, special functions `V(nodeabs)`, `V(node+,node-)`, and `I(deviceX)` can be used to reference the circuit voltages and currents.

• `V(nodeabs)` references the voltage at node nodeabs relative to ground.
• `V(node+,node-)` references the difference between node+ and node-.
• `I(deviceX)` references the current through the device with the instance name `deviceX``deviceX` refers to the SPICE netlist name of the device, not just the ID of the device. For example, `vMyVoltage` as opposed to `MyVoltage`. You can view the SPICE netlist name in the SPICE netlist tab of the Information pane.
Only the Independent Voltage source, dependent voltage sources, and inductor devices are supported.

• We recommend that expressions be enclosed in {} to avoid ambiguous syntax. However, this is not required for simulation.
• Portions of expressions that are not enclosed in {} or () should not contain any spaces.

Examples

*High-level filter specification
.param pole=1k
.param res_val=1k
R1 in out {res_val}
C1 out 0 {1/(2*pi*res_val*pole)}

*A very simple diode modeled using an expression in an Arbitrary source
G1 A C value={1e-12*(e^(V(A,C)/0.025)-1 ) }