{VERSION 5 0 "IBM INTEL LINUX" "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 "" 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 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "L-16 MCS 563 Wednesday 29 \+ September 2004" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 94 "In th is worksheet we illustrate the relationship between least squares and \+ the backward error." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 178 "The examp le we consider appeared first in exercise 3 of section 1.5 on page 23, which continued through example 3.3 (page 74), example 5.6 (page 150) , and example 6.4 (page 185)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "intrinsic_p := (x-sqrt(2))^3*(x+sqrt(2));" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 44 "empirical_p := evalf(expand(intrinsic_p),5);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "f := unapply(empirical_p, x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "sols := solve(empiri cal_p,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "pseudo_zeros : = evalf(sols,5);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "residua ls := map(abs,map(f,[pseudo_zeros]));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 45 "Now we will set up the least squares problem:" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "d := degree(empi rical_p);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "a := Vector([s eq(coeff(empirical_p,x,i),i=0..d)]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "z1 := pseudo_zeros[1];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "S := (d,z) -> Matrix(d+1,d,(i,j) -> piecewise(i=j,-z, i=j+1,1,0));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "S1 := S(4,z 1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "q1 := LinearAlgebra[ LeastSquares](S1,a);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "r1 \+ := a - S1.q1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "LinearAlge bra[Norm](r1,1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "v1 := V ector([seq(abs(z1)^i,i=0..d)]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 135 "The vector v1 with consecutive powers of z1 is parallel to the re sidual vector computed by least squares, as verified by the following: " }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "r1/r1 [1];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "n1 := LinearAlgebra [Norm](v1,1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "delta[1] : = abs(f(z1))/(n1*10^(-5));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 101 "In stead of evaluating the polynomial, we can also take the residual of t he least squares computation:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "LinearAlgebra[Norm](r1,1)/(n1*10^(-5));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 48 "which leads to a delta[1] of the same magnitude." } {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 71 "The second ro ot is a bit more interesting, since it has a larger error:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "z2 := pseudo_zeros[2];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "v2 := Vector([seq(abs(z2)^i,i=0..d) ]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "n2 := LinearAlgebra[ Norm](v2,1):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "delta[2] := abs(f(z2))/(n2*10^(-5));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 152 "Not e the significance of the delta as validity parameter. In order for h aving a valid zero, delta should be less than one, or not much larger \+ than one." }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 49 "W e can generalize for the cluster of three roots:" }{MPLTEXT 1 0 0 "" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "z3 := pseudo_zeros[3]: z4 \+ := pseudo_zeros[4]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "clus ter := (x-z2)*(x-z3)*(x-z4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "expanded_cluster := expand(cluster);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 49 "b := [seq(coeff(expanded_cluster,x,i),i=0..d-1)];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "S3b := Matrix([[op(b), 0] ,[0,op(b)]]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "S3 := Line arAlgebra[Transpose](S3b);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "q3 := LinearAlgebra[LeastSquares](S3,a);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "r3 := a - S3.q3;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "delta[3] := LinearAlgebra[Norm](r3,1)/10^(-5);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 64 "If we take a larger cluster radius , as in the book, example 6.4:" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 46 "cluster := expand((x-1.40)*(x-1.41)*(x-1.42) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "b := [seq(coeff(clust er,x,i),i=0..d-1)];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "S3b \+ := Matrix([[op(b), 0],[0,op(b)]]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "S3 := LinearAlgebra[Transpose](S3b):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "q3 := LinearAlgebra[LeastSquares](S 3,a):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "r3 := a - S3.q3;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "r3/r3[1];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "delta[3] := LinearAlgebra[Norm](r3, 1)/10^(-5);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 82 "The magnitude of t his delta corresponds to the number of the book, which has 3400." } {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 98 "This delta[3] measures the validity of the cluster polynomial as a factor of the gi ven polynomial." }{MPLTEXT 1 0 0 "" }}}}{MARK "54" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }