1) Definindo a funo f(x)
L d Pi;
(1)
q0 d 10;
10 (2)
L
xK $q0$2
L q0$x L 2
f x d piecewise 0 % x ! , , % x % L, q0 K ;
2 L 2 L
2
1
2 xK L q0
1 2 q0 x 1 2
x/piecewise 0 % x and x ! L, , L % x and x % L, q0 K (3)
2 L 2 L
plot f x , x = 0 .. L ;
10
0
3 5 3 7
8 4 8 2 8 4 8
x
2) Srie de Fourier
serie_de_fourier d x, lambda / a0 lambda / 2 Csum a n, lambda * cos n * 2 * Pi / lambda * x , n
= 1 ..infinity Csum b n, lambda * sin n * 2 * Pi / lambda * x , n = 1 ..infinity ;
N N
1 2nx 2nx
x, / a0 C
2 >
n=1
a n, cos
>
C b n, sin
n=1
(4)
a0 d lambda / 2 / lambda * int f x , x =Klambda / 2 ..lambda / 2 :
a d n, lambda / 2 / lambda * int f x * cos n * 2 * Pi / lambda * x , x =Klambda / 2 ..lambda / 2 :
b d n, lambda / 2 / lambda * int f x * sin n * 2 * Pi / lambda * x , x =Klambda / 2 ..lambda / 2 :
3) Achando os valores dos coeficientes
lambda d 2$ L;
2 (5)
a0 lambda ;
5 (6)
a n, lambda ;
1 1
10 sin n n C2 cos n K2
1 2 2
(7)
n2
1 1
10 sin n n C2 cos n K2 cos n
2 2
K
n2
b n, lambda ;
1 1
10 cos n n K2 sin n
1 2 2
K (8)
n2
1 1
10 Kcos n n C2 sin n K2 sin n
2 2
K
n2
4) Aproximao de Convergncia
serie_fourier_aproximada d x, lambda, N / a0 lambda / 2 Csum a n, lambda * cos n * 2 * Pi
/ lambda * x , n = 1 ..N Csum b n, lambda * sin n * 2 * Pi / lambda * x , n = 1 ..N ;
N N
1 2nx 2nx
x, , N / a0 C
2 > n= 1
a n, cos
>
C b n, sin
n= 1
(9)
Agora, ser feito uma anlise de convergncia para N=1 , N=2 , N=5, N=10, N=50:
5) Grficos para diferentes N:
Para N=1:
plot f x , serie_fourier_aproximada x, lambda, 1 , x = 0 .. L ;
10
0
3 5 3 7
8 4 8 2 8 4 8
x
Para N=2:
plot f x , serie_fourier_aproximada x, lambda, 2 , x = 0 .. L ;
10
0
3 5 3 7
8 4 8 2 8 4 8
x
Para N=5:
plot f x , serie_fourier_aproximada x, lambda, 5 , x = 0 .. L ;
10
0
3 5 3 7
8 4 8 2 8 4 8
x
Para N=10:
plot f x , serie_fourier_aproximada x, lambda, 10 , x = 0 .. L ;
10
0
3 5 3 7
8 4 8 2 8 4 8
x
Para N=50:
plot f x , serie_fourier_aproximada x, lambda, 50 , x = 0 .. L ;
10
0
3 5 3 7
8 4 8 2 8 4 8
x
6) Expressa quantos termos so necessrios para aproximao de 95%
k d 1;
1 (10)
L L L
while evalf abs f Kserie_fourier_aproximada , lambda, k O 0.05$f do k d k
2 2 2
C1 end do:
k;
9 (11)