- #1

- 48

- 11

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- #1

- 48

- 11

- #2

Mentor

- 64,885

- 16,350

https://www.analog.com/en/technical...ting-the-average-or-rms-value-of-a-trace.html

- #3

- 48

- 11

- #4

Mentor

- 64,885

- 16,350

- #5

- 48

- 11

- #6

Mentor

- 64,885

- 16,350

Huh, weird. What happens when you take out D1?

- #7

Science Advisor

- 12,756

- 6,734

I believe that you are looking at too short a part of the plot as the voltage is still increasing from the initial conditions.Does anyone know if the software can display the DC component of a waveform such as found by determining the Fourier series of a waveform?

RMS must be computed over a time period. To avoid window errors, the number of cycles in that period must be an exact integer, or be very large.

Read help for waveform arithmetic; Section 2. "Compute the average or RMS of a trace".

Read the report in the small window.

For your circuit between exactly 1 and 2 seconds, the average is 5.2756V, the RMS is 5.2759V.

- #8

Science Advisor

- 12,756

- 6,734

https://groups.yahoo.com/neo/groups/LTspice/conversations/topics/118026

I believe these links from that topic point to a selection of good older versions.

https://web.archive.org/web/*/ltspice.analog.com/software/LTspice.dmg

https://web.archive.org/web/*/ltspice.analog.com/software/LTspiceXVII.dmg

- #9

Science Advisor

- 12,756

- 6,734

There is a work-around using .MEAS that you might try.

Place a .op command on the schematic;

.measure tran fred RMS V(out)

Then run the simulation;

When it finishes pull down the “view” menu and select “SPICE error log”; or <ctrl>L

You will see a line with the parameter label fred: and the result of the measurement.

fred: RMS(v(out))=5.29009 FROM 0 TO 0.18

Here the default time window for RMS integration is the displayed .TRAN trace.

You can specify all sorts of traps for the time window to synchronise with signal phase.

Attached is the .asc file that works for me.

Remove the .txt extension to run in LTspice.

Place a .op command on the schematic;

.measure tran fred RMS V(out)

Then run the simulation;

When it finishes pull down the “view” menu and select “SPICE error log”; or <ctrl>L

You will see a line with the parameter label fred: and the result of the measurement.

fred: RMS(v(out))=5.29009 FROM 0 TO 0.18

Here the default time window for RMS integration is the displayed .TRAN trace.

You can specify all sorts of traps for the time window to synchronise with signal phase.

Attached is the .asc file that works for me.

Remove the .txt extension to run in LTspice.

- #10

- 48

- 11

- #11

- 48

- 11

- #12

- 48

- 11

Here is my circuit and the waveform of the voltage across the resistor.

- #13

Science Advisor

- 12,756

- 6,734

When you “synch” your LTspice you bring it up to the current release version with the latest bug fixes, unfortunately, along with any new bugs.

You have noticed how LTspice sets the amplitude of a sine wave as the peak voltage.

That is why you specify a 170 Vpeak sinewave rather than 120 Vrms.

If you add a .txt extension to your schematic.asc file to make it schematic.asc.txt you can attach it to your post on this forum. I can then modify your schematic.asc by adding an example of the appropriate RMS integration function, without having to re-enter your circuit.

Here is an example.

You have noticed how LTspice sets the amplitude of a sine wave as the peak voltage.

That is why you specify a 170 Vpeak sinewave rather than 120 Vrms.

If you add a .txt extension to your schematic.asc file to make it schematic.asc.txt you can attach it to your post on this forum. I can then modify your schematic.asc by adding an example of the appropriate RMS integration function, without having to re-enter your circuit.

Here is an example.

- #14

- 48

- 11

- #15

Science Advisor

- 12,756

- 6,734

- #16

- 48

- 11

- #17

Science Advisor

- 12,756

- 6,734

- #18

- 48

- 11

- #19

Science Advisor

Gold Member

- 28,029

- 6,410

Take another, SIMPLER, example. A +/- 1V square wave has an RMS value of 1V and that is the same as the RMS value for the full wave rectified signal (1V). The mean voltage for the square wave is zero but the mean voltage for the rectified signal is 1V (it's 1V all the time).

- #20

- 48

- 11

- #21

Science Advisor

- 12,756

- 6,734

It depends on what exactly you mean by “1V AC”. It is true for a mathematical sinewave with peak amplitude = 1.So, for a 1V AC rectified waveform, full wave, real power would be equal to .707 squared divided by resistance. Is that right?

A 1.0V amplitude sinewave generated by LTspice is a ±1.000 Vpeak sinewave = 0.7071 Vrms = 2.0 Vpeak-peak.

If you rectify it perfectly, it still has 0.7071 Vrms, referenced to zero.

A 1.0 Vrms sinewave has a peak amplitude of ±1.4142 Vpeak = 2.8284 Vpeak-peak. For sinewaves in the commercial power world, VAC is assumed to be Vrms unless otherwise specified as say Vp or Vpp.

With an LTspice model source you must be more careful to specify what you mean.

When you refer to a square wave you need to clearly specify if it is symmetrical about zero, or if it is offset and alternates between say zero and a fixed voltage.

- #22

- 48

- 11

Share:

- Replies
- 4

- Views
- 109

- Replies
- 1

- Views
- 509

- Replies
- 11

- Views
- 890

- Replies
- 63

- Views
- 4K

- Replies
- 22

- Views
- 3K

- Replies
- 12

- Views
- 623

- Replies
- 18

- Views
- 1K

- Replies
- 11

- Views
- 493

- Replies
- 12

- Views
- 266

- Replies
- 9

- Views
- 2K