Fourier Sine Series
M.M. Yovanovich
FOURSIN.MWS
Fourier Sine Series.
The coefficients of the Fourier sine series: on the interval from to are obtained from the
relation: where is some arbitrary function defined on the interval.
In this worksheet Fourier sine coefficients will be obtained for several functions:
1. ,
2. ,
3. ,
4. where is a constant.
The last example illustrates how the Fourier sine series can be used to approximate the saw-tooth function.
> restart:
nth Fourier coefficient for arbitrary f(x).
> Bn:=n->2/L*int(f(x)*sin(n*Pi*x/L),x=0..L);
Fourier coefficients for f(x) = 1.
> Bn1:= n-> subs(f(x)=1, Bn(n));
>
Bn1vals:= [seq(eval(Bn1(n)), n=1..20)];
We observe that all Fourier coefficients for are zero, and all coefficients for are positive.
Fourier coefficients for f(x) = x.
> Bn2:= n-> subs(f(x)=x/L, Bn(n));
> bn2vals:= [seq(eval(Bn2(n)), n=1..10)];
We observe that the coefficients alternate in sign and decrease in absolute magnitude.
Fourier coefficients for f(x) = x/L*(1-x/L).
> Bn3:= n-> subs(f(x)=x/L*(1-x/L), Bn(n));
> bn3vals:= [seq(eval(Bn3(n)), n=1..10)];
We observe that the coefficients alternate in sign and decrease in absolute magnitude.
Fourier coefficients for f(x) = a*(1 - x/L)^2.
> Bn4:= n-> subs(f(x)=a*(1-x/L)^2, Bn(n));
>
assume(a>0):
bn41:= simplify(eval(Bn4(1)));
> bn4vals:= [seq(simplify(eval(Bn4(n))), n=1..5)];
> bnvals:= evalf(subs(a=1, bn4vals));
Fourier coefficients for saw-tooth function.
> sawtooth:= (x,L)-> if x < L/2 then x/L else (1 - x/L) fi;
>
with(plots):
plot('sawtooth(x,1)', 'x' = 0..1);
> pts:= [seq(sawtooth(j/10,1), j = 0..10)];
> listplot(pts);
> f1:= x/L; f2:= 1 - x/L;
>
Bn5:= n-> 2/L*int(x/L*sin(n*Pi*x/L),x = 0..L/2) +
2/L*int((1-x/L)*sin(n*Pi*x/L), x = L/2..L);
> Bn5vals:= [seq(eval(Bn5(n)), n = 1..10)];
All coefficients for even integers are xero, and the remaining coefficients alternate in sign.
Sawtooth profile with 40 terms of the Fourier sine series.
> Bn5vals:= [seq(eval(Bn5(n)), n = 1..40)]:
> terms:= [seq(Bn5vals[n]*sin(n*Pi*x/L), n = 1..40)]:
> sawprofile:= sum(terms[n], n = 1..40);
> with(plots):
> plot(subs(L = 1, sawprofile), x = 0..1);
40 terms of the Fourier sine series provide a reasonable approximation of the saw-tooth profile