In this Topic Hide
Axxxx input output model_name |
Name | Description | Flow | Default type | Allowed types |
---|---|---|---|---|
in | Input | in | v | v, vd, i, id |
out | Output | out | v | v, vd, i, id |
.MODEL model_name s_xfer parameters |
Name | Description | Type | Default | Limits | Vector bounds |
---|---|---|---|---|---|
in_offset | Input offset | real | 0 | none | n/a |
gain | Gain | real | 1 | none | n/a |
laplace | Laplace expression (overrides num_coeff and den_coeff) | string | none | none | n/a |
num_coeff | Numerator polynomial coefficient | real vector | none | none | $1 - \infty$ |
den_coeff | Denominator polynomial coefficient | real vector | none | none | $1 - \infty$ |
int_ic | Integrator stage initial conditions | real vector | 0 | none | none |
denormalized_freq | Frequency (radians/second) at which to denormalize coefficients | real | 1 | none | n/a |
This device implements an arbitrary linear transfer function expressed in the frequency domain using the 'S' variable. The operation and specification of the device is illustrated with the following examples.
Model for above device:
.model Laplace s_xfer laplace="1/(s+1)" denormalized_freq=1 |
This is a simple first order roll off with a 1 second time constant as shown below
.model Laplace s_xfer |
+ laplace="(1/s)/(1/s + 1/(0.1*s+1))" |
+ denormalized_freq=1 |
The laplace expression has been entered how it might have been written down without any attempt to simplify it. The above actually simplifies to (0.1*s+1)/(1.1*s+1).
.model Laplace s_xfer |
+ laplace="1/(s2+1.1*s+1)" |
+ denormalized_freq=2k |
The above expression is a second order response that is slightly underdamped. The following graph shows the transient response.
The S-domain transfer block has a number of built in functions to implement standard filter response. Here is an example. This is a 5th order chebyshev with -3dB at 100Hz and 0.5dB passband ripple.
.model Laplace s_xfer |
+ laplace="chebyshevLP(5,100,0.5)" |
+ denormalized_freq=1 |
and the response:
As seen in the above examples, the transfer function of the device is defined by the model parameter LAPLACE. This is a text string and must be enclosed in double quotation marks. This may be any arithmetic expression containing the following elements:
Operators: |
|
|||||||
Constants | Any decimal number following normal rules. SPICE style engineering suffixes are accepted. | |||||||
S Variable | This can be raised to a power with '^' or by simply placing a constant directly after it (with no spaces). E.g. s^2 is the same as s2. | |||||||
Filter response functions |
These are:
Where:
|
Instead of entering a Laplace expression as a string, this can also be entered as two arrays of numeric coefficients for the numerator and denominator. In general this is less convenient than entering the expression directly, but has the benefit that it supports the use of parameters. In this method, use the NUM_COEFF and DEN_COEFF parameters instead of the LAPLACE expression.
The following simple example, demonstrates the method
.param f0=10 |
.param w0 = {2*3.14159265*f0} |
.model laplace s_xfer num_coeff = [1] den_coeff = [{1/w0},1] |
SIMetrix expands the expression you enter to create a quotient of two polynomials. If the constant terms of both numerator and denominator are both zero, both are divided by S. That process is repeated until one or both of the polynomials has a non-zero constant term.
The result of this process must satisfy the following:
The SIMetrix Laplace transfer model is compatible with the original XSPICE version but the transient analysis portion of it has been completely rewritten. The original XSPICE version was seriously flawed and would only give accurate results if the timestep was forced to be very small. Further, convergence would fail if the device was used inside a feedback loop.
The ability to enter the laplace transform as an arbitrary expression is a SIMetrix enhancement. The original version required the user to enter the coefficients of the numerator and denominator explicitly. The filter response functions are also a SIMetrix enhancement.
|