Expressions can be used on Resistors (R), Capacitors (C), Inductors (L), and the R and G model parameters of the Lossy Transmission Line (4O) models. Nonlinear Dependent Source with arbitrary Voltage or Current Output (B element) can also use expressions. Expressions can use algebraic, transcendental, or trigonometric functions, node voltages, current through empty voltage source (equivalent to current through wire), and simulation time, frequency, and temperature. Passed parameters can also be used.
Note: Expressions are evaluated at each iteration without taking into account the previous dynamics of the circuit in other words no derivative are taken for node voltages or currents and only an algebraic evaluation is done based on the values of the parameters in the expression at the previous iteration.
You can specify simulation time, simulation frequency and/or circuit temperature as a variable in an expression. The keyword TIME specifies the instantaneous time, FREQ specifies the current AC analysis frequency, and TEMP specifies the circuit temperature as listed in the .OPTIONS TEMP= value (default =27). The effects of these variables in transient and AC analysis are summarized below.
Variable | Description |
TIME | Current simulator time
in seconds, 0 in the AC analysis |
FREQ | Current simulator frequency
in radians, 0 in the Transient analysis |
TEMP | Circuit temperature
in degrees C as specified in the .OPTIONS statement; default = 27, same for both the AC and Transient analyses |
You can specify IF-THEN-ELSE in expression. Concatenate hundreds of IF-THEN-ELSE statements together. No limit to length or complexity of expression used. Use different equations for different domains. TIME>0 for Transient Analysis and FREQ>0 for AC Analysis.
Format: | EVALUATION ? OUTPUT_VALUE1 or EXPRESSION : OUTPUT_VALUE2 or EXPRESSION |
if EVALUATION is true then OUTPUT_VALUE1 else OUTPUT_VALUE2 |
Use Passed Parameters in your expression. Type global parameters on your schematic. Change that parameter value and all expressions using that parameter will be based on the new value. Use intelligent parameter names in your expressions and make it easy for other people to modify your circuit.
Examples:
RS 15 32 R = 1K + 1K * sqrt(TIME) + 5 * TEMP | time and temperture dependent resistor |
Cin 2 0 C =1u + 1P * FREQ^2 | frequency dependent capacitor |
CT 1 0 C={Cval}*(1+{TC1}*(TEMP)+{TC2}*( TEMP)^2 ) | temperature dependent capacitor where { } quantities can be defined by parameters or stated explicitly |
LiF 2 0 L = v(3) > 1 ? 0.1U : 1U | If-then-else inductor |
Lf 1 2 L= 1n + sqrt(FREQ) | frequency dependent inductor |
Lm 1 0 L = 1U+2*V(3) + I(VR1) | V/I controlled inductor |
Lt 2 0 L=0.1p + 1m*TEMP + 10u*TEMP^2 | temperture controlled inductor |