>
>
UNIVERSIDADE FEDERAL DO RIO GRANDE DO SUL INSTITUTO DE MATEMÁTICA
DEPARTAMENTO DE MATEMÁTICA PURA E APLICADA
Disciplina: MAT01168 -Matemática Aplicada -Semestre Letivo 2008/2
Professoras: Elisabeta Gallicchio e Irene Strauch TERCEIRA ÁREA
SÉRIES DE FOURIER UTILIZANDO O MAPLE
Aula do dia 05/11/2008
CASO II
Cálculo da série de Fourier de uma função f(x) periódica, isto é, f (x+T) = f(x), dada em um intervalo qualquer [c,d], ou seja,com período T=2L=d-c
A função f(x) é representada pela série
. Mas, d-c=T , então a série da função pode ser escrita na forma
. e, como T=2L, simplificando o argumento, tem-se que a base é o conjunto de funções {
}, como no CASO I , ou seja, reduz-se à mesma base utilizada na extensão normal.
Os coeficientes e , agora, são calculados com as fórmulas de Euler dadas por
, e
Observação: Para c= -L, estas fórmulas se reduzem às do CASO I.
A seguir, o período será denotado por T=2L = d-c e o cálculo da integral é feito no período T .
Exemplo 1 (
dado em aula)Desenvolver em série de Fourier a função , 0< x <2 , sendo . Resolução:
restart:with(plots):with(plottools):assume(n,integer):interface
>
>
>
>
(2.1) (2.1)
>
>
>
>
>
>
(2.2) (2.2)
>
>
(showassumed=0):#Para não exibir n~
Warning, the name changecoords has been redefined Warning, the name arrow has been redefined
O período e a função são introduzidos de maneira simbólica:
T :=2*Pi;L:=T/2;
Dar entrada à função f:=x->x^2;
Gráfico da função dada no intervalo 0< x < 2
plot(f(x),x=0..T,thickness=2,titlefont=[COURIER,DEFAULT,16], labels=["x", "f(x)"],labelfont=[COURIER,DEFAULT,16],axesfont=
[COURIER,DEFAULT,16],title=` f(x)=x^2, f(x+2)=f(x)`);
Gráfico do prolongamento periódico da função
h:=proc(x) if x>0 and x<2*Pi then f(x) elif x>2*
Pi then f(x-2*Pi) elif x>-2*Pi and x<0 then f(x+2*Pi) elif x>-4*Pi and x<-2*Pi then f(x+4*Pi)fi end:
G:=plot(h,-4*Pi..4*Pi,thickness=2,titlefont=[COURIER,DEFAULT,16], labels=["x", "f(x)"],labelfont=[COURIER,DEFAULT,16],discont=true, axesfont=[COURIER,DEFAULT,16],title=`f(x)=x^2, f(x+2Pi)=f(x)`):
G;
>
>
>
>
>
>
(2.5) (2.5) (2.3) (2.3)
>
>
>
>
(2.7) (2.7)
>
>
(2.4) (2.4)
(2.6) (2.6) Cálculo dos coeficientes da série de Fourier, para n =1,2,3,...
Lembrar que T=2L, portanto, para o cálculo dos coeficientes, as fórmulas acima serão reescritas de modo adequado.
a[n]:=int(f(x)*cos(2*n*Pi/T*x),x=0..T)/L;
Cálculo do coeficiente
a[0]:= simplify(int(f(x)/L,x=0..T));
A seguir, os coeficientes , para n=1,2,3,...
b[n]:=int(f(x)*sin(2*n*Pi/T*x),x=0..T)/L;
A série Fourier da função é
serie_f(x):=a[0]/2+ Sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*
x),n=1..infinity);
Aproximar a função f(x) com a série truncada até n=3 termos.
f_ap3(x):=a[0]/2+ sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*x), n=1..3);
Traçar os gráficos da função dada e da sua aproximação em série de Fourier truncada.
>
>
>
>
>
>
>
>
plot({f(x),f_ap3(x)},x=0..T,title=`Função e sua Série de Fourier, n=1..3`, thickness=2,titlefont=[COURIER,DEFAULT,12],labels=["x",
"f(x)"],labelfont=[COURIER,DEFAULT,16],axesfont=[COURIER,DEFAULT, 16], color=[red,blue]);
Aumentando o número de termos, obtém-se uma melhor aproximação. Por exemplo, para n=1..10 termos
f_ap10(x):=a[0]/2+ sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*x), n=1..10);
plot({f(x),f_ap10(x)},x=0..T,thickness=2, color=[red,blue], titlefont=[COURIER,DEFAULT,12],labels=["x", "f(x)"],labelfont=
[COURIER,DEFAULT,16],axesfont=[COURIER,DEFAULT,16],title=`A Função e sua Série de Fourier truncada (n=1..10)`);
>
>
>
>
(3.1) (3.1)
>
>
>
>
>
>
>
>
G1:=plot(f_ap10(x),x=-2*T..2*T,thickness=2, color=blue,titlefont=
[COURIER,DEFAULT,12],scaling=constrained,labels=["x", "f(x)"], labelfont=[COURIER,DEFAULT,16],axesfont=[COURIER,DEFAULT,16]):
plots[display](G,G1,title=`A Função e a Série de Fourier`);
Exemplo 2
Determinar a série de Fourier da função definida no intervalo [0, ],
sendo que .
restart:with(plots):with(plottools):assume(n,integer):interface (showassumed=0):#Para não exibir n~
Warning, the name changecoords has been redefined Warning, the name arrow has been redefined
T := Pi;L:=T/2;
>
>
>
>
>
>
(3.1) (3.1)
>
>
(3.2) (3.2)
>
>
>
>
f:=x-> x*(Pi-x);
Traçar o gráfico da função f(x):
plot(f(x),x=0..T,thickness=2,titlefont=[COURIER,DEFAULT,14], labels=["x", "f(x)"],labelfont=[COURIER,DEFAULT,16],scaling=
constrained,axesfont=[COURIER,DEFAULT,16],title=` f(x)=x(Pi-x), f (x+Pi)=f(x)`);
Gráfico do prolongamento periódico da função
h:=proc(x) if x>0 and x<Pi then f(x) elif x>Pi and x<2*Pi then f(x-Pi) elif x>-Pi and x<0 then f(x+Pi)elif x>-2*Pi and x<-Pi then f(x+2*Pi) fi end:
G:=plot(h,-2*Pi..2*Pi,thickness=2,scaling=constrained,titlefont=
[COURIER,DEFAULT,16],labels=["x", "f(x)"],labelfont=[COURIER, DEFAULT,16],axesfont=[COURIER,DEFAULT,16],title=` f(x)=x(Pi-x), f (x+Pi)=f(x)`): G;
(3.4) (3.4) (3.1) (3.1)
>
>
>
>
(3.7) (3.7) (3.5) (3.5)
>
>
>
>
(3.3) (3.3)
>
>
>
>
>
>
>
>
(3.6) (3.6) Determinar os coeficientes da série de Fourier, para n =1,2,3,...
Lembrar que T=2L, portanto, para o cálculo dos coeficientes, as fórmulas acima serão reescritas de modo adequado:
a[n]:=int(f(x)*cos(2*n*Pi/T*x),x=0..T)/L;
Calcular o coeficiente
a[0]:= simplify(int(f(x),x=0..T)/L);
A seguir, os coeficientes , para n=1,2,3,...
b[n]:=int(f(x)*sin(2*n*Pi/T*x),x=0..T)/L;
A série Fourier da função é dada por
a[0]/2+ Sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*x),n=1..
infinity);
Aproximar a função f(x) com a sua série truncada n=1..3 termos.
f_ap3(x):=a[0]/2+ sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*x), n=1..3);
Traçar os gráficos da função dada e da sua aproximação com série de Fourier truncada.
plot({f(x),f_ap3(x)},x=0..T,title=`Função e sua Série de Fourier, n=1..3`, thickness=2,titlefont=[COURIER,DEFAULT,12],labels=["x",
"f(x)"],scaling=constrained,labelfont=[COURIER,DEFAULT,16], axesfont=[COURIER,DEFAULT,16], color=[red,blue]);
>
>
(3.8) (3.8)
>
>
(3.1) (3.1)
>
>
>
>
>
>
>
>
Como a função é suave, a convergência acontece rapidamente
Aumentando o número de termos, obtém-se uma melhor aproximação. Por exemplo, para n=1..5 termos:
f_ap5(x):=a[0]/2+ sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*x), n=1..5);
plot({f(x),f_ap5(x)},x=0..T,scaling=constrained,title=`A Função e sua Série de Fourier, n=1..5`, thickness=2,titlefont=[COURIER, DEFAULT,12],labels=["x", "f(x)"],labelfont=[COURIER,DEFAULT,16], axesfont=[COURIER,DEFAULT,16], color=[red,blue]);
G1:=plot(f_ap5(x),x=-2*T..2*T,thickness=2, color=blue,titlefont=
[COURIER,DEFAULT,12],labels=["x", "f(x)"],labelfont=[COURIER, DEFAULT,16],axesfont=[COURIER,DEFAULT,16]):
plots[display](G,G1,title=`A Função e a Série de Fourier`);
(4.2) (4.2) (3.1) (3.1)
>
>
>
>
>
>
>
>
>
>
(4.1) (4.1)
>
>
>
>
Exemplo 3
Considere-se a função, definida por partes: f(x)=1 se 0< x < , f(x)= -1, se < x <2 , período T=2 restart:with(plots):with(plottools):assume(n,integer):interface (showassumed=0):#Para não exibir n~
Warning, the name changecoords has been redefined Warning, the name arrow has been redefined
T:=2*Pi;L:=T/2;
f:=x->piecewise(x>0 and x<T/2,1,x>T/2 and x<T,-1);
Traçar o gráfico da função f(x):
plot(f(x),x=0..T,thickness=2,titlefont=[COURIER,DEFAULT,14], labels=["x", "f(x)"],labelfont=[COURIER,DEFAULT,16],scaling=
constrained,discont=true,axesfont=[COURIER,DEFAULT,16],title=` f (x)=1 se 0<x<Pi,f(x)=-1, se Pi<x<2Pi,f(x+2Pi)=f(x)`);
Gráfico do prolongamento periódico da função
h:=proc(x)
>
>
(3.1) (3.1)
(4.4) (4.4)
>
>
>
>
(4.5) (4.5)
>
>
>
>
>
>
>
>
>
>
(4.3) (4.3)
(4.6) (4.6)
>
>
(4.7) (4.7) if x>0 and x<2*Pi then f(x) elif x>2*Pi and x<4*Pi then f(x-2*Pi) elif x>-2*
Pi and x<0 then f(x+2*Pi)elif x>-4*Pi and x<-2*Pi then f(x+4*Pi) fi end:
G:=plot(h,-4*Pi..4*Pi,thickness=2,scaling=constrained,discont=
true,titlefont=[COURIER,DEFAULT,12],labels=["x", "f(x)"], labelfont=[COURIER,DEFAULT,12],axesfont=[COURIER,DEFAULT,16], title=` f(x)=1 se 0<x<Pi,f(x)=-1 se Pi<x<2Pi,T=2Pi`): G;
Calcular os coeficientes da série de Fourier desta função (note que a função não é par, nem é ímpar no período onde foi definida).
a[n]:=int(f(x)*cos(2*n*Pi/T*x),x=0..T)/L;
Calcular o coeficiente
a[0]:=simplify(int(f(x)/L,x=0..T));
e os coeficientes , para n=1,2,3..
b[n]:=int(f(x)*sin(2*n*Pi/T*x)/L,x=0..T);
A série Fourier da função é dada por
a[0]/2+ Sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*x),n=1..
infinity);
Aproximar a função f(x) com a sua série truncada n=1..3 termos.
f_ap3(x):=a[0]/2+ sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*x),
(4.9) (4.9) (3.1) (3.1)
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
(4.7) (4.7)
(4.8) (4.8) n=1..3);
Traçar os gráficos da função dada e a sua aproximação com série de Fourier truncada, para um certo número de termos: a) n=1..3
plot({f(x),f_ap3(x)},x=0..T,title=`Função e sua Série de Fourier, n=1..3`, thickness=2,titlefont=[COURIER,DEFAULT,12],labels=["x",
"f(x)"],scaling=constrained,labelfont=[COURIER,DEFAULT,16], axesfont=[COURIER,DEFAULT,16], color=[red,blue]);
b) n=1..5
f_ap5(x):=a[0]/2+ sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*x), n=1..5);
plot({f(x),f_ap5(x)},x=0..T,scaling=constrained,title=`Função e sua Série de Fourier, n=1..5`, thickness=2,titlefont=[COURIER, DEFAULT,12],labels=["x", "f(x)"],labelfont=[COURIER,DEFAULT,16], axesfont=[COURIER,DEFAULT,16], color=[red,blue]);
c) Para n=1..15
f_ap15(x):=a[0]/2+ sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*x), n=1..15);
(4.9) (4.9) (3.1) (3.1)
>
>
(4.10) (4.10)
>
>
>
>
>
>
>
>
>
>
>
>
(4.7) (4.7)
>
> plot({f(x),f_ap15(x)},x=0..T,scaling=constrained,title=`Função e sua Série de Fourier, n=1..15`, thickness=2,titlefont=[COURIER, DEFAULT,12],labels=["x", "f(x)"],labelfont=[COURIER,DEFAULT,16], axesfont=[COURIER,DEFAULT,16], color=[red,blue]);
Note que a função é suave por partes no intervalo, então a convergência da série truncada (somas parciais dos termos) só acontece para um número maior de termos. Para n=1..25
f_ap25(x):=a[0]/2+ sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*x), n=1..25);
plot({f(x),f_ap25(x)},x=0..T,scaling=constrained,title=`Função e sua Série de Fourier, n=1..25`, thickness=2,titlefont=[COURIER, DEFAULT,12],labels=["x", "f(x)"],labelfont=[COURIER,DEFAULT,16], axesfont=[COURIER,DEFAULT,16], color=[red,blue]);
G1:=plot(f_ap25(x),x=-2*T..2*T,thickness=2, color=blue,titlefont=
[COURIER,DEFAULT,12],labels=["x", "f(x)"],labelfont=[COURIER,
>
>
(4.9) (4.9)
>
>
>
>
(3.1) (3.1)
>
>
(5.1) (5.1)
>
>
>
>
(5.2) (5.2)
>
>
>
>
>
>
>
>
(4.7) (4.7)
DEFAULT,16],axesfont=[COURIER,DEFAULT,16]):
plots[display](G,G1,scaling=unconstrained,title=`A Função e a Série de Fourier`);
Observe os pontos onde a função é descontínua. Aparecem oscilações. Note que, mesmo aumentando o número de termos na série truncada, as oscilações não desaparecem. Alí, acontece a convergência em média f(x)=(f(t+) +f(t
-
))/2, ou seja, para a média dos valores limites da função no ponto (fenômeno de Gibbs, mínimo valor 9% da descontinuidade ordinária). Agora, observe o eixo das ordenadas everifique o mínimo valor da oscilação.
Exemplo 4
Considere-se a função definida por partes:
f(x)= 2x para 0 < x < T / 4, f(x)= (4-2x) / 3 para T / 4 < x < T, período 2
Para dar entrada a esta função, utiliza-se o comando"piecewise", que permite definir as partes.
Determinar a série de Fourier desta função:
Note que T=2L
restart:with(plots):with(plottools):assume(n,integer):interface (showassumed=0):#Para não exibir n~
Warning, the name changecoords has been redefined Warning, the name arrow has been redefined
T:=2;L:=T/2;
f:=x->piecewise(x>0 and x<T/4,2*x,T/4<x and x<T,(4-2*x)/3);
Traçar o gráfico da função dada no período:
plot(f(x),x=0..T,thickness=2,discont=true,titlefont=[COURIER, DEFAULT,14],labels=["x", "f(x)"],labelfont=[COURIER,DEFAULT,16], scaling=constrained,axesfont=[COURIER,DEFAULT,16],title=`f(x)=2x se 0<x<T/4,f(x)=(4-2x)/3 se T/4<x<T, T=2 `);
>
>
(4.9) (4.9)
>
>
(3.1) (3.1)
>
>
>
>
>
>
>
>
>
>
>
>
(5.3) (5.3) (4.7) (4.7)
Gráfico do prolongamento periódico da função
h:=proc(x) if x>0 and x<2 then f(x) elif x>2 and x<4 then f(x-2) elif x>-2 and x<0 then f (x+2)elif x>-4 and x<-2 then f(x+4) fi end:
G:=plot(h,-4..4,thickness=2,scaling=constrained,discont=true, titlefont=[COURIER,DEFAULT,12],labels=["x", "f(x)"],labelfont=
[COURIER,DEFAULT,12],axesfont=[COURIER,DEFAULT,16],title=`f(x)=2x se 0<x<T/4,f(x)=(4-2x)/3 se T/4<x<T, T=2`): G;
Calcular os coeficientes da série de Fourier, para n =1,2,3,...
a[n]:=simplify(int(f(x)*cos(2*n*Pi/T*x)/L,x=0..T));
(4.9) (4.9)
>
>
(3.1) (3.1)
>
>
>
>
>
>
>
>
(5.4) (5.4)
>
>
>
>
>
>
>
>
>
>
(4.7) (4.7)
(5.7) (5.7) (5.5) (5.5)
(5.6) (5.6) Calcular o coeficiente
a[0]:=simplify(int(f(x)/L,x=0..T));
Calcular os coeficientes para n=1,2,3...:
b[n]:=simplify(int(f(x)*sin(2*n*Pi/T*x)/L,x=0..T));
A série Fourier da função é dada por
a[0]/2+ Sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*x),n=1..
infinity);
Aproximar a função f(x) com a sua série truncada n=1..3 termos.
f_ap3(x):=a[0]/2+ sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*x), n=1..3);
Traçar os gráficos da função dada e a sua aproximação com série de Fourier truncada, para um certo número de termos: a) n=1..3
plot({f(x),f_ap3(x)},x=0..T,title=`Função e sua Série de Fourier, n=1..3`, thickness=2,titlefont=[COURIER,DEFAULT,12],labels=["x",
"f(x)"],scaling=constrained,labelfont=[COURIER,DEFAULT,16], axesfont=[COURIER,DEFAULT,16], color=[red,blue]);
>
>
(4.9) (4.9) (3.1) (3.1)
>
>
>
>
>
>
>
>
>
>
(5.9) (5.9)
>
>
>
>
(4.7) (4.7)
(5.8) (5.8) b) n=1..5
f_ap5(x):=a[0]/2+ sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*x), n=1..5);
plot({f(x),f_ap5(x)},x=0..T,scaling=constrained,title=`Função e sua Série de Fourier, n=1..5`, thickness=2,titlefont=[COURIER, DEFAULT,12],labels=["x", "f(x)"],labelfont=[COURIER,DEFAULT,16], axesfont=[COURIER,DEFAULT,16], color=[red,blue]);
c) Para n=1..10
f_ap10(x):=a[0]/2+ sum(a[n]*cos(2*n*Pi/T*x)+b[n]*sin(2*n*Pi/T*x), n=1..10);
(4.9) (4.9) (3.1) (3.1)
>
>
>
>
>
>
>
>
>
>
(5.9) (5.9)
>
>
>
>
>
>
(4.7) (4.7)
plot({f(x),f_ap10(x)},x=0..T,scaling=constrained,title=`Função e sua Série de Fourier, n=1..10`, thickness=2,titlefont=[COURIER, DEFAULT,12],labels=["x", "f(x)"],labelfont=[COURIER,DEFAULT,16], axesfont=[COURIER,DEFAULT,16], color=[red,blue]);
Note que a convergência é perfeita. Parece um único gráfico
G1:=plot(f_ap10(x),x=-2*T..2*T,thickness=2, color=blue,titlefont=
[COURIER,DEFAULT,12],labels=["x", "f(x)"],labelfont=[COURIER, DEFAULT,16],axesfont=[COURIER,DEFAULT,16]):
plots[display](G,G1,scaling=unconstrained,title=`A Função e a Série de Fourier`);
=========================================================================
=============================