Power calculation with odd waveforms

Thread Starter

Veracohr

Joined Jan 3, 2011
772
The attached image is the current from the voltage supply of an amplifier circuit which I'm trying to figure out efficiency for. How would you calculate the power from an non-sinusoid like this?

LTSpice gives an average current of 36.3mA and RMS of about 45mA. I exported the simulation data and did a manual RMS calculation from a 100ms sample and got 34mA. I don't know why my manual calculation more closely matches LTSpice's average instead of its RMS calculation. It makes a 6% difference in the efficiency figure of the circuit, so which is correct?
 

Attachments

crutschow

Joined Mar 14, 2008
34,412
You need to adjust the RMS calculation "Interval Start" and "Interval End" times so that LTspice performs the calculation for exact multiples of the cycle period. If it performed the calculation for the complete waveform displayed in your picture, the calculation would be off since an integral number of cycles is not being shown.
 

Thread Starter

Veracohr

Joined Jan 3, 2011
772
I just did a quick zoom so you could see the shape of the waveform. I assume by "Interval Start/End" you mean the time axis of the waveform, and it is an interval number of cycles when I do the calculation, 100ms simulation time with a 1kHz test signal.
 

crutschow

Joined Mar 14, 2008
34,412
That's okay the way you did it, but I meant the Start and Stop times that show in the pop-up when you do the RMS waveform calculation.

So how did you do your manual calculation?
 

Thread Starter

Veracohr

Joined Jan 3, 2011
772
Hmm...the only way I know how to get an RMS calculation is to Control-Left click on the trace name at the top (actually Command-Control-Left Click, using Windows inside Parallels on a Mac). I looked through menus but couldn't find any settings relating to RMS, and I didn't find anything in the LTSpice User's Guide.

For the manual calculation, I squared each sample, then averaged them, then took the square root of the average. I set the simulation for 1μs maximum time step, but the samples in the data export seemed to be about 1.2μs for some reason.
 

ronv

Joined Nov 12, 2008
3,770
You can get one cycle by using time to start saving data and stop time under edit - spice analysis. In your case it looks like time to start saving data would be 34.75 ms and stop time 35.75ms.
You can get a direct power reading by holding down ALT and mousing over the component you want to measure the power in.
 

crutschow

Joined Mar 14, 2008
34,412
Sounds like you calculated the RMS value correctly. And I'm fairly certain that LTspice calculates the RMS value correctly also. So I don't understand the difference between your calculation and LTspice's. :confused:
 
Top