Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] LTspice AC and transient simulation error

Status
Not open for further replies.

SK245230

Member level 3
Joined
Nov 24, 2015
Messages
57
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
1,844
Hi,
I was working on LTSpice when I encountered a problem between AC and transient simulation. I was simulating the simple RLC circuit below:
ok1.png

I was searching the frequency when the imaginary part of impedance is equal to zero im(Zin)=0.
From AC simulation I get something like 6.497MHz which correspond to the theoretical value im(Zin)=iLw+1/iCw=0 <=> f=1/(2Π√LC)=6.4975MHz
ok2.png

But when I run a transient simulation at 6.497MHz, it looks like there is still an imaginary part (the phase is different from 180° or 0°).
ok3.png

By tunning the frequency, I find that i get im(Zin)=0 at the frequency of 6.455MHz Which is not corresponding to theoretical value and AC simulation.
ok4.png

Did some of you encountered such difference between AC and transient simulation on LTspice? Maybe I've just forget to uncheck an option somewhere or to do something? Can you try with your simulator and check if you get such a difference? I've tested with both version of LTspice IV and XVII with latest update and I still get the error.

Also I checked with Orcad and a free online tool Partsim and they both give the right result (v and i in phase oppositon (phase(Zin)=180°))
ok6.png
ok5.png

(Yes I know some here are going to say that less than 1% of error on the frequency its not a big deal. Yes you are right but you get 50% of error on the phase which is not normal and on a very simple circuit. Moreover, other software and even free doesn't have this error.)

Thanks
 

Are you sure that in your pictures 3 and 4 steady state has been reached ? Because the time scales looks like is starting at 0 ns.
 
Your simulation uses a pre run time to achieve steady state, you didn't mention this fact and hide the simulation command.

Unfortunately the simulator chooses a larger automatic time step to reduce simulation time. Try with a maximum time step of 1ns or so.
 
This should not depend on steady state or not, the phase should stay the same.

However, you are right the problem comes from the time step. If you don't define it, I guess it fix it chose a big value and then you got a divergence after 10k points.
I think here is the problem. When you run an AC simulation, each simulation point is independent, but when you run a transient simulation each simulation point depend on the previous one ( v(t+1)=f(v(t)) ) and so if you have a slight error it will cumulate it and you've got a high divergence after 10k of points.
Here with a bad time step (10ns), at the beginning everything is normal (v an i are in opposition phase)
ok7.png
after an mount of simulation point you've got this divergence.
ok8.png
With 100ps time step it doesn't diverge
ok9.png
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top