Modelling a function for a fourier series

In summary, when modelling a function for a Fourier series, both the definitions of the function must be used for both an and bn. The general expression for a Fourier series of a 2pi-periodic function is given by f(x)=a_0+\sum_{n=1}^\infty (a_n \cos nx+b_n \sin nx). If the function is even, bn will be zero and if the function is odd, an will be zero. When calculating an and bn, the function f(x) should be used in the formulas. However, in some cases, such as when the function is even, the integral can be
  • #1
Ry122
565
2
when modelling a function for a Fourier series, what determines which function i select from the forcing function for an and bn?
eg
in the following would 1-t^2 be used in the an or bn formula?
http://users.on.net/~rohanlal/fourier2.jpg
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
you would have to use both parts of f(t) when finding an and bn. all you need to do is break up the integrals that determine an and bn to the appropriate domains for each part of your function.
 
  • #3
but how do i determine which part of f(x) goes in the an and which in the bn formula?
 
  • #4
As Easty says, you have to use both the definitions of f(t) for both an and bn.
Meaning, an will be sum of two integrals :
-One going from -ve infinity to 0 and using the first definition of f(t)=1-t2.
-Second going from 0 to infinity, using the second definition of f(t)=1.

Likewise for bn.

Goodluck!
 
  • #5
The general expression for a Fourier series of a 2pi-periodic function is given by.

[tex]
f(x)=a_0+\sum_{n=1}^\infty (a_n \cos nx+b_n \sin nx)
[/tex]

So in general you will need to always calculate both a_n and b_n, however seeing as we integrate over a symmetric interval to determine the coefficients and we know that if we integrate an odd function over a symmetric interval we get 0. Therefore if f(t) is even f(t)sin(nt) is odd and b_n will be zero. Similarly if f(t) is odd f(t)cos(nt) will be odd and a_n will be zero. Your function is neither even nor odd.
 
  • #6
if an or bn are zero due to the function being even or odd then that means you don't use both parts of f(t) in the formula. How do i determine what part of f(t) i should use?
 
  • #7
Ry122 said:
if an or bn are zero due to the function being even or odd then that means you don't use both parts of f(t) in the formula. How do i determine what part of f(t) i should use?

Your f(t) is neither even nor odd. Therefore you must use both parts, as others have already told you.

Why don't you start by trying to write down a formula for [tex]a_n[/tex]. It will be a sum of two integrals, one for each part of f(t). If you get stuck, then show us what you are trying, and we'll let you know if something is wrong and/or suggest a next step.
 
  • #8
i understand that is the case for this problem but what about problems that have odd or even functions?
 
  • #9
Your question is answered in post #5. If that's not what you meant then please try to be more detailed.
 
  • #10
I want to find the Fourier series of the following function, an even function, meaning bn=0
http://users.on.net/~rohanlal/even.jpg
what should i make f(x) in the a_n formula, X+L or L-X?
 
Last edited by a moderator:
  • #11
Ry122 said:
i understand that is the case for this problem but what about problems that have odd or even functions?

If this is true, I would like to see the formula for a_n and b_n of the previous problem since it works exactly the same as your new problem. Therefore I suspect that you did something awkward for the previous problem as well. Please show us your work.
 
Last edited:
  • #12
I haven't myself attempted these questions. I want an answer to my question before i bother trying.
Are you saying that you use both parts of f(x) even in even functions?
In the solution to my last posted problem, for a_n f(x) is made to equal L-X and the second part of the function is ignored (X+L).
 
  • #13
The general rules of this forum as far as I know ask you to attempt first, show us your attempt and we help you from there. My point is that in post 8 you claim to understand the question you ask in post 10. This seemed odd to me. Now seeing what you're doing in post 12 I know for sure you did not understand the previous problem either. That's why I think it's best to return to the original problem before continuing.

Either way the function f(x) is even indeed so b_n is 0. However the question states you have to Fourier transform f(x). The function you're transforming is g(x)=L-X, and [itex]f(x) \neq g(x)[/itex].

This is what you want to calculate:

[tex]
a_n=\frac{1}{L} \int_{-L}^L f(x) cos(\frac{n\pi x}{L})dx
[/tex]

[quote='Ry122]
Are you saying that you use both parts of f(x) even in even functions[/quote]

This is not only what I am saying, but also the formula for the Fourier coefficients.
 
Last edited:
  • #14
so this is wrong? this is a solution from my teacher. there's no X+L in there
http://users.on.net/~rohanlal/laplace.jpg
 
Last edited by a moderator:
  • #15
Yes that's wrong, what you have there is the Fourier transform of the function g(x) in my previous post. In fact g(x) is odd so g(x) cos( Pi n x/L) is odd. You should really read post #5 again and use the data the assignment has given you. It gives you f(x), you have a formula to calculate a_n which includes the function f(x). So just plug f(x) into the formula and you can't go wrong.
 
  • #16
but this is from my lecturer, and he's repeated the same process in several problems so it can't be a mistake.
 
  • #17
Ok I reviewed it again it's the correct answer, but you didn't just ignore the x+L part. Did you come to this answer by copying the lecture notes or actually realizing that:

[tex]\frac{1}{L}\int_{-L}^0 (x+L) dx+\frac{1}{L} \int_0^L(L-x)dx =\frac{2}{L}\int_0^L (L-x) dx[/tex]?
 
  • #18
so what happens with it?
 
  • #19
The left side is how you integrate your function f(x). Your teacher notices that he can write this as 2 times the integral of the right hand side. This saves time. He does NOT ignore the L+x term. Do you see this?
 
  • #20
so it doesn't matter which part of f(x) you ignore, you can choose either part to be f(x) in a_n?
 
  • #21
Cyosis, the solution in #14 is correct.

[tex] \frac{1}{L} \int_{-L}^{L}f(x) cos(k_n x) dx = \frac{1}{L} \int_{-L}^{0}(x + L)cos(k_n x) dx + \frac{1}{L} \int_{0}^{L}(L - x)cos(k_n x) dx = \frac{2}{L} \int_{0}^{L}(L-x) cos(k_n x) dx [/tex]

EDIT: I see you already noticed.
 
  • #22
No, no and no. Your teacher does NOT ignore anything. Ignoring either side in this case would mean you're a factor 2 off.

Lets write out the full transform.

[tex]
\begin{align*}
a_n & = \frac{1}{L}\int_{-L}^L f(x)\cos(\frac{n \pi x}{L}) dx
\\
& =\frac{1}{L}\int_{-L}^0 (x+L) \cos(\frac{n \pi x}{L}) dx+\frac{1}{L} \int_0^L(L-x) \cos(\frac{n \pi x}{L})dx
& = \frac{2}{L}\int_0^L (L-x) \cos(\frac{n \pi x}{L}) dx
\end{align}
[/tex]

To dx. Yes it is. Seeing as he was talking about ignoring one part of the function I missed the two, however I still think it's a lousy move of a teacher to write it in that form right away, which to some may suggest you're ignoring a part of the function. This is not the case and is causing a lot of confusion in this particular case.
 
  • #23
i shouldn't have used the word ignore, what i meant to ask was does it matter which part of f(x) is chosen to be used in f(x) for a_n.
im asking if this is true
[tex]
\frac{1}{L} \int_{-L}^{L}f(x) cos(k_n x) dx = \frac{1}{L} \int_{-L}^{0}(x + L)cos(k_n x) dx + \frac{1}{L} \int_{0}^{L}(L - x)cos(k_n x) dx = \frac{2}{L} \int_{0}^{L}(x + L)cos(k_n x) dx
[/tex]
 
  • #24
No, that's not true. It would be true if the limits on your last integral were from -L to 0.

The point here is the both the integrals in the sum have the same value, so you can use twice the value of either one. Say you want to find the sum A + B, and you know that A = B = I. Then A + B = 2A = 2B.
 

1. What is a Fourier series?

A Fourier series is a mathematical representation of a periodic function as a sum of sine and cosine functions. It is named after the French mathematician Joseph Fourier who first introduced it in the early 19th century.

2. Why is it important to model a function using a Fourier series?

Modelling a function using a Fourier series allows us to approximate complex and non-periodic functions with a series of simpler and periodic functions. This can be useful in various fields such as signal processing, image and sound compression, and solving partial differential equations.

3. What are the steps involved in modelling a function for a Fourier series?

The first step is to determine the period of the function. Then, we need to find the coefficients of the sine and cosine terms by calculating the integrals of the function over one period. Finally, we can combine these coefficients with the sine and cosine functions to construct the Fourier series representation of the original function.

4. Can all functions be modelled using a Fourier series?

No, not all functions can be accurately represented by a Fourier series. The function must be periodic and satisfy certain conditions for the Fourier series to converge. If these conditions are not met, the Fourier series may not provide an accurate approximation of the original function.

5. How do we determine the accuracy of a Fourier series approximation?

The accuracy of a Fourier series approximation can be determined by comparing it to the original function. We can use techniques such as calculating the error or plotting both functions on the same graph to visually evaluate the accuracy of the approximation.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
283
  • Calculus and Beyond Homework Help
Replies
3
Views
362
  • Calculus and Beyond Homework Help
Replies
4
Views
354
  • Calculus and Beyond Homework Help
Replies
6
Views
388
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
214
  • Calculus and Beyond Homework Help
Replies
16
Views
562
  • Calculus and Beyond Homework Help
Replies
2
Views
372
  • Calculus and Beyond Homework Help
Replies
6
Views
914
  • Calculus and Beyond Homework Help
Replies
1
Views
341
Back
Top