0

I have a simple circuit in spice that I put a 0-5V step function into. So basically as square-wave going in. Then I can get my current and voltage waveforms out, or do some math to get power. But I really want to know say for 1ms how much power was used. I just want to compare a few approaches and my comparison that other people on my team will understand will be Watts. So I was thinking how many Watts were used in 1ms.

I'm thinking maybe I want to integrate under the power curve? Not sure exactly how to accomplish that in LTspice so I'm asking for some advice. I did read a little about the idt function.

confused
  • 1,786
  • 19
  • 34
  • 2
    You can do simple maths in the graph and multiply voltage and current. – PlasmaHH Dec 14 '16 at 15:23
  • That'll get me a graph of power, but I want to be able to say 1mW was used over 1ms and the response is non-linear. – confused Dec 14 '16 at 15:26
  • 3
    @Confused - Do what PlasmaHH said and plot V(t)*I(t). You can export that waveform to Excel/spreadsheet format. It is often easier to do calculations in Excel than trying to figure out how to do it in the waveform plotter. You can _sum_ the discrete instantaneous power values over the time window you're concerned with. (Reimann sum ~= integral for sufficiently small timesteps). Note that the unit is [J] or [W*s] after summing, not [W]. – vofa Dec 14 '16 at 15:27
  • 5
    LTSpice will integrate over a plotted signal. Ctrl + left click (maybe right click - I'm away from my computer and unsure now...). It can be made to integrate over a desired time period. – Matthew Dec 14 '16 at 18:19
  • @Matthew +1 Thank you I found that by accident, and that is the method that worked great for me. – confused Dec 15 '16 at 15:36

1 Answers1

1

There are two methods already mentioned for you in:

How to integrate a signal in LTSpice?

You really should start out with a search here. Spehro provides one method there, using a behavioral source ('bv' in the F2 dialog box) that you add to the schematic. Then you can probe that using the plot display viewer, use cursors to get values, etc. Another way was ALSO provided by Sergei on that same link. This uses .MEAS (just hit 'S' on your schematic and get the pop-up that allows you to create one of these) to perform the calculations for you. You can then use the View/SPICE Error Log menu choice to cause the error log to popup and display your measured value there. It's a great way to go if you know the exact start and stop times, for example.


Technically, I should have just commented all of the above to you. But it is long text and would have taken several comments to achieve. But also, I'm willing to post up an example case if you modify your question to be very specific about an example you'd like to see and don't feel you can work out. So I've added this as an answer with that in mind, as well. Just in case.

jonk
  • 77,059
  • 6
  • 73
  • 185