Previous: Linear Dependent Sources, Up: Voltage and Current Sources


8.3.3 Non-linear Dependent Sources

General form:

          BXXXXXXX N+ N- <I=EXPR> <V=EXPR>

Examples:

          B1 0 1 I=cos(v(1))+sin(v(2))
          B1 0 1 V=ln(cos(log(v(1,2)^2)))-v(3)^4+v(2)^v(1)
          B1 3 4 I=17
          B1 3 4 V=exp(pi^i(vdd))

N+ is the positive node, and N- is the negative node. The values of the V and I parameters determine the voltages and currents across and through the device, respectively. If I is given then the device is a current source, and if V is given the device is a voltage source. One and only one of these parameters must be given.

The small-signal AC behaviour of the nonlinear source is a linear dependent source (or sources) with a proportionality constant equal to the derivative (or derivatives) of the source at the DC operating point.

The expressions given for V and I may be any function of voltages and currents through voltage sources in the system. The following functions of real variables are defined:

abs asinh cosh sin
acos atan exp sinh
acosh atanh ln sqrt
asin cos log tan

The function "u" is the unit step function, with a value of one for arguments greater than zero and a value of zero for arguments less than zero. The function "uramp" is the integral of the unit step: for an input x, the value is zero if x is less than zero, or if x is greater than zero the value is x. The function "u2" returns a value of zero for arguments less than zero, one for arguments greater than one and assumes the value of the argument between these limits .These three functions are useful in sythesizing piece-wise non-linear functions, though convergence may be adversely affected.

Note: "u2" function has been introduced in rework-11.

The following standard operators are defined:

     +       -       *       /       { }      unary -

If the argument of log, ln, or sqrt becomes less than zero, the absolute value of the argument is used. If a divisor becomes zero or the argument of log or ln becomes zero, an error will result. Other problems may occur when the argument for a function in a partial derivative enters a region where that function is undefined.

To get time into the expression you can integrate the current from a constant current source with a capacitor and use the resulting voltage (don't forget to set the initial voltage across the capacitor). Non-linear resistors, capacitors, and inductors may be synthesized with the nonlinear dependent source. Non-linear resistors are obvious. Nonlinear capacitors and inductors are implemented with their linear counterparts by a change of variables implemented with the nonlinear dependent source. The following subcircuit will implement a nonlinear capacitor:

       .Subckt nlcap   pos neg
       * Bx: calculate f(input voltage)
       Bx   1    0    v = f(v(pos,neg))
       * Cx: linear capacitance
       Cx   2    0    1
       * Vx: Ammeter to measure current into the capacitor
       Vx   2    1    DC 0Volts
       * Drive the current through Cx back into the circuit
       Fx   pos  neg  Vx 1
       .ends

Non-linear inductors are similar.