{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 277 "This wor ksheet shows how the partial Fourier sine series converges to a functi on g(t) on the interval (0, Pi). Although the domain of g is defined \+ only on this interval, the Fourier series is defined for all t- so we' ll plot the Fourier sine series on a larger domain for fun." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "g :=t->signum(sin(t)); #This is a square wave" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "plot(g(t),t=-10..10);" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 210 "Now we'll compute the \+ first 40 Fourier sine coefficients. We'll do this by constructing an \+ array of 40 numbers, corresponding to the 40 coefficients. You can do more or less by changing the value of NN below:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "NN:=40;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "a:=array(1..NN,[]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 72 "for k from 1 to NN do a[k]:=evalf((2/Pi)*int(g(t)*sin(k*t),t=0..Pi )) od;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 151 "We'll construct a function of two variables, n and t. \+ The n will define how many terms of the series to use, and t will be o ur usual domain variable:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "ts:=(n,t)->sum(a[j]*sin(j*t),j=1..n );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 111 "Just so we can see what this function is, let's show the parti al sum with 7 terms (some coefficients are zero):" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "ts(7,t);" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plots):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "animate(ts(n,t),t=-10..10,n=1..NN,f rames=40, numpoints=500);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 98 "Notice what is happening at the corners- \+ This kind of \"bunching up\" is called the Gibbs phenomena." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 109 "Let's see what kind of convergence we get by looking at the difference between g and the partial sine series:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "animate(g(t)-ts(n,t),t=-10..10,n=1. .NN,frames=40, numpoints=500);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}}}{MARK "0 0 0" 8 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }