PWL - PWL Controlled Source (Single-Ended IO)
Model Kind
General
Model Sub-Kind
Generic Editor
SPICE Prefix
A
Model Name
PWL
SPICE Netlist Template Format
@DESIGNATOR %1 %2 @"DESIGNATOR"PWL
.MODEL @"DESIGNATOR"PWL pwl (x_array =[@x_array] y_array =[@y_array] ?input_domain|input_domain=@input_domain| ?fraction|fraction=@fraction|)
Parameters (definable at component level)
The following component-level parameters are definable for this model type and are listed on the Parameters tab of the Sim Model dialog. To access this dialog, simply double-click on the entry for the simulation model link in the Models region of the Component Properties dialog.
x_array | x-element array. Enter a list of progressively increasing values, using spaces as separators. At least two values must be entered for the array. |
y_array | y-element array. Enter a list of values, using spaces as separators. At least two values must be entered for the array. |
input_domain | input smoothing domain. Enter a value in the range 1.0e-12 to 0.5 (Default = 0.01). |
fraction | used to control whether the smoothing domain is specified as a fractional (TRUE) or absolute (FALSE) value. (Default = TRUE). |
Notes
The function of this model is to take the input signal and provide an output that is dependent on a piece-wise linear waveform, as defined by coordinate values specified in the x_array
and y_array
parameters.
The x_array
parameter values are input coordinate points (progressively increasing), while the y_array
parameter values represent the corresponding outputs at those points. You could think of the function as being analogous to a look-up table, where the input signal amplitude is mapped to the corresponding input value in the x_array
and then the y_array
value that this is paired with, is used for the output signal.
For values of the input signal that are smaller than the first element value of x_array
and greater than that of the last, the function uses the lowest and highest two coordinate pairs respectively and extends the slope between each. The function is therefore perfectly linear before the first coordinate and after the last coordinate specified by the arrays.
The PWL function does not have inherent output limiting. Care should therefore be taken as it is quite possible to end up with excessively large or small outputs for larger values of input.
The use of the smoothing domain around each coordinate point in the defined PWL waveform, reduces the possibility of non-convergence. Inherent checking of the value entered for the input_domain
parameter is carried out by the model, so that overlap of smoothing domains does not result from too high a value being specified.
Care should be taken when using the smoothing domain as a fractional value (fraction
= TRUE), as excessive smoothing can result if the coordinates specified in the x_array
and y_array
parameters are inappropriate.
The input signal can be either a single-ended current or single-ended voltage signal.
Examples
Consider the PWL function in the above image, with the following characteristics:
- Pin1 (input) is connected to net
In
- Pin2 (output) is connected to net
Out
- Designator is
U1
- x_array =
0 1 2 3 4 5 6 7 8 9 10
- y_array =
0 0 0 5 10 10 10 5 0 0 0
- input_domain =
1e-3
- fraction =
FALSE
The Time/Value Pairs
for the Piecewise-Linear Voltage Source are:
0U 0V
10U 1V
20U 2V
30U 3V
40U 4V
50U 5V
60U 6V
70U 7V
80U 8V
90U 9V
100U 10V
The entry in the SPICE netlist would be:
*Schematic Netlist:
AU1 IN OUT AU1PWL
.MODEL AU1PWL pwl (x_array =[0 1 2 3 4 5 6 7 8 9 10] y_array =[0 0 0 5 10 10 10 5
+ 0 0 0] input_domain=1e-3 fraction=FALSE)
The effect of the function can be seen in the resultant waveforms obtained by running a transient analysis of the circuit.
In this example, the following analysis parameters on the Transient/Fourier Analysis page of the Analyses Setup dialog have been used:
- Transient Start Time - set to
0.000
- Transient Stop Time - set to
100.0u
- Transient Step Time - set to
400.0n
- Transient Max Step Time - set to
400.0n