{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 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 1 0 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 "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 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "L-21 MCS 563 Monday 11 Oct ober 2004" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 90 "As running examp le in the first half of the lecture we looked at the following polynom ial:" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 " f := x^3 - x^2 + y^2;" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 30 "1. Abou t good parametrizations" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "For plo tting the " }{TEXT 256 4 "real" }{TEXT -1 77 " curve defined by the po lynomial f, we may need another representation for f." }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "plots[implicitplot]( f,x=-2..2,y=-2..2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 159 "The plot \+ does not look so good, because of the singularity at the origin we enc ounter in rectangular coordinates. Therefore, let us move to polar co ordinates:" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "rf := subs(x=r*cos(t),y=r*sin(t),f);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 22 "rt := solve(rf/r^2,r);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 29 "plots[polarplot](rt,t=-1..1);" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 103 "To sample in complex space, we just cut the hyper surface defined by the polynomial with a random line." }{MPLTEXT 1 0 0 "" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 30 "2. Nearest points to a s urface" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 269 "The technique of Lagran ge multipliers is very useful to find the point on the hypersurface cl osest to a given point. Here we illustrate this technique with the gi ven point (1,1) and look for the point on the hypersurface defined by \+ f, closest to the given point (1,1)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "g := (x-1)^2 + (y-1)^2; # to minimize" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 70 "sys := \{diff(g,x) - lambda*diff(f, x), diff(g,y) - lambda*diff(f,y),f\};" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 73 "The command fsolve computes one solution using floating-p oint arithmetic:" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "fsolve(sys,\{x,y,lambda\});" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 55 "Let us verify by computing all solutions to the system. " }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "gb : = Groebner[gbasis]([op(sys)],plex(x,y,lambda));" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 29 "sols := fsolve(gb[1],lambda);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 80 "We know there are four solutions, but let us not bother about the complex roots:" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "sys2 := subs(lambda=sols[2],gb);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "solve(\{sys2[2],sys2[3]\}, \{x,y\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 89 "We can already see t hat this solution is farther away from (1,1) than the other solution. " }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} }}{MARK "5 1 0 0" 167 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }