I'm using the s_xfer code model to implement an S-Domain (Laplace) Transfer Function that will ultimately be incorporated into a non-linear dependent current source.
The problem is that the transfer function is not a simple ratio of polynomials in s.
The transfer function is in the form of
1 / ((abs(s))^x) or 1 / pwr(abs(s),x)
where x is a real, but non-integer value.
I've done this successfully with PSPICE, but don't know if NGSPICE can handle it. Is it possible to implement this with s_xfer? The num_coeff and den_coeff parameters don't really support this.
If this isn't doable with s_xfer, does anyone have any ideas for a workaround?
While I cannot answer your question (I found it looking for s_xfer myself), I can say that there are differences in where and how functions can be used in ngspice - see the Segmentation fault when trying to define a LIMIT function post…
On the other hand, I've had problems just to get s_xfer to work properly, see posts s_xfer Chebyshev and noise analysis and Min.w.example for s_xfer, and strange results…
Sorry I cannot say much more than this - hope some of this helps..
Thanks for your response!
I have some additional info that may simplify this problem somewhat.
In the scenario here, the stimulus in this analysis is a pure tone. Therefore, at steady state, s will just have the imaginary component j*omega. A real component would indicate some sort of exponential growth/decay. Therefore, abs(s) is just the frequency of the stimulus tone for my case.
This lead me down the path of trying to use the "hertz" variable that is available when using a B source. However, this does not appear to be available outside of a B source.
So my next train of thought is:
Can "hertz" variable be made available for use outside of a B source? … Such as in an expression defining laplace model coeffs for each frequency iteration of an AC analysis. I could see this requiring a code change. I'm not familiar enough with the source code to know.
Log in to post a comment.