{VERSION 4 0 "SUN SPARC SOLARIS" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 }{PSTYLE "" 3 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 3 257 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 3 258 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {PARA 256 "" 0 "" {TEXT -1 81 "Animation of the Convergence of Partial Sums of a Fourier Series to the Function " }}{PARA 258 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 121 "Here is a Maple proced ure which lets you animate the convergence of the partial sums of the \+ Fourier series of a function " }{XPPEDIT 18 0 "f;" "6#%\"fG" }{TEXT -1 332 " to the function. The procedure requires four arguments: the \+ function, the independent variable and its range (for the plot), and a positive integer (which partial sum will be the last one you use). T he procedure will calculate the Fourier series on an interval whose le ngth is the length of the range of the independent variable." }}{PARA 257 "" 0 "" {TEXT -1 1 " " }{TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 630 "fourier_picture := proc( func, xrange::name=range, n ::posint)\n local x, a, b, L, k, j, p, q, partsum;\n a:=lhs( rhs(x range));\n b:=rhs( rhs(xrange));\n L:=b-a;\n x:=2*Pi*lhs(xrange) /L;\n partsum:=1/L * evalf( Int( func, xrange));\n for k from 1 to n do\n partsum:=partsum \n + 2/L *evalf( Int(func*sin(k*x) , xrange)) *sin(k*x) \n + 2/L *evalf( Int(func*cos(k*x), xrange )) *cos(k*x);\n q[k] := plot( partsum, xrange, color=blue,args[4.. nargs]);\n od;\n q:= plots[display]( [seq( q[k], k=1..n)], inseque nce=true);\n p:=plot( func, xrange, color=red, args[4..nargs]);\n \+ plots[display]( [q,p] );\n end:\n" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 19 "Here I use it with " }{XPPEDIT 18 0 "f( x) = abs(x);" "6#/-%\"fG6#%\"xG-%$absG6#F'" }{TEXT -1 133 ". I'll use [-1,1] as the range. We've already seen that the partial sums converg e very fast, so I'll go up to the fifth partial sum." }{TEXT -1 156 " \+ To animate, you have to click with the left mouse button on the plot. Then the video controls will appear as a toolbar, right under the st andard toolbar." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 34 "fourier_picture(abs(x),x=-1..1,5);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 14 "Next I'll use \+ " }{XPPEDIT 18 0 "f(x) = x;" "6#/-%\"fG6#%\"xGF'" }{TEXT -1 112 " agai n on the interval [-1,1]. We've seen that convergence takes longer, s o I'll go up to the 20th partial sum." }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "fourier_picture(x,x=-1.. 1,20);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 15 "Here I'll take " }{XPPEDIT 18 0 "f(x ) = exp(x);" "6#/-%\"fG6#%\"xG-%$expG6#F'" }{TEXT -1 64 " on the inter val [0,10]. Again, I'll take the 20th partial sum." }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "fourier_pi cture(exp(x), x=0..10, 20);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "19" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }