# Analyse a sine waveform in LTSpice

Discussion in 'Homework Help' started by PsySc0rpi0n, Mar 16, 2015.

1. ### PsySc0rpi0n Thread Starter Well-Known Member

Mar 4, 2014
1,191
3
Hi...

I'm trying to understand why can't I get the same results in LTSpice as in my calculator.

For this signal

V_out=12sin(314t) [V]

I want to know what's V_out for t=3S

With my calculator (in rad) I guet V_out = 0V if I use 2*pi*50*3 as the sin argument and I get V_out = -5.518V if I use 314*3 as sin argument and with LTSpice, using measure command I get 0.0387292V...

• ###### sine_wave.asc
File size:
377 bytes
Views:
22
Last edited: Mar 16, 2015
2. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
783
At time t=3 sec there will have been an integral number of 50Hz AC cycles. So the value of the sine function at that instant must be zero.

3. ### PsySc0rpi0n Thread Starter Well-Known Member

Mar 4, 2014
1,191
3
I've checked it with my calculator... In rad mode, if I use 12sin(2*pi*50*3) it returns zero but if I use 12sin(314*3) it returns a non sense value. Looks like in rad mode, pi as an specific meaning for the calculator!

I was expecing to get the same result because 2*3.14*50*3 is equal to 314*3...

4. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
783
It's a rounding error: 2*Pi*50 isn't exactly 314 ...

5. ### PsySc0rpi0n Thread Starter Well-Known Member

Mar 4, 2014
1,191
3
I think it's not rounding error... 314 = 2*pi*49.97... This tiny rounding I made can't make such huge difference in final result, can it?

Edited;
Looks like it does...

6. ### OBW0549 Well-Known Member

Mar 2, 2015
1,395
941
Yes, it's a rounding error.

2 * 3.14 * 50 * 3 = 942 radians.
2 * pi * 50 * 3 = 942.477796... radians.

So by the time you've gone 3 seconds, you've accumulated nearly half a radian of error from your pi approximation. And that angular error is what's giving you the result you're seeing.

7. ### ericgibbs AAC Fanatic!

Jan 29, 2010
2,595
393
hi psy,
Your LTS asc sim is using Vpk of 16.97V, but the formula that you used is V_out=12sin(314t), so why are you using the Vrms value of 12V in your formula.?

As explained the non zero calc result is rounding
E

8. ### PsySc0rpi0n Thread Starter Well-Known Member

Mar 4, 2014
1,191
3
Yep, I got it...

I think I was trying values to see if any would match my calculator!

And also yes... that's another problem of mine! I never know when to apply 12V or 12RMS or 16.97 or 16.9RMS...

LTSpice always assumes 12V as 12V rms or how does it works?

9. ### OBW0549 Well-Known Member

Mar 2, 2015
1,395
941
When you do a TRAN analysis in LTSpice (or any other version of Spice) and have a sinusoidal voltage or current source, you specify the peak amplitude; so for 12 Vrms you would then use 16.97 volts, as you indicated.

On the other hand, if you're doing an AC analysis, all that matters is that you use the same interpretation (i.e., rms, peak, peak-to-peak, etc.) throughout.

10. ### ericgibbs AAC Fanatic!

Jan 29, 2010
2,595
393
Psy,
You could use 'curly braces' to enclose a mathematical equation in the SINE box set up, that should highlight which terms you are using.

• ###### AAesp01.gif
File size:
11.3 KB
Views:
34
atferrari and PsySc0rpi0n like this.
11. ### PsySc0rpi0n Thread Starter Well-Known Member

Mar 4, 2014
1,191
3
Ok, nice tip... Thanks!