Drops
1
Can one use functions or parameters inside a .step command? I looked through the forums and saw that you could use .step with functions like so:
.step param X start() stop() stepsize()
See: .step command syntax
Where each function is defined.
But when I try it on my end with the list type it doesn’t work:
.func getPeak(Vrms) { Vrms * SQRT(2) }
.step param X list 0 getPeak(10) getPeak(20) getPeak(30)

Any advice?
ivan1
2
Try like this:
Then you can plot results like geatpeak(X), or you can plot only X
Best regards.
Drops
3
Hello Ivan, that won’t work for my use case though. You’re just stepping X as the values you wrote correct?
I wanted to be able to use my own functions to calculate the points to step X through.
For eg. Suppose I want the voltage source to be stepped in terms of the RMS of a sinewave instead of the amplitude, so I define
.step param X list Pk(10) Pk(20) Pk(30)
Where each value is the RMS of the sinewave, and the resulting list is of calculated magnitudes.
Drops
4
I’m also aware that for this example, you could technically do:

Or this:

Which would then mean X is a list of RMS sinewave values, but I was wondering if one could invoke functions inside the .step list command definition.
@Drops
Update your Qspice, Mike implemented a change to support .step list with function.
Drops
6
That’s awesome.
@KSKelvin Thanks for letting me know!