Application Center - Maplesoft

App Preview:

Maple in Mathematics Education I: Fourier Series & Wave Equation, Using Partial Sums

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Maple in Mathematics Education I:
Fourier Series & Wave Equation, Using Partial Sums

by David Canright, Math. Dept., Code MA/Ca, Naval Postgraduate School, Monterey, CA,
dcanright@nps.navy.mil, 2000 David Canright.

Note: This worksheet allows exploration & plotting of Fourier Series (using partial sums [Maple Math] ) in an educational setting.

Introduction: Setting up the Worksheet

> restart;

> with(plots): need "plots" package for animation below

Section I: General Definitions for Fourier Series

Note: do this section only once (before L, a0, etc. are ever defined)

term: one term (#n) in series
SN: partial sum (up to N) of series

> term := an*cos(n*Pi*x/L) + bn*sin(n*Pi*x/L);

[Maple Math]

> SN := a0/2 + 'sum( an*cos(n*Pi*x/L) + bn*sin(n*Pi*x/L), n=1..N )';

[Maple Math]

Section II: Define Particular Fourier Series

come back and redo this section for each different Fourier Series

>

You have two choices :

If you know the function f , use the first subsection

If you know the coefficients , use the second subsection

If you know f and the coeffiecients, use either subsection

but do not do both !

Section IIa: Either Calculate Coefficients by Integrals

If you know the function f and choose L,

you can calculate the coefficients: [Maple Math] [Maple Math] [Maple Math]

using the integral formulas

define particular function f
(default example is for f(x)= {0 for -1<x<0 and x for 0<x<1})
modify this definition for other series

> f := piecewise(x>0,x);

[Maple Math]

choose L

> L := 2;

[Maple Math]

Now evaluate the integrals to find the coefficients

Note: these steps must be done in order

> Int( f, x=-L..L ) / L ;

[Maple Math]

> value(%);

[Maple Math]

> a0 := %;

[Maple Math]

> Int( f*cos(n*Pi*x/L), x=-L..L ) / L ;

[Maple Math]

> value(%);

[Maple Math]

> simplify(%,trig,assume=integer);

[Maple Math]

> an := %;

[Maple Math]

> Int( f*sin(n*Pi*x/L), x=-L..L ) / L ;

[Maple Math]

> value(%);

[Maple Math]

> simplify(%,trig,assume=integer);

[Maple Math]

> bn := %;

[Maple Math]

>

At this point, have defined the series, so skip down to the plots

Section 2b: or Specify Coefficients: [Maple Math] [Maple Math] & L

come back and redo this section for each different Fourier Series

You must first know the formula for each coefficient

define particular series coefficients and L
(default example is from text pg. 24:
[Maple Math] )
modify these definitions to plot other series

> L := Pi;

> a0 := 0;

> an := 1/n^2;

> bn := 0;

define particular function f (sum of series)
(default example: we don't know f, so set to 0 )
modify this definition for other series

Note: if do not know f, set f := 0;

> f := 0;

>

At this point, have defined the series, so go on to the plots

Section III: Plot Partial Sum [Maple Math] and/or Terms of Series

try changing N on any or all of these

choose N to plot the partial sum [Maple Math]

> N := 3;
plot( SN, x=-L .. L);

[Maple Math]

[Maple Plot]

choose N to plot term #N

> N := 3;
plot( subs(n=N,term), x=-L .. L);

[Maple Math]

[Maple Plot]

choose N to plot a partial sum and all the terms up to N

> N := 3;
plot( { a0/2, seq(subs(n=i,term),i=1..N), SN }, x=-L .. L);

[Maple Math]

[Maple Plot]

Section IV: Examine Convergence of Fourier Series

> plot( f, x=-L..L ); look at function over one period

[Maple Plot]

choose N to compare the function f to the partial sum [Maple Math]

> N := 5;
plot( [SN,f], x=-L .. L);

[Maple Math]

[Maple Plot]

choose max N to animate the convergence of the partial sum [Maple Math] to f

> Nmax := 5;
display([seq(plot( [SN,f], x=-L .. L),N=0..Nmax)], insequence=true);

[Maple Math]

[Maple Plot]

Conclusion: This worksheet clearly demonstrates Maple's ability to be used as an Educational tool for advanced mathematical concepts.

Disclaimer: While every effort has been made to validate the solutions in this worksheet, Waterloo Maple Inc. and the contributors are not responsible for any errors contained and are not liable for any damages resulting from the use of this material.