{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 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Helvetica" 1 12 0 0 0 0 1 2 2 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 12 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }1 0 0 0 6 6 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 0" -1 256 1 {CSTYLE "" -1 -1 "Hel vetica" 1 12 0 0 0 0 2 1 2 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 2" -1 257 1 {CSTYLE "" -1 -1 "Courier" 1 14 0 0 0 0 2 2 2 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R 3 Font 2" -1 258 1 {CSTYLE "" -1 -1 "Helvetica" 1 12 0 0 0 0 2 2 2 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 3" -1 259 1 {CSTYLE "" -1 -1 "Courier-Bold" 1 12 0 0 0 0 2 2 2 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 4" -1 260 1 {CSTYLE "" -1 -1 "Courier" 1 12 0 0 0 0 2 2 2 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " " 0 "" {TEXT 256 11 "flowbox.mws" }{TEXT -1 2 " " }}{PARA 0 "" 0 "" {TEXT -1 152 "Calculus III or IV: geometric visulaization of divergenc e in 2-D (revised and improved 8/31/01 to Maple 7, with the assistance of Professor Doug Meade)." }}{PARA 0 "" 0 "" {TEXT -1 53 "Revised aga in for MATH 550, Fall, 2002 by Matt Miller" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 258 "This Maple worksheet is design ed to help the student visualize one geometric interpretation of diver gence, namely as local rate of change of volume. We compute it by obse rving how a small \"flowbox\" behaves subject to the flow determined b y the vector field. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "with(plots): with(linalg): with(DEtools): " }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 157 " First we compute the divergence of a simple vector field by using the \+ coordinate-dependent formula. You are going to enter other vector fiel ds here later on." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "F:= ( x , y ) \+ -> [ x - y , x + y + 0.001*x^2] ; vars:= [x, y] ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "div_F:= diverge( F(x,y), vars ); subs( x \+ = 1.5, y = 2.0, div_F);" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 23 "Part \+ I: Local behavior" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 92 "We specify t he test box dimensions. The coordinates of the lower left hand corner \+ are (a,b)." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 159 "a:= 1.5 ; b:= 2.0 ; \+ deltax:= 0.5 ; deltay:= 0.4 ;\naplus:=a + deltax :bplus:= b + deltay: \ncorners:= [ [a, b], [aplus, b], [aplus, bplus], [a, bplus], [a, b ] \+ ];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 145 "Testbox:= polygonplo t(corners, color = RED):\nFplot:= fieldplot( F(x,y) , x = -1 .. 3 , y \+ = -1 .. 7 , arrows=SLIM):\ndisplay(\{ Fplot , Testbox \} );" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 228 "T o see what happens to the box in a small neighborhood of (a,b) we use \+ the direction vectors to give the rates of change ineach component sep arately. Notice that these rates are different at each of the four cor ners of the box. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "deltat:= 0.9; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 264 "LL:= [a + F(a,b)[1]*d eltat , b + F(a,b)[2]*deltat];\nLR:= [aplus + F(aplus,b)[1]*deltat , \+ b + F(aplus,b)[2]*deltat] ;\nUL:= [a + F(a,bplus)[1]*deltat , bplus + F(a,bplus)[2]*deltat] ;\nUR:= [aplus + F(aplus, bplus)[1]*deltat , b plus + F(aplus, bplus)[2]*deltat] ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "newcorners:=[LL,LR,UR, UL, LL];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "Newbox:= polygonplot(newcorners, color=YELLOW ):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "display( \{Fplot, Tes tbox, Newbox\}, title=`One step deltat = 0.9`);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 190 "At this point we have chosen a fairly la rge value for deltat,just so we can see the effect clearly. We will co me back and repeat these calculations with smaller and smaller values \+ of deltat." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 83 "side1:= LR - \+ LL ;\nside2:= UL - LL ;\nA_new:= side1[1]*side2[2] - side1[2]*side2[1] ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 165 "Where on earth did thisformula come from? Does it really give \+ the area of the new box, or are we secretly making some approximation? (Hint: what are sides 3 and 4?) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 85 "A_old:= deltax * deltay ;\nrate_of_expansion:= (( A_new - A_old ) \+ / A_old ) / deltat ;" }{TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 608 "How do the successive values t hat you obtain for this rate compare with our original computation of \+ div F? For those of you who have studied differential equations, you w ill recognize that we have used Euler's method with justone step, and \+ at that we have only computed the effect on the cornersof the initial \+ box! Perhaps it would be a good idea to think about the calculation of A_new above--are there other sources of error besidesthe ones we have already identified? On the other hand, what happens to this error as \+ deltat -> 0? Repeat the calculation with successively smaller values \+ of deltat to see. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 510 "Once things seem clear try working through the same proc ess with the same vector field, but starting with different boxes (fir st keep a, and b, but change deltax and deltay, and again take a seque nce of successively smaller values of deltat; then start all over agai n with a box located with lower left corner at a new point (a, b), and vary deltax, deltay, and deltat). Keep a record of your observations ! What conclusions do you draw? What effect do thesize of deltax an d deltay have on the calculations?" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 25 "Part II. Global behavior" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 230 "Next weconsider the long term effec t of the flow upon a given volume. For purposes of illustration we con sider the interval from t = 0 to t = 1.2.Instead of using 1-step Euler we use Maple's built-in differential equations solver." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 74 "Fplot2:=fieldplot( F(x,y), x = -6.5 .. 2.5 , y = 0 .. 9.50, arrows=SLIM ):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "sys:= diff(x(t),t)=F(x(t),y(t))[1], diff(y(t),t)=F(x( t),y(t))[2] ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "unknowns:= \{x(t), y(t)\};" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "init[1]:= x(0)= a, y(0)=b;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "init[2]:= x(0)=aplus, y(0)=b;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "init[3]:= x(0)=a, y(0)= bplus;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "init[4]:= x(0)=aplus, y(0 )=bplus;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "LLsol := dsolve ( \{ sys, init[1] \}, unknowns, numeric ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "LRsol := dsolve( \{ sys, init[2] \}, unknowns, numeri c ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "ULsol := dsolve( \{ sys, in it[3] \}, unknowns, numeric ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "U Rsol := dsolve( \{ sys, init[4] \}, unknowns, numeric ):" }}}{EXCHG {PARA 0 ">" 0 "" {MPLTEXT 1 0 25 " collection:= corners; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "frames:= display( \{Fplot2, Testbox\} ): " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "for _t from 0.2 to 1.2 \+ by 0.2 do " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " LLcorner:=LLsol(_t) ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " LRcorner:=LRsol(_t);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 " ULcorner:=ULsol(_t);" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 23 " URcorner:=URsol(_t); " }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 51 " LL:= [subs(LLcorner,x(t)) , subs(LLcorner,y(t))]; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " LR:= [subs(LRcorner,x(t)) , s ubs(LRcorner,y(t))];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " UL:= [sub s(ULcorner,x(t)) , subs(ULcorner,y(t))];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 51 " UR:= [subs(URcorner,x(t)) , subs(URcorner,y(t))];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 84 " frames:= frames, display(\{Fplo t2, polygonplot([LL, LR, UR, UL, LL ], color=RED)\}):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 " collection:= collection, [LL,LR,UR,UL,LL];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 111 "display(\{Fplot2, plot(\{collection\}, style=LINE, t hickness=2)\}, title=`Time interval [0, 1.2], stepsize = 0.2`);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "display([frames], insequence =true);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 388 "\nWhat is going on he re? Does this calculation shed any more light (or perhaps cast a shado w) on the 1-step Euler approximation that we did earlier, especially w hen we took deltat = 0.9? To explore these concepts further, rework \+ everything (both local and global portions of this worksheet)with a ne w vector field, say for example, F(x,y) = (y,-x). What do you observe \+ this time around? " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}} }{MARK "0 0 0" 0 }{VIEWOPTS 0 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }