Finding the Fourier Coefficients for mechanics homework

Click For Summary
SUMMARY

The forum discussion centers on finding the Fourier coefficients for a triangular wave function using the Fourier series representation. The user correctly identifies the Fourier series equations, including the calculations for \( a_0 \) and \( a_n \), but initially miscalculates \( a_n \) as \( \frac{2}{n^2\pi^2} \) instead of the correct \( \frac{4(-1)^n}{n^2\pi^2} \). The discussion highlights the importance of careful integration and the correct application of the Fourier series formulas, ultimately leading to the correct representation of the function as \( f(t) = \frac{1}{2} + \sum_{n=1}^\infty \frac{4}{(2n-1)^2\pi^2} \cos((2n-1)\pi t) \).

PREREQUISITES
  • Understanding of Fourier series and their applications
  • Proficiency in calculus, particularly integration techniques
  • Familiarity with trigonometric functions and their properties
  • Knowledge of even and odd functions in mathematical analysis
NEXT STEPS
  • Study the derivation of Fourier series for different waveforms, including square and sawtooth waves
  • Learn about the convergence properties of Fourier series
  • Explore the application of Fourier series in signal processing
  • Investigate the use of software tools like MATLAB or Python for numerical integration and Fourier analysis
USEFUL FOR

Students and educators in mathematics and engineering, particularly those focusing on signal processing, wave analysis, and Fourier analysis techniques.

\Theta
Messages
18
Reaction score
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
\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##?
 
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.
 
\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.
 
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.
 
\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:
\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.
 
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.
 
victory.jpg


Case closed.
 

Similar threads

Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K