** Next:** Tran Functions
** Up:** Voltage and Current Sources
** Previous:** Device Expressions
** Contents**
** Index**

##

POLY Expressions

In SPICE2, nonlinear polynomial dependencies are specified using a
rather cumbersome syntax keyed by the word `poly`. For
compatibility, this syntax is recognized by the dependent sources in
*WRspice*, making possible the use of the large number of behavioral
models developed for SPICE2.

There are three polynomial equations which can be specified through the
`poly(`*N*) parameter.

`poly(1) `One-dimensional equation
`poly(2) `Two-dimensional equation
`poly(3) `Three-dimensional equation

The dimensionality refers to the number of controlling variables; one,
two, or three. These parameters must immediately follow the `poly(`*N*) token. The inputs must correspond to the type of the
source, either pairs of nodes for voltage-controlled sources, or
voltage source or inductor names for current-controlled sources.
Following the inputs is the list of polynomial coefficients which
define the equation. These are constants, and may be in any format
recognized by *WRspice*.
The simplest case is one dimension, where the coefficients `c0, c1, ...`
evaluate to

*c*_{0} + *c*_{1}*x* + *c*_{2}*x*^{2} + *c*_{3}*x*^{3} + ...

The number of terms is arbitrary. If the number of terms is exactly one,
it is assumed to be the linear term (`c1`) and not the constant
term. The following is an example of a voltage-controlled voltage source
which utilizes `poly(1)`.
`epolysrc 1 0 poly(1) 3 2 0 2 0.25
`

The source output appears at node 1 to ground (note that *WRspice* can use
arbitrary strings as node specifiers). The input is the voltage difference
between nodes 3 and 2. The output voltage is twice the input voltage
plus .25 times the square of the input voltage.
In the two dimensional case, the coefficients are interpreted in the
following order.

*c*_{0} + *c*_{1}*x* + *c*_{2}*y* + *c*_{3}*x*^{2} + *c*_{4}*xy* + *c*_{5}*y*^{2} + *c*_{6}*x*^{3} + *c*_{7}*x*^{2}*y* + *c*_{8}*xy*^{2} + *c*_{9}*y*^{3} + ...

For example, to specify a source which produces
`3.5*v(3,4) + 1.29*v(8)*v(3,4)`, one has
exx 1 0 poly(2) 3 4 8 0 0 3.5 0 0 1.29

Note that any coefficients that are unspecified are taken as zero.
The three dimensional case has a coefficient ordering interpretation
given by

*c*_{0} + *c*_{1}*x* + *c*_{2}*y* + *c*_{3}*z* + *c*_{4}*x*^{2} + *c*_{5}*xy* + *c*_{6}*xz* + *c*_{7}*y*^{2} + *c*_{8}*yz* + *c*_{9}*z*^{2} + *c*_{10}*x*^{3} + *c*_{11}*x*^{2}*y* + *c*_{12}*x*^{2}*z* +

*c*_{13}*xy*^{2} + *c*_{14}*xyz* + *c*_{15}*xz*^{2} + *c*_{16}*y*^{3} + *c*_{17}*y*^{2}*z* + *c*^{18}*yz*^{2} + *c*_{19}*z*^{3} + ...

which is rather complex but careful examination reveals the pattern.

** Next:** Tran Functions
** Up:** Voltage and Current Sources
** Previous:** Device Expressions
** Contents**
** Index**
Stephen R. Whiteley
2017-03-28