How to Use .MEAS to Calculate Average Voltage, RMS Voltage, Current, and Power in LTspice?

Question: If you want to record several measurements automatically, do you have to click each waveform trace manually?

Answer: No. You can use .MEAS directives to write measurement results to the SPICE Output Log when a transient simulation finishes. For the example with a 50 Ω load, use these five measurements:

.meas TRAN Vavg AVG V(out)
.meas TRAN Vrms RMS V(out)
.meas TRAN Iavg AVG I(Rload)
.meas TRAN Irms RMS I(Rload)
.meas TRAN Pavg AVG V(out)*I(Rload)

Figure 1 : Example circuit. The V(out) and I(Rload) traces are used to measure output voltage, load current, and power. (Image source: ADI.)

For the 0–5 ms measurement interval, the SPICE Output Log reports approximately:

Measurement Result
Average output voltage, Vavg 3 V
RMS output voltage 4.1231 V
Average load current, Iavg 0.0600 A
RMS load current 0.082462 A
Average load power, Pavg 0.3400 W

After the simulation, select View → SPICE Output Log or press Ctrl+L to view the results.

Related Articles :

Related ADI References: