Integrating in LTSPICE

Discussion in 'Programmer's Corner' started by OccamsUbersaw, Feb 28, 2013.

  1. OccamsUbersaw

    Thread Starter New Member

    Feb 23, 2013
    4
    0
    tl;dr : how do you use "idt" to integrate the product of 2 waveforms?

    I have been trawling the web for hours now and am still no closer to working this out.
    I have seen this operator 'idt' floating around on various pages but have had no luck using it.
    I am trying to model switching losses in a BJT, and am trying to generate a waveform that follows the integral of Ic*Vce so i can record the change in energy over the switching period.

    I have Ic and Vce plotted for around 10 cycles over 400us.
    I have the power plotted Ic*Vce
    but using idt(Ic*Vce) is not working (says 'undefined symbol in' <formula>)and I cant think of a workaround / work out how to make it work.

    Any spice gurus know / can help?

    Thanks
     
  2. w2aew

    Member

    Jan 3, 2012
    219
    64
    I haven't seen the "idt" operator in LTSpice. Searching the help file for "integral" or "integration" only really yields the following entry for waveform plotter:

    "The waveform viewer can integrate a trace to obtain the average and RMS value over the displayed region. First zoom the waveform to the region of interest, then move the mouse to the label of the trace, hold down the control key and left mouse click."
     
  3. OccamsUbersaw

    Thread Starter New Member

    Feb 23, 2013
    4
    0
    idt entry is under LTxpice>Circuit Elements>B. Arbitrar..... in help
    dont know how I can make use of it...
     
  4. gootee

    Senior Member

    Apr 24, 2007
    447
    50
    You can use LaPlace transforms in a behavioral source... 1/s? I don't think that would work for a time-domain simulation, though.

    Or you could use a multiplier and then an opamp integrator circuit. But that probably wouldn't quite give the "ideal" result.

    Have you tried searching the archives of the LT-Spice users group, at yahoogroups.com?
     
  5. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Do you want to see a waveform, or simply a numerical result? The latter is easy.
     
  6. kf5rcl

    New Member

    Apr 13, 2016
    1
    0
    I use a B source ("bv" in components) to output a idt calculation. For example, I have a B source whose value is "V=idt(I(G1) * V(vr))" where I(G1) is the current of a VCCS and V(vr) is the voltage at a label. So the voltage of the B source is the integral of a current times a voltage.
     
  7. crutschow

    Expert

    Mar 14, 2008
    13,001
    3,229
    If you Alt-Left Click on the transistor, you will get a plot of the instantaneous power dissipated in the transistor with time.
    If you then do as Alan suggest in Post #2:
    "First zoom the waveform to the region of interest, then move the mouse to the label of the trace, hold down the control key and left mouse click."
    you will get the integrated value of the power over the time interval.
    Is that what you want?
     
Loading...