You might find the lab on Fourier Series useful in
answering this question. The Matlab lab sheet is
here. Find the Fourier series of the 2
p-periodic function
In entering your answers, we will denote the coefficients in the
series by
|
f(x) = a0 + |
¥ å
m=1
|
( a2m-1 cos((2m-1) x) + b2m-1 sin((2m-1) x) + a2m cos(2m x) + b2m sin(2m x) ) |
|
In this sum, m goes from 1 to infinity.
The various coefficients for which you are asked are
rational functions of m, and should be entered as such.
Use the facts that sin(m
p) = 0, cos(2m
p) = 1,
cos((2m
-1)
p) =
-1 to remove trig functions from your
expressions for the coefficients.
Enter
p as Pi.
| |
a0 =
Your answer is correct.
The mark for your last attempt was 1.00
The teacher's answer was:
|
|
| |
For the remainder of the question, m ³ 1:
a2m-1 =
Your answer is correct.
The mark for your last attempt was 1.00
The teacher's answer was:
|
|
| |
a2m =
Your answer is correct.
The mark for your last attempt was 1.00
The teacher's answer was:
|
|
| |
b2m-1 =
Your answer is correct.
The mark for your last attempt was 1.00
The teacher's answer was:
This can be entered as:
2/(2*m-1)
|
|
| |
b2m =
Your answer is correct.
The mark for your last attempt was 1.00
The teacher's answer was:
This can be entered as:
-1/m
|
|
Solution:
|
While there are general formulae for Fourier coefficients, it is usual,
and saves effort, to check, at the beginning, whether the function is even
or odd. Why? ...
- Even functions necessarily have all their
sine series coefficients equal to zero.
- Odd functions necessarily have all their
cosine series coefficients equal to zero.
In this problem, the function f is odd, and
hence all an = 0.
To find the sine coefficients, use the
formulae:
|
bn = |
2
p
|
|
ó õ
|
p
0
|
f(x) sin(n x) dx, n ³ 1. |
|
Matlab can be used to evaluate the integrals. While it is possible to give
Matlab the information that m, n or whatever are integers and hence that
|
sin(n p) = 0, cos(2 m p) = 1, cos((2 m - 1)p) = -1, etc. |
|
it is probably easier in this problem to find a few coefficients and look
for a pattern.
If the problem arose in a real engineering situation, one would do both
this first step - numeric values of m as examples - and the
general m case. In any event, Matlab such as the following should find
the integrals:
syms x f s0 s1 s2 Pi c sm
s0 = sym(0); s1 = sym(1); s2 = sym(2); Pi = sym(pi); c = s2/Pi;
f = x
for m = 1:5
sm = sym(m)
b2mMinus1 = simplify(c*int(f*sin((s2*sm-s1)*x), x, s0, Pi))
b2m = simplify(c*int(f*sin(s2*sm*x), x, s0, Pi))
end |
|