Can .step list be used with .func?

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?

Try like this:

Then you can plot results like geatpeak(X), or you can plot only X

Best regards.

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.

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.


Update your Qspice, Mike implemented a change to support .step list with function.

That’s awesome.

@KSKelvin Thanks for letting me know!