Analyse a sine waveform in LTSpice

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,773
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...
 

Attachments

Last edited:

t_n_k

Joined Mar 6, 2009
5,455
Check your calculator value.
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.
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,773
Check your calculator value.
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.
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...
 

t_n_k

Joined Mar 6, 2009
5,455
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...
It's a rounding error: 2*Pi*50 isn't exactly 314 ...
 

OBW0549

Joined Mar 2, 2015
3,566
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.
 

ericgibbs

Joined Jan 29, 2010
18,872
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
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,773
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.
Yep, I got it...

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
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?
 

OBW0549

Joined Mar 2, 2015
3,566
LTSpice always assumes 12V as 12V rms or how does it works?
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.
 
Top