Fourier series of a waveform

In summary: If I set the ##a_n## terms as given above and generate and plot f(x) it doesn't resemble the specified function at all. If I use my own derived terms I get a satisfying match to... the function specified in the original post.
  • #36
Good evening,

I am also struggling on this question and have been for a solid week.

I am currently trying to calculate an. I so far have:

I have assumed for the time being x=wt

[itex] \int sinxcosnx.dx [/itex]
[itex] \frac{1}{2} \int sin(n+1)x+sin(n-1)x.dx [/itex]
[itex] \frac {1}{2} (\frac {-cos(n+1)x} {n+1} + (\frac {-cos(n-1)x}{n-1}) [/itex]

I have input the limits of x between [itex] pi [/itex] and [itex] \frac {pi}{2} [/itex] and subtracted there. Furthermore i have done the same to [itex] 2pi [/itex] and [itex] \frac {3pi}{2} [/itex] and added these but my result continually comes out at 0. I am expecting only odd numbers of n will produce a result. I have tried a few methods but none of them seem to be working.My hunch is that I am not integrating correctly or I am misunderstanding the relevance of (wt)?

Any assistance would be appreciate greatly.
 
Physics news on Phys.org
  • #37
Hi Birchyuk,

Try this:

[itex] a_n = \frac{1}{\pi} \int sinxcosx.dx + \frac{1}{\pi} \int sinxcosx.dx[/itex]

Insert your limits and put the equation in wolfram or mathlab. What do you get?

'V' won't make any difference as long as it's 1 but to be accurate 'V' should also be in the equation.
 
  • #38
Hi bizuputyi,

Thanks for the reply

Inputting this i get the following:

https://www4c.wolframalpha.com/Calculate/MSP/MSP103820ai5432f8fdg93e0000303fdbg66ci2bbf8?MSPStoreType=image/gif&s=4 and https://www5b.wolframalpha.com/Calculate/MSP/MSP8661cb3a0cb5a74g28300003gh8hbag7c679080?MSPStoreType=image/gif&s=33

I have produced a table in wolfram which is as below: (i have to admit i am not an expert with wolfram)

http://www.wolframalpha.com/input/?...n*3*pi/2))+(cos(n*2*pi))))/(n^2-1)),{n,2,10}]

This again shows i have both even and odd harmonics which i believe is wrong
 
Last edited by a moderator:
  • #40
Hi Bizuputyi,

Thanks for this. For my own piece of mind what is going wrong as this does not make sense to me why this is not working the way i think it should?

Thanks.
 
  • #41
Hi Guys,

I am really struggling with this same question, here is what I have done so far, but there is a mistake (a few probably) in there and I can't find it!

fx=Vsin (wt)
x=wt

So a0= 1/π∫f(x)dx

= V/π∫sin (x) dx [lim π/2 to π] + V/π∫sin (x) dx [lim 3π/2 to 2π]

So next I integrated the above to give
=V/π[-cosx] [lim π/2 to π] + V/π[-cosx] [lim 3π/2 to 2π]
=V/π[0]
=0

so I proved a0=0

Next on to an

an= V/π∫sin (x).cos (nx) dx [lim π/2 to π] + V/π∫sin (x).cos (nx) dx [lim 3π/2 to 2π]

using the trig rule 2sin A.cos B = [sin (A+B) + sin (A-B)]/2 I changed the above to

an= V/2π∫sin (x+nx)+sin (x-nx) dx [lim π/2 to π] + V/2π∫sin (x+nx)+sin (x-nx) dx [lim 3π/2 to 2π]

this was then integrated to give

= V/2π[(-cos(x+nx)/n+1)-(cos(x-nx)/n-1)]+V/2π[(-cos(x+nx)/n+1)-(cos(x-nx)/n-1)]

When I put n=1 it all cancels out to 0, but by what's written in this thread I should have -2(V/2π) to give (-V/π)

For bn I end up with

bn=V/2π∫cos (x-nx)-cos (x+nx) dx [lim π/2 to π] + V/2π∫cos (x-nx)-cos (x+nx) dx [lim 3π/2 to 2π]

which integrated to

V/2π[(sin(x).cos(x)-(x-sin (x))] [lim π/2 to π] +V/2π[(x-1/4sin(4x))-(x-sin1/3(3x))] [lim 3π/2 to 2π]

bn=1/2 when n=1 (I put the n=1 in before integration as suggested by Gneil to get this, I don't understand why it should make a difference though?)

where have I gone wrong?

I think bn is correct, but my an isn't

any help gratefully received!

EDIT- Just noticed the red bit above is wrong, not doing too well here!
 
Last edited:
  • #42
One theory I have is when I use the trig rule, I change the sin(x) of the bn function to a cos then when I integrate it goes back to a sin, after integration should bn= (something) cos(something)?
 
  • #43
ok,

bn now sorted using integration by parts.

Still having difficulty with an
 

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
0
Views
512
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
19
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
960
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
990
  • Calculus and Beyond Homework Help
Replies
1
Views
346
Replies
4
Views
295
Back
Top