{VERSION 5 0 "SUN SPARC SOLARIS" "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 }{CSTYLE "" -1 256 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT 256 25 "Trigonometric Polynomia ls" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "First define the first few \+ basic elements" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "a[0]:=t->1/sqrt(2):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "a[1]:=t->cos(t):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "b[1]:=t-> sin(t):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "a[2]:=t->cos(2*t):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "b[2]:=t->sin(2*t):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "a[3]:=t->cos(3*t):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "b[3]:=t->sin(3*t):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 "Define a test function:" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 14 "ff:=t->abs(t):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "The inner product" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 43 "IP:=(f,g)->(1/Pi)*int(f(u)*g(u),u=-Pi..Pi); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 49 "For example, the inner produc t of ff and a[0] is:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "IP(ff,a[0]) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 60 "Find the orthogonal projecti on of ff on the subspace :" }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "ff0:=t->(IP(ff,a[0])*a[0](t));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "We can see the graph of both ff and its projectio n on :" }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " plot([ff(t),ff0(t)],t=-Pi..Pi);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 94 "Next we consider the orthogonal projection on . Th e two (new) coefficients are" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "IP( ff,a[1]);evalf(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "and " } {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "IP(ff,b[1]);eva lf(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 "Then the projection is \+ " }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 "ff1:=t->IP(f f,a[0])*a[0](t) + IP(ff,a[1])*a[1](t) + IP(ff,b[1])*b[1](t);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 46 "The following plot shows ff and th e projection" }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " plot([ff(t),ff1(t)],t=-Pi..Pi);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 100 "Next we consider the orthogonal projection on . The new coefficients are:" }{MPLTEXT 1 0 0 "" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 21 "IP(ff,a[2]);evalf(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "and " }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "IP(ff,b[2]);evalf(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 138 "Since we see that both coefficients vanish we know that the projectio n of ff on this subspace is the same vector as the last projection. \+ " }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 116 "ff2 :=t->IP(ff,a[0])*a[0](t) + IP(ff,a[1])*a[1](t) + IP(ff,b[1])*b[1](t) + IP(ff,a[2])*a[2](t) + IP(ff,b[2])*b[2](t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "plot([ff(t),ff2(t)],t=-Pi..Pi);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 101 "Finally, we consider the projection on . The new coefficients are" }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "IP(ff,a[3]);evalf(%);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "IP(ff,b[3]);evalf(%);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 21 "and the projection is" }{MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 160 "ff3:=t->IP(ff,a[0])*a[0 ](t) + IP(ff,a[1])*a[1](t) + IP(ff,b[1])*b[1](t) + IP(ff,a[2])*a[2](t) + IP(ff,b[2])*b[2](t) + IP(ff,a[3])*a[3](t) + IP(ff,b[3])*b[3](t);" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "with graph" }{MPLTEXT 1 0 0 "" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "plot([ff(t),ff3(t)],t=-Pi..Pi);" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 243 "We know that ff is not differen tiable at the origin whereas the projections (being trigonometric poly nomials) are. How well does the derivative of the last projection appr oximate the derivatives near the origin, and what happens at the origi n?" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "plot([diff(ff(t),t),diff(ff3( t),t)],t=-Pi..Pi);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 602 "We see on \+ the previous graph that the approximation seems to be correct except a t the origin (to be expected by the nondifferentiability of ff) and at the endpoints of the interval: why would this be? The problem is that , on the one hand the trigonometric functions are periodic with period 2Pi (hence, their values at -Pi and Pi coincide). On the other hand, \+ the derivative of ff is not a periodic function so the projection cann ot approximate very well near the endpoints where the \"deffect\" beco mes evident. There is a nice theory of harmonic analysis that explains all this behavior, and lots more!" }{MPLTEXT 1 0 0 "" }}}}{MARK "25" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }