4.14  .model TABLE: Fit a curve

4.14.1  Syntax

.model name TABLE x1,y1 x2,y2 ... args

4.14.2  Purpose

Fits a table of data using piecewise polynomials, or splines.

4.14.3  Comments

This function fits a set of piecewise polynomials to a set of data.

It differs from the FIT function in that the TABLE form uses a .model statement containing the actual data, while the FIT form has all of the data on the instance line.

See the comments section of FIT for more detail on the options.

4.14.4  Parameters

Order = x
The order of the polynomial to fit, within the supplied data. (Default = 3) Legal values are 0, 1, 2, and 3, only.

Below = x
The value of the derivative to use below or before the specified range.

Above = x
The value of the derivative to use above or after the specified range.

4.14.5  Example

.model nlcap table -5,-5u 0,0 1,1u 4,2u 5,2u order=1
C1 (2 0) nlcap
This “capacitor” stores 5 microcoulombs at -5 volts (negative, corresponding to the negative voltage, as expected). The charge varies linearly to 0 at 0 volts, acting like a 1 microfarad capacitor. (C = dq/dv). This continues to 1 volt. The 0,0 point could have been left out. The charge increases only to 2 microcoulombs at 4 volts, for an incremental capacitance of 1u/3 or .3333 microfarads. The same charge at 5 volts indicates that it saturates at 2 microcoulombs. For negative voltages, the slope continues. See the example under FIT for a comparison.