Finding the Fourier Coefficients for mechanics homework

In summary: Oh, I see what you're saying. I must have been daydreaming for that moment. :blush: Thanks for catching that. Now it should be:##=\frac{cos(n\pi)}{n^2\pi^2}+\frac{cos(n\pi)}{n^2\pi^2}-\frac{cos(n\pi)}{n^2\pi^2}+\frac{cos(n\pi)}{n^2\pi^2} ####=\frac{2cos(n\pi)}{n^2\pi^2}##In summary, the equations for the Fourier coefficients for a triangular wave function are ##a_n = \frac{4(-1)^
  • #1
\Theta
18
0

Homework Statement


Find the Fourier Coefficients for the triangular wave equation shown in this picture:
Fourier_Series.png

Homework Equations


##f(t)= a_0 + \sum_{n=1}^\infty a_{n}cos(n{\omega}t) + \sum_{n=1}^\infty b_{n}sin(n{\omega}t)##
##a_0 = \frac{1}{\tau}\int_{-\tau/2}^{\tau/2} f(t) \, dt##
## \omega = \frac{2\pi}{\tau}##
##a_n = \frac{2}{\tau}\int_{-\tau/2}^{\tau/2}f(t)cos(n\omega t) \, dt##
##b_n = \frac{2}{\tau}\int_{-\tau/2}^{\tau/2}f(t)sin(n\omega t) \, dt = 0, \forall n##, because it's an even function

The Attempt at a Solution


## \tau = 2##
##a_0 = \frac{1}{2}\int_{-1}^{1} 1-|t| \, dt= \frac{1}{2}[\int_{-1}^{0} 1+t \, dt+\int_{0}^{1} 1-t \, dt]=\frac{1}{2} [\frac{1}{2}+\frac{1}{2}]=\frac{1}{2} .##

##a_n = \frac{2}{2}\int_{-1}^{1}f(t)cos(n\omega t) \, dt= \int_{-1}^{0}(1+t)cos(n\omega t) \, dt + \int_{0}^{1}(1-t)cos(n\omega t) \, dt ,##
Which, when computed through many tiresome intermediate steps, gives:
##a_n= \frac{2}{n^2\pi^2} ##, which differs from the answer in the textbook, ##a_n= \frac{4}{n^2\pi^2}, n=1,3,5,7,...; a_n=0, n=2,4,6,8,10,...##

So my question is, have I set up the problem correctly and made a computational mistake somewhere along the way in my integrals? Or am I missing something in the setup of the problem and missing the point entirely? It's a *** problem in our textbook(aka the most difficult level) and it's also a "computer problem", so I'm sure my prof won't expect me to do a problem this laborious on a test, but I'd still like to know where I went sour.
 
Last edited:
Physics news on Phys.org
  • #2
\Theta said:

Homework Equations


##f(t)= a_0 + \sum_{n=1}^\infty a_{n}cos(n{\omega}t) + \sum_{n=1}^\infty b_{n}sin(n{\omega}t)##
##a_0 = \frac{1}{\tau}\int_{-\tau/2}^{\tau/2} f(t) \, dt##
## \omega = \frac{2\pi}{\tau}##
##a_n = \frac{2}{\tau}\int_{-\tau/2}^{\tau/2}f(t)cos(n\omega t) \, dt##
##b_n = \frac{2}{\tau}\int_{-\tau/2}^{\tau/2}f(t)sin(n\omega t) \, dt = 0, \forall n##, because it's an even function
Are you sure about these equation? If yes, what is ##\omega##?
 
  • #3
DrClaude said:
Are you sure about these equation? If yes, what is ##\omega##?
Well, these are the generic formula for the Fourier Series for a function. ##\omega = \frac{2\pi}{\tau}=\frac{2\pi}{2}=\pi##, I guess I wasn't as explicit about it but I considered it trivial.
 
  • #4
\Theta said:
Well, these are the generic formula for the Fourier Series for a function. ##\omega = \frac{2\pi}{\tau}=\frac{2\pi}{2}=\pi##, I guess I wasn't as explicit about it but I considered it trivial.
There can be different conventions, so I just wanted to make sure that I understood.
\Theta said:
##a_n = \frac{2}{2}\int_{-1}^{1}f(t)cos(n\omega t) \, dt= \int_{-1}^{0}(1+t)cos(n\omega t) \, dt + \int_{0}^{1}(1-t)cos(n\omega t) \, dt ,##
Which, when computed through many tiresome intermediate steps, gives:
##a_n= \frac{2}{n^2\pi^2} ##
You'll have to give the intermediate steps, because the first line is correct, but the last equality doesn't follow.
 
  • #5
