{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 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 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 0 }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 0 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 8 2 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 } 3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 65 "MCS 471 Project One: Numer ical Evaluation of Rational Expressions" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 309 "The goal of this project is to investiga te the numerical evaluation of rational expressions. For this project we will use Maple 7 (although older versions of Maple will probably w ork as well) because one interesting feature of Maple is that we can s et the working precision to any arbitrary number of digits." }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 30 "0. Random Rational Expressions" }} {PARA 0 "" 0 "" {TEXT -1 170 "We will generate a quotient of two rando m polynomials. The command randpoly in Maple generates a polynomial o f degree five with integer coefficients between -99 and +99." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "randomize(): # random ize seed" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "p := randpoly(x ); # numerator" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"pG,.*$)%\"xG\" \"&\"\"\"!#S*&\"\"$F*)F(\"\"%F*!\"\"*&\"\"'F*)F(F-F*F0*&\"#;F*)F(\"\"# F*F**&\"#uF*F(F*F0F7F0" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "q := randpoly(x); # denominator" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>% \"qG,.*$)%\"xG\"\"&\"\"\"\"#O*&\"\"%F*)F(F-F*F**&\"#'*F*)F(\"\"$F*F**& \"#GF*)F(\"\"#F*!\"\"*&\"#?F*F(F*F7\"#JF7" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 51 "r := p/q: rf := unapply(r,x); # rational function " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#rfGf*6#%\"xG6\"6$%)operatorG%&a rrowGF(*&,.*$)9$\"\"&\"\"\"!#S*&\"\"$F2)F0\"\"%F2!\"\"*&\"\"'F2)F0F5F2 F8*&\"#;F2)F0\"\"#F2F2*&\"#uF2F0F2F8F?F8F2,.F.\"#O*&F7F2F6F2F2*&\"#'*F 2F;F2F2*&\"#GF2F>F2F8*&\"#?F2F0F2F8\"#JF8F8F(F(F(" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 30 "1. Evaluation at Random Points" }}{PARA 0 "" 0 "" {TEXT -1 119 "We evaluate the rational function at random points, u sing floating-point arithmetic. We compare with the exact answer." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "Digits := 4; # working p recision is four digits" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'DigitsG \"\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "x0 := stats[random ,normald](1); # random point" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#x0 G$\"%V5!\"$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "rfx0 := rf(x 0); # approximate function evaluation" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%rfx0G$!%.;!\"$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 " x1 := convert(x0,'rational'); # rational representation of point" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%#x1G#\"#C\"#B" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 44 "rfx1 := rf(x1); # exact function evaluation" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%rfx1G#!*5T,$y\"*$=O\"*[" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "err := abs(rfx0-rfx1); # er ror" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$errG$\"\"#!\"$" }}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 15 "Assignment One:" }}{EXCHG {PARA 0 "" 0 " " {TEXT -1 345 "Repeat the calculation above for increasing values for Digits. Make a table with the error between the approximate and exac t function evaluation for these values of Digits. Take enough values (at least four) for Digits until you see the general relation between precision (number of digits) and the error for arbitrary large values of Digits." }}}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 33 "2. Evaluation a t a Special Points" }}{PARA 0 "" 0 "" {TEXT -1 100 "Now we generate a \+ special point and compare again the approximate function value with th e exact one." }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 34 "Consider the follo wing experiment:" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "Digits := 4; # working precision is again four" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%'DigitsG\"\"%" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 37 "x0 := fsolve(q,x); # a special point" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%#x0G$\"%8\")!\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "x1 := convert(x0,'rational'); # rational r epresentation of point" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#x1G#\"#I \"#P" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "rf(x1); # exact ari thmetic" }}{PARA 11 "" 1 "" {XPPMATH 20 "6##\"+M,h`[\"(no[(" }}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 15 "Assignment Two:" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 297 "Repeat the experiment above for increasing values for Digits. Make a table for values for rf(x1) for all values for Digits you choose. Again, take enough values (at least four) for Digits unt il you see a general pattern emerging. What happens to rf(x1) as you \+ let Digits grow larger and larger?" }}}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 23 "3. Sensitivity Analysis" }}{PARA 0 "" 0 "" {TEXT -1 360 " In the first experiment we took a random point and compared the result obtained with floating-point arithmetic with the result obtained with exact arithmetic. In the second experiment we took the rational repr esentation of a special point and computed its exact function evaluati on. We repeated this experiment with increasing precision of the spec ial point." }}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 17 "Assignment Three:" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 318 "In the experiments above we kno w both the random and the special point only up to a limited number of digits. So in both cases there is an error of magnitude 10^(-Digits) on the points. What is the influence of such an error on the functio n evaluation in these points? In particular, answer the following que stions:" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 88 "1. \+ Given an error of 10^(-8) on a random point, what is the error on the \+ function value?" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 66 " Do an experiment with enough digits to illustrate your answ er." }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 89 "2. Give n an error of 10^(-8) on a special point, what is the error on the fun ction value?" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 66 " Do an experiment with enough digits to illustrate your answer. " }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 130 "3. Is the re a difference in your answer between the random and special point? \+ Explain why there is or why there is no difference." }{MPLTEXT 1 0 0 " " }}}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 40 "4. Deadline is Friday 25 J anuary, at 1PM" }}{PARA 0 "" 0 "" {TEXT -1 71 "Bring your project solu tion to class. It should contain the following:" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "1. The tables with numerical values for the experime nts you have done." }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 103 "2. Answers to the questions in the assignments. Please \+ write complete grammatically correct sentences." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 60 "3. A print out of the Maple worksheet with your expe riments." }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 90 "If you have questions, comments, or difficulties, feel free to come to m y office for help." }{MPLTEXT 1 0 0 "" }}}}}{MARK "5 2 0 0" 17 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }