Laplace expression syntax

I am using voltage controlled voltage source with Laplace expression and the QSPICE says something is wrong (Fatal error: E2: Can’t numerically factor this Laplace expression.) in my expression:


May I ask for help to correct it? I assume the error related to the exp() because without it it works properly, but I have used very similar expression in LTspice without any error.

That should run in the frequency domain, but QSPICE won’t attempt it in the time domain. Time domain Laplace is done by synthesizing an equivalent circuit, which isn’t possible if you use a transcendental function like exp().

Following your comment I found the related chapter in the documentation about Laplace expressions and transcendental functions. Thank you.

I have tried some approximation and it worked fairly well. Then I tried to put the expression into a user defined function and I experienced some unusual behavior. For running the simulation the waveform viewer is closed but no error message. Do I miss something in the syntax again? It is even allowed to put function of s into the Laplace expression?

Laplace= delay(tau)*(1/(1+0.001*s)**2)
.func delay(tau) ((1-(tau/2.0)*s+(tau*tau/8.0)*s*s)/(1+(tau/2.0)*s+(tau*tau/8.0)*s*s))
.param tau = 2m

I encounter same experience as you did if to replicate your schematic. But function with laplace expression can work properly with standard transfer function.