DrClaude said:
There can be different conventions, so I just wanted to make sure that I understood.
You'll have to give the intermediate steps, because the first line is correct, but the last equality doesn't follow.
Oh, I see what you were asking. Sorry.:smile:

##a_n = \frac{2}{2}\int_{-1}^{1}f(t)cos(n\omega t) \, dt= \int_{-1}^{0}(1+t)cos(n\omega t) \, dt + \int_{0}^{1}(1-t)cos(n\omega t) \, dt ,##
##=\int_{-1}^{0}cos(n\omega t) \, dt +\int_{-1}^{0}tcos(n\omega t) \, dt +\int_{0}^{1}cos(n\omega t) \, dt -\int_{0}^{1}tcos(n\omega t) \, dt ##
##= \int_{-1}^{1}cos(n\omega t) \, dt +\int_{-1}^{0}tcos(n\omega t) \, dt -\int_{0}^{1}tcos(n\omega t) \, dt##
##= \frac{sin(n{\pi}t)}{n\pi}|_{-1}^1+\int_{-1}^{0}tcos(n\omega t) \, dt -\int_{0}^{1}tcos(n\omega t) \, dt##
##= 0 +[\frac{tsin(n{\pi}t)}{n\pi}+\frac{cos(n{\pi}t)}{n^2\pi^2}|_{-1}^0-[\frac{tsin(n{\pi}t)}{n\pi}+\frac{cos(n{\pi}t)}{n^2\pi^2}|_{0}^1##
##=0 +[0+\frac{cos(n{\pi}t)}{n^2\pi^2}|_{-1}^0-[0+\frac{cos(n{\pi}t)}{n^2\pi^2}|_{0}^1##
##= 0 + \frac{1}{n^2\pi^2}+\frac{1}{n^2\pi^2}-\frac{1}{n^2\pi^2}+\frac{1}{n^2\pi^2}##
##=\frac{2}{n^2\pi^2}##:wideeyed:

BTW, thanks a bunch for helping out DrClaude.
 
  • #6
\Theta said:
Oh, I see what you were asking. Sorry.:smile:

##a_n = \frac{2}{2}\int_{-1}^{1}f(t)cos(n\omega t) \, dt= \int_{-1}^{0}(1+t)cos(n\omega t) \, dt + \int_{0}^{1}(1-t)cos(n\omega t) \, dt ,##
##=\int_{-1}^{0}cos(n\omega t) \, dt +\int_{-1}^{0}tcos(n\omega t) \, dt +\int_{0}^{1}cos(n\omega t) \, dt -\int_{0}^{1}tcos(n\omega t) \, dt ##
##= \int_{-1}^{1}cos(n\omega t) \, dt +\int_{-1}^{0}tcos(n\omega t) \, dt -\int_{0}^{1}tcos(n\omega t) \, dt##
##= \frac{sin(n{\pi}t)}{n\pi}|_{-1}^1+\int_{-1}^{0}tcos(n\omega t) \, dt -\int_{0}^{1}tcos(n\omega t) \, dt##
##= 0 +[\frac{tsin(n{\pi}t)}{n\pi}+\frac{cos(n{\pi}t)}{n^2\pi^2}|_{-1}^0-[\frac{tsin(n{\pi}t)}{n\pi}+\frac{cos(n{\pi}t)}{n^2\pi^2}|_{0}^1##
##=0 +[0+\frac{cos(n{\pi}t)}{n^2\pi^2}|_{-1}^0-[0+\frac{cos(n{\pi}t)}{n^2\pi^2}|_{0}^1##
##= 0 + \frac{1}{n^2\pi^2}+\frac{1}{n^2\pi^2}-\frac{1}{n^2\pi^2}+\frac{1}{n^2\pi^2}##

##=\frac{2}{n^2\pi^2}##:wideeyed:

