Fourier Sine Series

M.M. Yovanovich

FOURSIN.MWS

Fourier Sine Series.

The coefficients [Maple Math] of the Fourier sine series: [Maple Math] on the interval from [Maple Math] to [Maple Math] are obtained from the

relation: [Maple Math] where [Maple Math] is some arbitrary function defined on the interval.

In this worksheet Fourier sine coefficients will be obtained for several functions:

1. [Maple Math] ,

2. [Maple Math] ,

3. [Maple Math] ,

4. [Maple Math] where [Maple Math] 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);

[Maple Math]

Fourier coefficients for f(x) = 1.

> Bn1:= n-> subs(f(x)=1, Bn(n));

[Maple Math]

> Bn1vals:= [seq(eval(Bn1(n)), n=1..20)];

[Maple Math]

We observe that all Fourier coefficients for [Maple Math] are zero, and all coefficients for [Maple Math] are positive.

Fourier coefficients for f(x) = x.

> Bn2:= n-> subs(f(x)=x/L, Bn(n));

[Maple Math]

> bn2vals:= [seq(eval(Bn2(n)), n=1..10)];

[Maple Math]

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));

[Maple Math]

> bn3vals:= [seq(eval(Bn3(n)), n=1..10)];

[Maple Math]

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));

[Maple Math]

> assume(a>0):
bn41:= simplify(eval(Bn4(1)));

[Maple Math]

> bn4vals:= [seq(simplify(eval(Bn4(n))), n=1..5)];

[Maple Math]

> bnvals:= evalf(subs(a=1, bn4vals));

[Maple Math]

Fourier coefficients for saw-tooth function.

> sawtooth:= (x,L)-> if x < L/2 then x/L else (1 - x/L) fi;

[Maple Math]

> with(plots):
plot('sawtooth(x,1)', 'x' = 0..1);

[Maple Plot]

> pts:= [seq(sawtooth(j/10,1), j = 0..10)];

[Maple Math]

> listplot(pts);

[Maple Plot]

> f1:= x/L; f2:= 1 - x/L;

[Maple Math]

[Maple Math]

> 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);

[Maple Math]

> Bn5vals:= [seq(eval(Bn5(n)), n = 1..10)];

[Maple Math]

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);

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

> with(plots):

> plot(subs(L = 1, sawprofile), x = 0..1);

[Maple Plot]

40 terms of the Fourier sine series provide a reasonable approximation of the saw-tooth profile