Difference between revisions of "B sources (complete reference)"

From LTwiki-Wiki for LTspice
(Created page with '== '''B-sources''' == This is supposed to be like the corresponding Help file topic, but with more complete information. (Note: some of information is somewhat out-of-date, but …')
 
m (B-sources)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== '''B-sources''' ==
 
== '''B-sources''' ==
  
This is supposed to be like the corresponding Help file topic, but with more complete information.
+
This reference is consistent with the Help file topic, but with friendlier presentation and more complete information.  For examples of b-source usage see [[B sources (common examples)]].
(Note: some of information is somewhat out-of-date, but is still generally correct.)
 
  
 
'''B.  Arbitrary behavioral voltage or current sources.'''
 
'''B.  Arbitrary behavioral voltage or current sources.'''
  
Symbol names: BV, BI, *BR (arbitrary resistor)
+
Symbol names: BV, BI, *BR (arbitrary resistor), *BP (arbitrary power sink or source)
  
 
Syntax (* denotes undocumented features):
 
Syntax (* denotes undocumented features):
     Bxxx n1 n2 V=<expression> OR I=<expression> [Rpar=<value>]
+
     Bxxx n1 n2 V=<expression>
 +
    Bxxx n1 n2 I=<expression> [Rpar=<value>] *[Cpar=<value>]
 
     + [[ic=<value>] tripdv=<value>] [tripdt=<value>]
 
     + [[ic=<value>] tripdv=<value>] [tripdt=<value>]
 
     + [Laplace=<func(s)> [window=<time>] [nfft=<num>] [mtol=<num>]]
 
     + [Laplace=<func(s)> [window=<time>] [nfft=<num>] [mtol=<num>]]
 
  *  + [[units] Freq=<valuelist> [delay=<value>]]
 
  *  + [[units] Freq=<valuelist> [delay=<value>]]
 
  *  + [NoJacob]
 
  *  + [NoJacob]
The first syntax specifies a behavioral voltage source and the next is a behavioral current source. For the current source, a parallel resistance may be specified with the Rpar instance parameter.
+
  *  Bxxx n1 n2 R=<expression>
 +
*  Bxxx n1 n2 P=<expression> [VprXover=<value>]
  
Tripdv and tripdt control step rejection. If the voltage across a source changes by more than tripdv volts in tripdt seconds, that simulation time step is rejected.
+
The first syntax specifies a behavioral voltage source and the next is a behavioral current source.&nbsp; For the current source, parallel resistance and capacitance may be specified with the '''Rpar''' and '''Cpar''' instance parameters.
  
The Laplace transform is applied to the result of the behavioral current or voltage signal.  The Laplace transform must be a function of s.  The frequency response at frequency f is found by substituting s with sqrt(-1)*2*pi*f.  The time domain behavior is found from the impulse response obtained from the Fourier transform of the frequency domain response. LTspice must guess an appropriate frequency range and resolution.  The response must drop at high frequencies or an error is reported.  It is recommended that the LTspice first be allowed to make a guess at this and then check the accuracy by reducing reltol and/or mtol (*default=1) or explicitly setting nfft and the window.  The reciprocal of the val-ue of the window is the frequency resolution.  The value of nfft times this resolution is the highest fre-quency considered.  For Laplace expressions, ^ signifies exponentiation.
+
'''Tripdv''' and '''tripdt''' control step rejection.&nbsp; If the voltage across a source changes by more than '''tripdv''' volts in '''tripdt''' seconds, that simulation time step is rejected. See [[B sources (common_examples)]] for a case where this does not appear to apply.
  
''* The transfer function of the Freq circuit element is specified by an ordered list of points of freq(Hz), mag(dB) and phase(deg) as follows: <(f1,m1,p1)[(f2,m2,p2)...]> where f1<f2<f3, etc. The following units specifiers may optionally precede the Freq keyword: “rad”=radians, “mag”=non dB, (“dB” and “deg” return the defaults), “r_i”=real and imaginary in place of magnitude and phase. If a delay value is called out, the phases of the table values are modified to reflect the delay (delay is automatically adjusted to maintain causality in any case).
+
The Laplace transform is applied to the result of the behavioral current or voltage signal.&nbsp; The Laplace transform must be a function solely of '''s'''.&nbsp; The frequency response at frequency f is found by substituting '''s''' with sqrt(-1)*2*pi*f.&nbsp; The time domain behavior is found from the impulse response obtained from the Fourier transform of the frequency domain response.&nbsp; LTspice must guess an appropriate frequency range and resolution.&nbsp; The response must drop at high frequencies or an error is reported.&nbsp; It is recommended that the LTspice first be allowed to make a guess at this and then check the accuracy by reducing '''reltol''' and/or '''mtol''' (*default=1) or explicitly setting '''nfft''' and the '''window'''.&nbsp; The reciprocal of the value of the '''window''' is the frequency resolution.&nbsp; The value of '''nfft''' times this resolution is the highest frequency considered.&nbsp; For Laplace expressions, ^ signifies exponentiation.
 +
 
 +
<nowiki>*</nowiki> The transfer function of the '''Freq''' circuit element is specified by an ordered list of points of freq(Hz), mag(dB) and phase(deg) as follows: <(f1,m1,p1)[(f2,m2,p2)...]> where f1<f2<f3, etc.&nbsp; The following units specifiers may optionally precede the '''Freq''' keyword: “'''rad'''”=radians, “'''mag'''”=non dB, (“dB” and “deg” return the defaults), “'''r_i'''”=real and imaginary in place of magnitude and phase.&nbsp; If a '''delay''' value is called out, the phases of the table values are modified to reflect the '''delay''' ('''delay''' is automatically adjusted to maintain causality in any case).
 +
 
 +
<nowiki>*</nowiki> The '''NoJacob''' parameter unburdens a device from carrying the mathematical overhead of a Jacobian.&nbsp; For linear or certain well behaved b-source expressions or reporting b-sources with zero output connections, this small reduction in computational burden can reduce run times ''slightly''.&nbsp; Use with <font color="red">extreme caution</font>, as this greatly increases the risk of creating convergence problems or other errors if misapplied.
 +
 
 +
<nowiki>*</nowiki> '''Bn R=f(...)'''&nbsp; Arbitrary Resistor where function '''f''' is a constant or is an arbitrary function of any valid node voltage, branch current, etc. as with standard b-sources.&nbsp; Function must be written such that R is never be allowed to go to zero (note: power is sourced when '''f''' is negative).&nbsp;
 +
 
 +
<nowiki>*</nowiki> '''Bn P=f(...)'''&nbsp; Arbitrary Power Sink or Source where function '''f''' is a constant or is an arbitrary function of any valid node voltage, branch current, etc. as with standard b-sources (note: power is sourced when '''f''' is negative).&nbsp; In order to avoid large currents at voltages near zero, the arbitrary power sink/sources foldbacks to resistive behavior when the absolute value of voltage across the device falls below a default value of 1 volt.&nbsp; The foldback point may be modified by specifying a '''VprXover''' parameter for the device, e.g. '''VprXover=50mV'''.
  
 
Expressions can contain the following:
 
Expressions can contain the following:
 
* Node voltages and differences, e.g. V(n1) and V(n1,n2).
 
* Node voltages and differences, e.g. V(n1) and V(n1,n2).
* Circuit element currents, e.g. I(S1), the current through switch S1 or Ib(Q1), the base current of Q1. However, it is assumed that the circuit element current is varying quasi-statically, that is, there is no instantaneous feedback between the current through the referenced device and the behavioral source output.
+
* Circuit element currents, e.g. I(S1), the current through switch S1 or Ib(Q1), the base current of Q1.&nbsp; However, it is assumed that the circuit element current is varying quasi-statically, that is, there is no instantaneous feedback between the current through the referenced device and the behavioral source output.&nbsp; Similarly, any ac component of such a device current is assumed to be zero in a small signal linear .ac analysis.&nbsp; All zero impedance voltage source type elements may be used for zero delay current sensing, i.e., BV, E, H, L (with Rs=0) and V (with Rs=0)
* The following operations, grouped in order of precedence of evaluation (* denotes undocu-mented features):
+
 
 +
* The following operations, grouped in order of precedence of evaluation (* denotes undocumented features):
 
   
 
   
  Symbol | Operation
+
  Symbol | Operation (resultant: b= boolean; r= real part only)
  --------+--------------------------------------------------
+
  ---------+--------------------------------------------------
    !   | convert succeeding expression to Boolean then
+
* ~ or ! b convert succeeding expression to Boolean then invert
* or ~  |  invert
+
    **  r floating point exponentiation
    **  | floating point exponentiation
+
      ^  | floating point exponentiation (Laplace only)
    ^  | floating point exponentiation (Laplace only)
+
  ---------+--------------------------------------------------
  --------+--------------------------------------------------
+
      /  | floating point division
    /  | floating point division
+
      *  | floating point multiplication
    *  | floating point multiplication
+
  ---------+--------------------------------------------------
  --------+--------------------------------------------------
+
      -  | floating point subtraction
    -  | floating point subtraction
+
      +  | floating point addition
    +  | floating point addition
+
  ---------+--------------------------------------------------
  --------+--------------------------------------------------
+
  *   ==  b true if preceding expression is exactly equal to succeeding expression, otherwise false
  * ==  | true if preceding expression is equal to
+
    >=  b true if preceding expression is greater than or equal to succeeding expression, otherwise false
        |  succeeding expression, otherwise false
+
    <=  b true if preceding expression is less than or equal to succeeding expression, otherwise false
    >=  | true if preceding expression is greater than or  
+
      b true if preceding expression is greater than succeeding expression, otherwise false
        |  equal to succeeding expression, otherwise false
+
      b true if preceding expression is less than succeeding expression, otherwise false
    <=  | true if preceding expression is less than or  
+
  ---------+--------------------------------------------------
        |  equal to succeeding expression, otherwise false
+
      b convert adjacent expressions to Boolean then XOR
    | true if preceding expression is greater than  
+
      b convert adjacent expressions to Boolean then OR
        |  succeeding expression, otherwise false
+
      b convert adjacent expressions to Boolean then AND
    | true if preceding expression is less than  
+
For Boolean operations True is 1 and False is 0.&nbsp; Boolean conversions return True if <expression> evaluates to greater than .5, else False.
        |  succeeding expression, otherwise false
 
  --------+--------------------------------------------------
 
    | convert adjacent expressions to Boolean then XOR
 
    | convert adjacent expressions to Boolean then OR
 
    | convert adjacent expressions to Boolean then AND
 
For Boolean operations True is 1 and False is 0. Boolean conversions return True if <expression> eva-luates to greater than .5, else False.
 
  
 
* The following keywords (global variables and constants):
 
* The following keywords (global variables and constants):
Line 65: Line 69:
 
  * echarge |  1.6021765e-19 | charge of an electron
 
  * echarge |  1.6021765e-19 | charge of an electron
 
  * kelvin  | -2.73150  e+02 | absolute zero in degrees C
 
  * kelvin  | -2.73150  e+02 | absolute zero in degrees C
* Any user defined parameters or functions. Note that the parameter substitution scheme is gen-erally symbolic, but that when curly braces are encountered, the enclosed expression is evaluated immediately. With functions all parameter substitution evaluation is always done before the simulation begins. For details, refer to the .param and the .func simulator directives defined in Help under the subchapter on Dot Commands.
+
*  Gmin  | settable const | minimum conductance = 1e-12 (or set via Ctrl Panel or .option statement)
 +
* Any user defined parameters or functions.&nbsp; Note that the parameter substitution scheme is generally symbolic, but that when curly braces are encountered, the enclosed expression is evaluated immediately.&nbsp; With functions all parameter substitution evaluation is always done before the simulation begins.&nbsp; For details, refer to the .param and the .func simulator directives defined in Help under the subchapter on Dot Commands.
 
    
 
    
 
* The following functions (* denotes undocumented functions):
 
* The following functions (* denotes undocumented functions):
  *Status     Name  | Function
+
  *status     Name  | Function (resultant: b= boolean; r= real part only)
 
  -------------------+---------------------------------------
 
  -------------------+---------------------------------------
 
             sin(x) | sine
 
             sin(x) | sine
 
             cos(x) | cosine
 
             cos(x) | cosine
 
             tan(x) | tangent
 
             tan(x) | tangent
            asin(x) | arc sine
+
arcsin(x), asin(x) r arc sine
            acos(x) | arc cosine
+
arccos(x), acos(x) r arc cosine
            atan(x) | arc tangent
+
arctan(x), atan(x) r arc tangent
 
         atan2(y,x) | arc tangent of y/x (four quadrant)
 
         atan2(y,x) | arc tangent of y/x (four quadrant)
 
         hypot(y,x) | hypotenuse: sqrt(x*x+y*y)
 
         hypot(y,x) | hypotenuse: sqrt(x*x+y*y)
Line 84: Line 89:
 
           acosh(x) | arc hyperbolic cosine
 
           acosh(x) | arc hyperbolic cosine
 
           atanh(x) | arc hyperbolic tangent
 
           atanh(x) | arc hyperbolic tangent
             exp(x) | exponential
+
             exp(x) | exponential e**x
    ln(x) or log(x) | natural logarithm
+
      ln(x), log(x) | natural logarithm
 
           log10(x) | base 10 logarithm
 
           log10(x) | base 10 logarithm
 
             sgn(x) | sign (0 if x = 0)
 
             sgn(x) | sign (0 if x = 0)
Line 91: Line 96:
 
             sqrt(x) | square root
 
             sqrt(x) | square root
 
  *        square(x) | x**2
 
  *        square(x) | x**2
*        pow(x,y) | x**y
+
          pow(x,y) r x**y
*        pwr(x,y) | abs(x)**y
+
          pwr(x,y) | abs(x)**y
*        pwrs(x,y) | sgn(x)*abs(x)**y
+
          pwrs(x,y) | sgn(x)*abs(x)**y
*        round(x) | round to nearest integer
+
          round(x) | round to nearest integer
 
             int(x) | truncate to integer part of x
 
             int(x) | truncate to integer part of x
 
           floor(x) | integer equal or less than x
 
           floor(x) | integer equal or less than x
Line 100: Line 105:
 
           min(x,y) | the lesser of x or y
 
           min(x,y) | the lesser of x or y
 
           max(x,y) | the greater of x or y
 
           max(x,y) | the greater of x or y
       limit(x,y,z) | equivalent to min(max(x,y),z)
+
       limit(x,y,z) | intermediate value of x, y, and z, equivalent to min(max(x,y),z)
 +
      uplim(x,y,z) | the lesser of x or y with soft limit zone of z
 +
      dnlim(x,y,z) | the greater of x or y with soft limit zone of z
 
           if(x,y,z) | if x > .5 then y else z
 
           if(x,y,z) | if x > .5 then y else z
   table(x,x1,y1...) | interpolate y(x) per a lookup table
+
   table(x,x1,y1...) | interpolate y(x) per a lookup table of monotonic (x1<x2<x3...) x-ordered point pairs
  or *tbl: x1<x2... |  of x-ordered point pairs
+
*  tbl(x,x1,y1...) | alternate form of table()
 
           uramp(x) | x if x > 0, else 0.
 
           uramp(x) | x if x > 0, else 0.
     *stp(x) or u(x) | unit step, 1 if x > 0, else 0
+
*     stp(x), u(x) | unit step, 1 if x > 0, else 0
 
             buf(x) | 1 if x > .5, else 0
 
             buf(x) | 1 if x > .5, else 0
    !(x) or inv(x) | 0 if x > .5, else 1
+
~(x), !(x), inv(x) | 0 if x > .5, else 1
 
             rand(x) | 0 < random num < 1 at x sharp steps/sec
 
             rand(x) | 0 < random num < 1 at x sharp steps/sec
 
           random(x) | 0 < random num < 1 at x soft steps/sec
 
           random(x) | 0 < random num < 1 at x soft steps/sec
*        white(x) | -.5 < ran num < .5 at x smooth steps/sec
+
          white(x) | -.5 < ran num < .5 at x smooth steps/sec
 
  *          fra(x) | white(x), but 0 if not SMPS steady state
 
  *          fra(x) | white(x), but 0 if not SMPS steady state
*          ddt(x) v time derivative (v = Verilog-A compatible)
+
            ddt(x) v time derivative (v = Verilog-A compatible)
* idt(x) or sdt(x) v time integral: idt(x[,ic[,assert]])
+
    idt(x), sdt(x) v time integral: idt(x[,ic[,assert]]) ic=initial constant, assert<>0 resets idt
*                  v  ic=initial constant, assert<>0 resets idt
+
          idtmod(x) v wrapping idt: idtmod(x[,ic[,mod[,offset]]]) offset < idtmod(x) < offset+mod
*        idtmod(x) v wrapping idt: idtmod(x[,ic[,mod[,offset]]])
+
    delay(x,y[,z]) v delay of x by min(y,z) seconds
*                  v  offset < idtmod(x) < offset+mod
+
  absdelay(x,y[,z]) v delay of x by min(y,z) seconds
*      delay(x,y) v delay of x by y seconds
+
        smallsig(x) | returns 1 if a .ac or .noise analysis is being done, otherwise returns 0.
*absdelay(x,y[,z]) v delay of x by min(y,z) seconds
+
 
 +
{{#widget:DISQUS
 +
|id=ltwiki
 +
|uniqid={{PAGENAME}}
 +
|url={{fullurl:{{PAGENAME}}}}
 +
}}

Latest revision as of 11:14, 7 November 2019

B-sources

This reference is consistent with the Help file topic, but with friendlier presentation and more complete information.  For examples of b-source usage see B sources (common examples).

B. Arbitrary behavioral voltage or current sources.

Symbol names: BV, BI, *BR (arbitrary resistor), *BP (arbitrary power sink or source)

Syntax (* denotes undocumented features):

   Bxxx n1 n2 V=<expression>
   Bxxx n1 n2 I=<expression> [Rpar=<value>] *[Cpar=<value>]
   + [[ic=<value>] tripdv=<value>] [tripdt=<value>]
   + [Laplace=<func(s)> [window=

The first syntax specifies a behavioral voltage source and the next is a behavioral current source.  For the current source, parallel resistance and capacitance may be specified with the Rpar and Cpar instance parameters.

Tripdv and tripdt control step rejection.  If the voltage across a source changes by more than tripdv volts in tripdt seconds, that simulation time step is rejected. See B sources (common_examples) for a case where this does not appear to apply.

The Laplace transform is applied to the result of the behavioral current or voltage signal.  The Laplace transform must be a function solely of s.  The frequency response at frequency f is found by substituting s with sqrt(-1)*2*pi*f.  The time domain behavior is found from the impulse response obtained from the Fourier transform of the frequency domain response.  LTspice must guess an appropriate frequency range and resolution.  The response must drop at high frequencies or an error is reported.  It is recommended that the LTspice first be allowed to make a guess at this and then check the accuracy by reducing reltol and/or mtol (*default=1) or explicitly setting nfft and the window.  The reciprocal of the value of the window is the frequency resolution.  The value of nfft times this resolution is the highest frequency considered.  For Laplace expressions, ^ signifies exponentiation.

* The transfer function of the Freq circuit element is specified by an ordered list of points of freq(Hz), mag(dB) and phase(deg) as follows: <(f1,m1,p1)[(f2,m2,p2)...]> where f1<f2<f3, etc.  The following units specifiers may optionally precede the Freq keyword: “rad”=radians, “mag”=non dB, (“dB” and “deg” return the defaults), “r_i”=real and imaginary in place of magnitude and phase.  If a delay value is called out, the phases of the table values are modified to reflect the delay (delay is automatically adjusted to maintain causality in any case).

* The NoJacob parameter unburdens a device from carrying the mathematical overhead of a Jacobian.  For linear or certain well behaved b-source expressions or reporting b-sources with zero output connections, this small reduction in computational burden can reduce run times slightly.  Use with extreme caution, as this greatly increases the risk of creating convergence problems or other errors if misapplied.

* Bn R=f(...)  Arbitrary Resistor where function f is a constant or is an arbitrary function of any valid node voltage, branch current, etc. as with standard b-sources.  Function must be written such that R is never be allowed to go to zero (note: power is sourced when f is negative). 

* Bn P=f(...)  Arbitrary Power Sink or Source where function f is a constant or is an arbitrary function of any valid node voltage, branch current, etc. as with standard b-sources (note: power is sourced when f is negative).  In order to avoid large currents at voltages near zero, the arbitrary power sink/sources foldbacks to resistive behavior when the absolute value of voltage across the device falls below a default value of 1 volt.  The foldback point may be modified by specifying a VprXover parameter for the device, e.g. VprXover=50mV.

Expressions can contain the following:

  • Node voltages and differences, e.g. V(n1) and V(n1,n2).
  • Circuit element currents, e.g. I(S1), the current through switch S1 or Ib(Q1), the base current of Q1.  However, it is assumed that the circuit element current is varying quasi-statically, that is, there is no instantaneous feedback between the current through the referenced device and the behavioral source output.  Similarly, any ac component of such a device current is assumed to be zero in a small signal linear .ac analysis.  All zero impedance voltage source type elements may be used for zero delay current sensing, i.e., BV, E, H, L (with Rs=0) and V (with Rs=0)
  • The following operations, grouped in order of precedence of evaluation (* denotes undocumented features):
  Symbol | Operation (resultant: b= boolean; r= real part only)
---------+--------------------------------------------------
* ~ or ! b convert succeeding expression to Boolean then invert
    **   r floating point exponentiation
     ^   | floating point exponentiation (Laplace only)
---------+--------------------------------------------------
     /   | floating point division
     *   | floating point multiplication
---------+--------------------------------------------------
     -   | floating point subtraction
     +   | floating point addition
---------+--------------------------------------------------
*   ==   b true if preceding expression is exactly equal to succeeding expression, otherwise false
    >=   b true if preceding expression is greater than or equal to succeeding expression, otherwise false
    <=   b true if preceding expression is less than or equal to succeeding expression, otherwise false
     >   b true if preceding expression is greater than succeeding expression, otherwise false
     <   b true if preceding expression is less than succeeding expression, otherwise false
---------+--------------------------------------------------
     ^   b convert adjacent expressions to Boolean then XOR
     |   b convert adjacent expressions to Boolean then OR
     &   b convert adjacent expressions to Boolean then AND

For Boolean operations True is 1 and False is 0.  Boolean conversions return True if <expression> evaluates to greater than .5, else False.

  • The following keywords (global variables and constants):
   Name   |     Value      | Description
----------+----------------+--------------------------------
   time   |    variable    | time in seconds
    pi    |  3.14159265359 | 
*  boltz  |  1.38062  e-23 | Boltzmann constant
* planck  |  6.62620  e-34 | Planck's constant
* echarge |  1.6021765e-19 | charge of an electron
* kelvin  | -2.73150  e+02 | absolute zero in degrees C
*  Gmin   | settable const | minimum conductance = 1e-12 (or set via Ctrl Panel or .option statement)
  • Any user defined parameters or functions.  Note that the parameter substitution scheme is generally symbolic, but that when curly braces are encountered, the enclosed expression is evaluated immediately.  With functions all parameter substitution evaluation is always done before the simulation begins.  For details, refer to the .param and the .func simulator directives defined in Help under the subchapter on Dot Commands.
  • The following functions (* denotes undocumented functions):
*status      Name  | Function (resultant: b= boolean; r= real part only)
-------------------+---------------------------------------
            sin(x) | sine
            cos(x) | cosine
            tan(x) | tangent
arcsin(x), asin(x) r arc sine
arccos(x), acos(x) r arc cosine
arctan(x), atan(x) r arc tangent
        atan2(y,x) | arc tangent of y/x (four quadrant)
        hypot(y,x) | hypotenuse: sqrt(x*x+y*y)
           sinh(x) | hyperbolic sine
           cosh(x) | hyperbolic cosine
           tanh(x) | hyperbolic tangent
          asinh(x) | arc hyperbolic sine
          acosh(x) | arc hyperbolic cosine
          atanh(x) | arc hyperbolic tangent
            exp(x) | exponential e**x
     ln(x), log(x) | natural logarithm
          log10(x) | base 10 logarithm
            sgn(x) | sign (0 if x = 0)
            abs(x) | absolute value
           sqrt(x) | square root
*        square(x) | x**2
          pow(x,y) r x**y
          pwr(x,y) | abs(x)**y
         pwrs(x,y) | sgn(x)*abs(x)**y
          round(x) | round to nearest integer
            int(x) | truncate to integer part of x
          floor(x) | integer equal or less than x
           ceil(x) | integer equal or greater than x
          min(x,y) | the lesser of x or y
          max(x,y) | the greater of x or y
      limit(x,y,z) | intermediate value of x, y, and z, equivalent to min(max(x,y),z)
      uplim(x,y,z) | the lesser of x or y with soft limit zone of z
      dnlim(x,y,z) | the greater of x or y with soft limit zone of z
         if(x,y,z) | if x > .5 then y else z
 table(x,x1,y1...) | interpolate y(x) per a lookup table of monotonic (x1<x2<x3...) x-ordered point pairs
*  tbl(x,x1,y1...) | alternate form of table()
          uramp(x) | x if x > 0, else 0.
*     stp(x), u(x) | unit step, 1 if x > 0, else 0
            buf(x) | 1 if x > .5, else 0
~(x), !(x), inv(x) | 0 if x > .5, else 1
           rand(x) | 0 < random num < 1 at x sharp steps/sec
         random(x) | 0 < random num < 1 at x soft steps/sec
          white(x) | -.5 < ran num < .5 at x smooth steps/sec
*           fra(x) | white(x), but 0 if not SMPS steady state
            ddt(x) v time derivative (v = Verilog-A compatible)
    idt(x), sdt(x) v time integral: idt(x[,ic[,assert]]) ic=initial constant, assert<>0 resets idt
         idtmod(x) v wrapping idt: idtmod(x[,ic[,mod[,offset]]]) offset < idtmod(x) < offset+mod
    delay(x,y[,z]) v delay of x by min(y,z) seconds
 absdelay(x,y[,z]) v delay of x by min(y,z) seconds
       smallsig(x) | returns 1 if a .ac or .noise analysis is being done, otherwise returns 0. 

blog comments powered by Disqus