Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Simulation results for specific time points

kriszhyan
2013-01-07
2013-06-12
  • kriszhyan
    kriszhyan
    2013-01-07

    In my application, I need to have the values of some circuit variables at specific time points. For example, for a 1ms transient simulation, I may need the values of the output variable at 1us, 2us, etc.. Currently, I'm doing this by using the "stop when time=X" and "resume" commands. I'm wondering if this approach is efficient. If not, is there any better approach?

    Thanks in advance.

    - Yan

     
  • Holger Vogt
    Holger Vogt
    2013-01-08

    Yan,

    you may use the 'linearize' command.
    If you give
    tran 1u 1m
    linearize v(vout)
    will recalculate the values of the vector v(vout) on 1u steps (or of all vectors in the plot, if no argument is given) after the transient simulation, by using a simple interpolation algorithm. The vectors' names are kept, but the resulting vectors are stored a new plot (e.g. tran2 ).

    Another approach may be  to add a voltage source with PULSE option, setting the pulse edges on 1us steps. This should set internal breakpoints and force ngspice to use these time values (among others).

    Holger

     
  • kriszhyan
    kriszhyan
    2013-01-08

    Thanks Holger. The command "linearize" is really helpful.