This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How do I understand and control the size of time stepping when the defaults work poorly? (time steps are too large to simulate circuit well)

Other Parts Discussed in Thread: OPA827, TINA-TI

I am simulating an audio-range state-variable filter, using OPA827 opamps and THAT 2180C voltage controlled amplifiers. Doing a transient analysis (5ms-50ms) results in time steps that are far too large to simulate accurately, and my decaying sine waves look like they're constructed of just a few linear segments. Other symptoms include DC convergence failing and oscillations - some slowly rise to supply voltages or decay back to zero from changing oscilloscope horizontal scale (time resolution), with no circuit changes, or a small (10mv) parasitic oscillation may appear and disappear, likewise controlled by oscilloscope scaling..

If I change the maximum time step (TR maximum time step) from its default of 10 gigaseconds to 100 nanoseconds or less, transient simulations work correctly (at least it behaves like a theoretical state-variable filter, complete with Q enhancement at high frequencies and other typical misbehaviors), but nearly every time step (visible in the progress dialog) is 100ns, with the occasional shorter one.  Somewhere around 10us, the simulation starts to fail at high frequencies and/or high Qs.

Once, radically altering a bunch of other transient analysis parameters, I got similar but not as good results, where Tina was changing the step size more effectively, but not well enough. And I didn't save that parameter set, as I was pretty much thrashing randomly at the time.

In both cases, the simulation took absurd amounts of time compared to the default parameters.

I have tried all the other provided parameter sets, and none make any significant difference.

What I would like is to understand the way that Tina chooses the automatic step time well enough to adjust it to be sensitive enough to work with this circuit and similar ones.  What I would settle for is having a magic number to tweak that works better than limiting the maximum time step.

The .tsc file follows.

Filter, simple.TSC

  • Ken,

    I do not have a magic number or set of parameters that I can provide to you that will solve this problem other than changing the TR maximum time step to something below 100n. I ran the simulation at 50n and got reasonable results. The trade off between speed and accuracy is always a very difficult issue with all simulators. We have to set the max time step to 20n for many of our switching regulators or cycles will be missed.

    As far as I know, there is not way to "tune" the automatic setting for TINA-TI (the 10G setting). I have seen speed improvements with the truncation error factor and max iteration number, however, in this case, neither sped up the simulation significantly. The simulation ran on my machine in about 6 minutes. I realize that most op amp circuits run in a second or two, but 6 minutes is not bad compared to a SMPS that could take 20-30 minutes to run. I would avoid using the oscilliscope in this case since the simulation does take a while to complete.

  • Ken,

    Well, I guess I was incorrect. If you change the TR Time intrv subdivisions from 100 to 100k, the automatic routine will pick a much smaller intital time step. The next parameter TR truncation error factor should be changed from 7 to 1 (this is a factor by which the program overestimates the actual truncation error). Finally, change the DC relative error from 1m to 100u for smoother curves.

    Please see the attached example.

    Filter_simple_mod.TSC

     I hope this information helps.

  • "TR truncation error factor should be changed from 7 to 1"

    That's the magic number. Thank you.  With that at 1, I don't need to change any other parameters, and Tina chooses timesteps in the tens of nanoseconds (judging from the fast-moving numbers on the progress indicator). It takes a while, but it also produces the results I expect for a working filter.

    It looks like I need to learn more about what "truncation" means in this particular context.


    I also found this in a hspice help document at a university website (www.ece.uci.edu/docs/hspice/hspice_2001_2-71.html), but haven't done anything with it yet:

    "TRAP (trapezoidal) integration generally results in reduced program execution time, with more accurate results. However, trapezoidal integration can introduce an apparent oscillation on printed or plotted nodes that might not be caused by circuit behavior. To test if this is the case, run a transient analysis with a small timestep. If the oscillation disappears, it was due to the trapezoidal method.

    The GEAR method acts as a filter, removing the oscillations found in the trapezoidal method. Highly nonlinear circuits such as operational amplifiers can require very long execution times with the GEAR method. Circuits that are not convergent with trapezoidal integration often converge with GEAR. Default = TRAP (trapezoidal)."

    Thank you. It works, and I think I have enough information to do further research on my own.