BTW, thanks a bunch for helping out DrClaude.
I think I see where I went wrong :oldbiggrin:
Looks like it was just a silly case of the negative signs cancelling each other.
Should be:
##=0 +[0+\frac{cos(n{\pi}t)}{n^2\pi^2}|_{-1}^0-[0+\frac{cos(n{\pi}t)}{n^2\pi^2}|_{0}^1##
##=\frac{cos(n\pi)}{n^2\pi^2}+\frac{cos(n\pi)}{n^2\pi^2}+\frac{cos(n\pi)}{n^2\pi^2}+\frac{cos(n\pi)}{n^2\pi^2} ##
##= \frac{4cos(n\pi)}{n^2\pi^2}##
##=\frac{4(-1)^n}{n^2\pi^2} ##
 
Last edited:
  • #7
\Theta said:
##=0 +[0+\frac{cos(n{\pi}t)}{n^2\pi^2}|_{-1}^0-[0+\frac{cos(n{\pi}t)}{n^2\pi^2}|_{0}^1##
##=\frac{cos(n\pi)}{n^2\pi^2}+\frac{cos(n\pi)}{n^2\pi^2}+\frac{cos(n\pi)}{n^2\pi^2}+\frac{cos(n\pi)}{n^2\pi^2} ##
Getting closer, but that second line doesn't follow from the first.
 
  • #8
DrClaude said:
Getting closer, but that second line doesn't follow from the first.

##=0 +[0+\frac{cos(n{\pi}t)}{n^2\pi^2}|_{-1}^0-[0+\frac{cos(n{\pi}t)}{n^2\pi^2}|_{0}^1##
##=\frac{cos(0)}{n^2\pi^2} - \frac{cos(-n\pi)}{n^2\pi^2}-\frac{cos(n\pi)}{n^2\pi^2}+\frac{cos(0)}{n^2\pi^2}##
##=\frac{1}{n^2\pi^2} - \frac{cos(-n\pi)}{n^2\pi^2}-\frac{cos(n\pi)}{n^2\pi^2}+\frac{1}{n^2\pi^2} ##
##=\frac{1}{n^2\pi^2} - \frac{cos(n\pi)}{n^2\pi^2}-\frac{cos(n\pi)}{n^2\pi^2}+\frac{1}{n^2\pi^2}##
##=\frac{1}{n^2\pi^2} +\frac{1}{n^2\pi^2}+\frac{1}{n^2\pi^2}+\frac{1}{n^2\pi^2}## when n is odd
and ##=\frac{1}{n^2\pi^2} - \frac{1}{n^2\pi^2}-\frac{1}{n^2\pi^2}+\frac{1}{n^2\pi^2}=0## when n is even
So the Fourier series for the function would be:
##f(t)= a_0 + \sum_{n=1}^\infty a_{n}cos(n{\omega}t) + \sum_{n=1}^\infty b_{n}sin(n{\omega}t)##
##=\frac{1}{2}+\sum_{n=1}^\infty \frac{4}{(2n-1)^2\pi^2}cos((2n-1){\pi}t)##

That looks right. DrClaude, I definitely owe you one.
 
  • #9
victory.jpg


Case closed.
 

FAQ: Finding the Fourier Coefficients for mechanics homework

What is the purpose of finding Fourier coefficients in mechanics?

The Fourier coefficients allow us to represent complex, periodic functions as a sum of simpler trigonometric functions. This can be useful in analyzing and understanding the behavior of mechanical systems.

What are the steps involved in finding Fourier coefficients?

The steps involved in finding Fourier coefficients include: 1) determining the period of the function, 2) computing the Fourier coefficients using integrals, 3) simplifying the coefficients using trigonometric identities, and 4) plotting the Fourier series approximation of the function.

What is the difference between Fourier series and Fourier transform?

Fourier series deals with periodic functions while Fourier transform deals with non-periodic functions. Fourier series represents a function as a sum of sine and cosine waves, while Fourier transform represents a function as a sum of complex exponential functions.

How are Fourier coefficients used in mechanical engineering?

Fourier coefficients are used in mechanical engineering to analyze the behavior of mechanical systems, such as vibrations and oscillations. They can also be used to design and optimize mechanical systems by predicting the response to different inputs.

Is there any software or tool available to help with finding Fourier coefficients?

Yes, there are many software and tools available, such as MATLAB, Mathematica, and Python libraries, that can help with finding Fourier coefficients. These tools can automate the calculations and make the process more efficient.

Similar threads

Replies
1
Views
878
Replies
16
Views
1K
Replies
1
Views
1K
Replies
2
Views
1K
Replies
6
Views
960
Replies
1
Views
1K
Replies
3
Views
1K
Replies
6
Views
2K
Back
Top