eval_controlled_pwl()
Evaluates the piece-wise linear response of system when supplied with N pairs of data points in vector format
Syntax
eval_controlled_pwl( pwlvector, xin, [stretch], [scale] ) where pwlvector is a list( in1, out1, ..., inN, outN)
Arguments
| Name | Description | Range | Type | Default | Required |
|---|---|---|---|---|---|
| pwlvector | list of pairs of datapoints defining corners of the PWL function | list of (-∞, ∞) † † † | integer, real † † | yes | |
| xin | scalar input signal | (-∞, ∞) | integer, real, complex | yes | |
| stretch | used for scaling input signal prior to PWL computation | (-∞, 0) U (0, ∞) | integer, real | 1.0 | no |
| scale | used for scaling output signal following PWL computation | (-∞, ∞) | integer, real | 1.0 | no |
| † At least one pair of data points should be supplied. † † Only scalar inputs should be supplied. † † † First element should always be listed. If Ith element is listed then (I-1)th element should also be explicitly listed | |||||
Examples
The response of a system described by the three-point PWL vector
list( in 1 , out 1 , in 2 , out 2 , in 3 , out 3 ) to input xin , stretch , and scale is
xout = eval_controlled_pwl( list(in 1 , out 1 , in 2 , out 2 , in 3 , out 3 ), xin, stretch, scale )
- The input is stretched up to
xin ~ = min( xin*stretch, stretchEps ) where stretchEps is an internal limit generated when stretch is too close to zero. - The proper bin for xin ~ is detected using the three corner points along input axis: in 1 , in 2 , and in 3 , which may be out of order in the list() or file forms.
- If xin ~ falls within bounded limits, e.g., in 1 and in 3 , then xout ~ is computed using linear equation:
(xout ~ - out 3 ) * (in 1 - in 3 ) = (xin ~ - in 3 ) * (out 1 - out 3 ) else, if it falls in either of the two unbounded sections with nearest data point in i , out i , then constant extrapolation is done as follows:
xout ~ = out i - If scale factor is defined, it is used on the raw output. If not, scale is assumed to be unity. Thus:
xout = xout ~ * scale
Given:
pwlvector = list( 2, 4, 3, -1, -1, 3 )
xin=1
stretch=0.75
scale=3.0
xin ~ = 3/4
which falls within input side range (-1,2] with output side range (3, 4] . Thus,
xout~ = (3/4 - (-1))/(2 - (-1)) * (4 - 3) + 3
= 7/12 * 1 + 3
= 43/3
xout = 43/3 * 3.0
= 43
Notes/Equations
- This function exists in ADS primarily to emulate the behavior of piece-wise linear (PWL) behavior of single input, single output controlled voltage and current sources of the Cadence Spectre library. For further information about the sources cccs , ccvs , vccs , and vcvs , see the Cadence Spectre simulator's analog library documentation.
- This function supports PWL values either directly in list() or indirectly in file format. For PWL files, the following approach is recommended to create a list-based entry for the SYM function:
pwlData = read_data("file","<pwlvector_filename>","sppwl")
pwlIn = dstoarray(pwlData,"inputPWL")
pwlOut = dstoarray(pwlData,"outputPWL")
xout = eval_controlled_pwl(list(pwlIn, pwlOut), xin[, stretch[, scale]])
In this case the list() function concatenates the two vectors pwlIn and pwlOut by interleaving the values as expected by eval_controlled_pwl().
A PWL file is a simple ASCII data file containing two columns, for input and output values marking corner points of the function. This file may contain comment lines preceded by the ";" character. No explicit format information is expected from such a file. An example of a PWL file is:
; PWLfile
; Input Output
2 4.0
3 -1.0
-1 3.0
The file contents are equivalent to
list( 2, 4.0, 3, -1.0, -1, 3.0 ) Data points may be supplied out of order in either list or file format. The function automatically checks for duplicate points, which it tolerates, for ambiguity, such as one-to-many input-output mapping causing an error when encountered. - Default value of stretch is 1.0, but if a value is supplied and found to be too close to zero, its effective value is limited to a small non-zero number. This prevents interpolation errors due to infinitesimal shrinkage of input xin by the stretch factor. It ensures that xin ~ is truly 0.0 only when xin is 0.0.
- Only the real part of a complex input variable is affected by the PWL. The imaginary part merely gets stretched and scaled.
Privacy
Statement
|
Terms of Use
|
Legal |
Contact Us
|
© Agilent 2000-2008 ![]()