It seems an ADE expression such as g=complex(-0.3 0.51) can't be sent to an impedance plot. I found the following expression will convert g to a wave which can be plotted,
g=(abs(s11)/(abs(s11)+1e-9))*complex(-0.3 0.51). ;; Where s11 is an output from sp simulation.
g is redundant in that it has the same value across all frequencies used to sweep s11 but that is not a problem since all of the points are coincident on the plot. I would like to extend this approach to create to a contour using something similar to
g=(abs(s11)/(abs(s11)+1e-9))*list(complex(-0.3 0.51) complex(-0.2 0.51) complex(-0.1 0.51))
As shown above an expression error occurs. Is there a syntax that will accomplish my goal?
I suppose getAsciiWave() would be better if many points were needed but for just a few points I'd prefer to just put them directly into the expression and avoid keeping track of extra ascii file(s).
There's also drCreateVec and drCreateWaveform if I wanted to go the Skill route. btw - is there a Skill function that will take a list of complex values and return a wave?
You could use abMakeWaveform from this post.
g=abMakeWaveform(list(complex(-0.3 0.51) complex(-0.2 0.51) complex(-0.1 0.51)) list(1 2 3) 'complex 'double)
The list(1 2 3) was just a list of arbitrary x-values. You could also use linRg(1 3 1) (i.e. 1 to 3 in steps of 1).
Thanks Andrew, your suggestion is spot on and works well.
To understand various approaches I tried the artListToWaveform() function.
The following expression works fine in the expression builder gui and when I click the "Evaluate Buffer ... If waveform plot" a plot is generated as expected, i.e. one complex value.
artListToWaveform('((1 (0.0 0.4))))
This GUI works as expected.
In the results tab a wave icon appears but when I attempt to plot I get an empty plot. No warning or error appears in the CIW. Any thoughts on why this happens and how to resolve?
I'd forgotten that artListToWaveform was public and that it could construct waveforms with complex values (my mistake). Anyway, something odd seems to be going on here - if I make the waveform have two points, it seems to then work:
artListToWaveform('((1 (0.0 0.4)) (2 (0.1 -0.3))))
but if I do plot all (if run over corners say), I only get a single trace plotted (I know they are all the same, but this seems slightly odd to me). I'm not sure why it doesn't plot a single point waveform.
I'm tied up at the moment - might be worth contacting customer support over this?