{VERSION 4 0 "IBM INTEL NT" "4.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 Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 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 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Warning" -1 7 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 2 2 2 2 2 1 1 1 3 1 } 1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Output" -1 11 1 {CSTYLE " " -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 3 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Output" -1 12 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 3 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Map le Plot" -1 13 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 257 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 257 "" 0 "" {TEXT 259 54 "PHYS 312:\nSOLUTIONS TO PROBLEMS\nSect 3.3\nProblem 3.3:1" }}{PARA 257 "" 0 "" {TEXT -1 185 " You may wish to refresh your memory about the use of finite difference method for ordinary differential equations (sect 2.3 and http://www.p hysics.ubc.ca/~birger/n312l3.mws (or .html))." }}{PARA 0 "" 0 "" {TEXT -1 49 "We will need plots and the linear algebra package" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "restart;with(plots):with(lin alg):" }}{PARA 7 "" 1 "" {TEXT -1 50 "Warning, the name changecoords h as been redefined\n" }}{PARA 7 "" 1 "" {TEXT -1 80 "Warning, the prote cted names norm and trace have been redefined and unprotected\n" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 34 "The following constants were given " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "a:=16;b:=8;c:=8;d:=4;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"aG\"#;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"bG\"\")" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"cG\" \")" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"dG\"\"%" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 92 "The origin of our coordinate system is the corner where A and B meet. We next set up a grid." }}{PARA 0 "" 0 "" {TEXT -1 13 "Let there be " }{XPPEDIT 18 0 "N[x]+1" "6#,&&%\"NG6#%\"xG\"\"\" F(F(" }{TEXT -1 63 " grid points (including the boundaries) in the x d irection and " }{XPPEDIT 18 0 "N[y]+ 1" "6#,&&%\"NG6#%\"yG\"\"\"F(F(" }{TEXT -1 7 " in the" }}{PARA 0 "" 0 "" {TEXT -1 26 "y-direction. Let \+ us choose" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "NX:=16;NY:=8; " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#NXG\"#;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#NYG\"\")" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 "The increments are then" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "DX: =a/NX;DY:=b/NY;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#DXG\"\"\"" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%#DYG\"\"\"" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 59 "The solution is sought at a set of points x[n], y[m] w here" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "x:=seq(DX*(n-1),n=1 ..NX+1):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 18 "The y-sequence is " } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "y:=seq(DY*(n-1),n=1..NY+1) :" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 52 "Note that the first point , \+ x=0, in the sequence is" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 " x[1];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"!" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 42 "We wish to to compute the solutions as " } {XPPEDIT 18 0 "u[n,m]" "6#&%\"uG6$%\"nG%\"mG" }{TEXT -1 3 " . " }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "Along the wall B the boundary cond ition can be incorporated by the following do-loop" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "for n from 1 to NY+1 do\nu[1,n]:=y[n];\nod: " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 281 "The colon at the end of the \+ od statement suppresses the output. In Maple 6 the od statement comple ting the do-loop can be replaced by end do. This doesn't work in earli er versions of Maple and I therefore don't recommend it. Along the wal l E the boundary condition is impleneted by" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "for n from 1 to NX/2 +1 do\nu[n,NY+1]:=b+x[n];\nod :" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 16 "Next, the wall F" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "for n from NY/2+1 to NY+1 do\nu[NX/ 2+1,n]:=a-c+b;\nod:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "the wall C " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "for n from NX/2 +1 to N X do\nu[n,NY/2+1]:=x[n]+b;\nod:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 5 "and D" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "for n from 1 to N Y/2+1 do\nu[NX+1,n]:=a+b;\nod:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 44 "Along the wall A the boundary condition was " }}{PARA 0 "" 0 "" {XPPEDIT 18 0 "diff(u,y);" "6#-%%diffG6$%\"uG%\"yG" }{TEXT -1 4 "=0. \+ " }}{PARA 0 "" 0 "" {TEXT -1 113 "We can incorporate this condition by imagining that the room continues in the negative y direction and mak ing an " }{TEXT 256 5 "even " }{TEXT -1 278 "extension putting u(x,y)= u(x-y). This will guarantee that the y-derivative is zero for y=0 (ano ther method for incorporating boundary values for the derivative was g iven in lecture 6). We now generate the set of equations. First the s et of equations corresponding to the wall A" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 79 "eqs:=\{seq(DY^2/2*(u[n-1,1]+u[n+1,1])+DX^2*u[n,2]= (DX^2+DY^2)*u[n,1]\n,n=2..NX)\}:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 64 "We also need to generate the set of variables for which we solve" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "vars:=\{seq(u[n,1],n=2..N X)\}:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 109 "We now add an equation \+ and a variable for each interior point in the \"westerm\" rectangle fr om 2,2 to NX/2, NY" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 168 "for \+ n from 2 to NX/2 do\nfor m from 2 to NY do\neqs:=eqs union \{DY^2*(u[n -1,m]+u[n+1,m])+DX^2*(u[n,m-1]+u[n,m+1])=2*(DX^2+DY^2)*u[n,m]\};\nvars :=vars union \{u[n,m]\};\nod\nod:" }}}{EXCHG {PARA 12 "" 1 "" {TEXT -1 99 "To these we add equations and variables for the \"south-eastern \" rectangle from NX/2+1,2 to NX, NY/2" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 171 "for n from NX/2 to NX do\nfor m from 2 to NY/2 do\ne qs:=eqs union \{DY^2*(u[n-1,m]+u[n+1,m])+DX^2*(u[n,m-1]+u[n,m+1])=2*(D X^2+DY^2)*u[n,m]\};\nvars:=vars union \{u[n,m]\};\nod\nod;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "sol:=evalf(solve(eqs,vars)):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "assign(sol);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 90 "To display the solution we put it in the \+ form of an array. We initalize the matrix to zero" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 23 "S:=matrix(NY+1,NX+1,0):" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 34 "Read in values on the \"west side\":" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 78 "for n from 1 to NX/2+1 do\nfor m fr om 1 to NY+1 do\nS[NY-m+2,n]:=u[n,m];\nod \nod;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 "and the \"south-east side\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 83 "for n from NX/2+2 to NX+1 do\nfor m from 1 to NY /2+1 do\nS[NY-m+2,n]:=u[n,m];\nod \nod;" }}}{EXCHG {PARA 12 "" 1 "" {TEXT -1 40 "The command matrixplot then does the job" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 89 "matrixplot(S,axes=frame,labels=[\"y \",\"x\",\"u \"],tickmarks=[0,0,3],orientation=\n[-20,45]);" }} {PARA 13 "" 1 "" {GLPLOT3D 400 300 300 {PLOTDATA 3 "6'-%%GRIDG6%;\"\" \"\"\"*;F'\"#<7+73\"\")F(\"#5\"#6\"#7\"#8\"#9\"#:\"#;\"\"!F5F5F5F5F5F5 F573\"\"($\"+(*4jS\")!\"*$\"+)4_vF*F:$\"+DG#3/\"!\")$\"+1x>`6F?$\"+!)) 3]E\"F?$\"+Sbaw8F?$\"+*z]\")[\"F?F4F5F5F5F5F5F5F5F573\"\"'$\"+*)=(\\G( F:$\"+T\"\\8c)F:$\"+bQQB)*F:$\"+?\"fp5\"F?$\"+vAHI7F?$\"+![AIN\"F?$\"+ cw0w9F?F4F5F5F5F5F5F5F5F573\"\"&$\"+>u!zV'F:$\"+B()[fyF:$\"+GoOa#*F:$ \"+7\"3?1\"F?$\"+>'yh>\"F?$\"+]W>H8F?$\"+Xt0j9F?F4F5F5F5F5F5F5F5F573\" \"%$\"+l!prg&F:$\"+.:L%=(F:$\"+5O^9()F:$\"+F!e%>5F?$\"+Q'>K;\"F?$\"+c$ >XI\"F?$\"+ts(pW\"F?F4F*\"#=\"#>\"#?\"#@\"#A\"#B\"#C73\"\"$$\"+RtV1[F: $\"+9Y:clF:$\"+OexC#)F:$\"+$)*H:\")*F:$\"+^DsK6F?$\"+kgoy7F?$\"+\"RK.U \"F?$\"+Z\\pc:F?$\"+c*=Qn\"F?$\"+_mG$y\"F?$\"+_**3*)=F?$\"+$*o(G*>F?$ \"+TLY&4#F?$\"++0K(>#F?$\"+Wov)H#F?Fhp73\"\"#$\"+vcUiSF:$\"+yP24gF:$\" +Q^!p\"yF:$\"+2$Q&*\\*F:$\"+/:$y5\"F?$\"+c*prD\"F?$\"+#Gr*)R\"F?$\"+R% GE`\"F?$\"+EUHb;F?$\"+*pP-x\"F?$\"+ki>!)=F?$\"+zU&p)>F?$\"+pfl\"4#F?$ \"+:=1&>#F?$\"+uoq(H#F?Fhp73F'$\"+%e\">MMF:$\"+%o43g&F:$\"+HEBMvF:$\"+ kIS\"H*F:$\"+!oz94\"F?$\"+v4>V7F?$\"+TVv&Q\"F?$\"+,Lb>:F?$\"+5=\\W;F?$ \"+cOF?$\"+VW9*3#F?$\"+#F?$\"+Q)3qH#F ?Fhp73F5$\"+y4`tIF:$\"+W2uDaF:$\"+KE\"yU(F:$\"+BX/<#*F:$\"+Lfv&3\"F?$ \"+A*f$Q7F?$\"+0=I\"Q\"F?$\"+;'Q`^\"F?$\"+cg%4k\"F?$\"+*)>YfF?$\"+$*)p#)3#F?$\"+t0/$>#F?$\"+iXw'H#F?Fhp-%+AXESLABE LSG6%Q\"y6\"Q\"xF[yQ%u~~~F[y-%*AXESTICKSG6%F5F5Fjp-%*AXESSTYLEG6#%&FRA MEG-%+PROJECTIONG6%$!#?F5$\"#XF5F'" 1 2 0 1 10 0 2 1 1 3 2 1.000000 45.000000 -20.000000 1 0 "Curve 1" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 583 "If you see t he plot within a maple worksheet (and not in an html document) you can click the mouse in the plot are and rotate the plot to get different \+ orientations. The command \"matrixplot\" is not particularly flexible \+ when it comes to getting the plot look nice. In particular the x and y coordinates are row and column numbers in a matrix and not actual x a nd y values. The command \"surfdata\" offers more possibilities, but s etting up the required nested lists is a bit cumbersome so let us stop here for now. In practice you may wish instead to output the solution to a data-file" }}{PARA 0 "" 0 "" {TEXT -1 74 "and use another progra m to plot the result or manipulate the data further." }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 258 13 "Problem 3.3:2" }} {PARA 0 "" 0 "" {TEXT -1 34 "We are asked to find a solution to" }} {PARA 0 "" 0 "" {XPPEDIT 18 0 "diff(u,`$`(x,2))+diff(u,`$`(y,2)) = 1; " "6#/,&-%%diffG6$%\"uG-%\"$G6$%\"xG\"\"#\"\"\"-F&6$F(-F*6$%\"yGF-F.F. " }}{PARA 0 "" 0 "" {TEXT -1 64 "in the same region as in the previous problem. Let's start again" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "restart;with(plots):with(linalg):" }}{PARA 7 "" 1 "" {TEXT -1 50 " Warning, the name changecoords has been redefined\n" }}{PARA 7 "" 1 " " {TEXT -1 80 "Warning, the protected names norm and trace have been r edefined and unprotected\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 13 "The constants" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "a:=16;b:=8;c: =8;d:=4;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"aG\"#;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"bG\"\")" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>% \"cG\"\")" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"dG\"\"%" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "Choose a slightly finer grid doesn't caus e any problem on my computer" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "NX:=32;NY:=16;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#NXG\"#K" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%#NYG\"#;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 "The increments are then" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "DX:=a/NX;DY:=b/NY;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6 #>%#DXG#\"\"\"\"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#DYG#\"\"\"\" \"#" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "The x-sequence is" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "x:=seq(DX*(n-1),n=1..NX+1): " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 18 "The y-sequence is " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "y:=seq(DY*(n-1),n=1..NY+1): " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 26 "Boundary condition along B" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "for n from 1 to NY+1 do\nu [1,n]:=y[n];\nod:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "Along the wa ll E " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "for n from 1 to NX /2 +1 do\nu[n,NY+1]:=b+x[n];\nod:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 16 "Next, the wall F" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "for n from NY/2+1 to NY+1 do\nu[NX/2+1,n]:=a-c+b;\nod:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "the wall C" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "for n from NX/2 +1 to NX do\nu[n,NY/2+1]:=x[n]+b;\nod :" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 5 "and D" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 45 "for n from 1 to NY/2+1 do\nu[NX+1,n]:=a+b;\nod :" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 44 "Along the wall A the boundar y condition was " }}{PARA 0 "" 0 "" {TEXT -1 1 " " }{XPPEDIT 18 0 "dif f(u,y);" "6#-%%diffG6$%\"uG%\"yG" }{TEXT -1 4 "=0. " }}{PARA 0 "" 0 " " {TEXT -1 116 "Again, we incorporate this condition by imagining that the room continues in the negative y direction and making an " } {TEXT 257 5 "even " }{TEXT -1 106 "extension putting u(x,y)=u(x-y). We now generate the set of equations are now slightly different. Along A " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 89 "eqs:=\{seq(DY^2/2*(u[n -1,1]+u[n+1,1])+DX^2*u[n,2]=(DX^2+DY^2)*u[n,1]\n+DX^2*DY*2,n=2..NX)\}: " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 39 "The set of variables for whic h we solve" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "vars:=\{seq(u [n,1],n=2..NX)\}:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 76 "Equations fo r interior point in the \"westerm\" rectangle from 2,2 to NX/2, NY" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 178 "for n from 2 to NX/2 do\nf or m from 2 to NY do\neqs:=eqs union \{DY^2*(u[n-1,m]+u[n+1,m])+DX^2*( u[n,m-1]+u[n,m+1])=2*(DX^2+DY^2)*u[n,m]+DX^2*DY^2\};\nvars:=vars union \{u[n,m]\};\nod\nod:" }}}{EXCHG {PARA 12 "" 1 "" {TEXT -1 99 "To thes e we add equations and variables for the \"south-eastern\" rectangle f rom NX/2+1,2 to NX, NY/2" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 181 "for n from NX/2 to NX do\nfor m from 2 to NY/2 do\neqs:=eqs union \{DY^2*(u[n-1,m]+u[n+1,m])+DX^2*(u[n,m-1]+u[n,m+1])=2*(DX^2+DY^2)*u[n ,m]+DX^2*DY^2\};\nvars:=vars union \{u[n,m]\};\nod\nod;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "sol:=evalf(solve(eqs,vars)):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "assign(sol);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 90 "To display the solution we put it in the \+ form of an array. We initalize the matrix to zero" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 23 "S:=matrix(NY+1,NX+1,0):" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 34 "Read in values on the \"west side\":" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 78 "for n from 1 to NX/2+1 do\nfor m fr om 1 to NY+1 do\nS[NY-m+2,n]:=u[n,m];\nod \nod;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 "and the \"south-east side\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 83 "for n from NX/2+2 to NX+1 do\nfor m from 1 to NY /2+1 do\nS[NY-m+2,n]:=u[n,m];\nod \nod;" }}}{EXCHG {PARA 12 "" 1 "" {TEXT -1 40 "The command matrixplot then does the job" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 89 "matrixplot(S,axes=frame,labels=[\"y \",\"x\",\"u \"],tickmarks=[0,0,3],orientation=\n[-20,45]);" }} {PARA 13 "" 1 "" {GLPLOT3D 400 300 300 {PLOTDATA 3 "6'-%%GRIDG6%;\"\" \"\"#<;F'\"#L737C\"\")#F(\"\"#\"\"*#\"#>F/\"#5#\"#@F/\"#6#\"#BF/\"#7# \"#DF/\"#8#\"#FF/\"#9#\"#HF/\"#:#\"#JF/\"#;\"\"!FFFFFFFFFFFFFFFFFFFFFF FFFFFFFF7C#FBF/$\"+q#pAc(!\"*$\"+d$e8v(FK$\"+(\\P(>!)FK$\"+.E=Y$)FK$\" +5_>?()FK$\"+9qXO\"*FK$\"+](>Ef*FK$\"+4Y$)35!\")$\"+dx[i5FZ$\"+L[[?6FZ $\"+)fBK=\"FZ$\"+!*eC^7FZ$\"+NLGD8FZ$\"+KLT19FZ$\"+-Fb'\\\"FZFEFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFF7C\"\"($\"+C(=xu'FK$\"+gmUtmFK$\"+G!49t'FK$\" +1xz%*oFK$\"+A79[rFK$\"+(48I[(FK$\"+#*en&*yFK$\"+aq)eQ)FK$\"+_eJ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(*=#FK$!+;W7lQFK$!+A>yr^FK$! +I[#z;'FK$!+O,7&)oFK$!+%=^]M(FK$!+1f@lvFK$!+cDXhvFK$!+G:X\\tFK$!+en\"f %pFK$!+WocpjFK$!+E^%>k&FK$!+a4%yy%FK$!+,6)\\$QFK$!+lDg7GFK$!+tHt[#>=%F]\\l$\"+!>A#*\\\"FK$\"+`+9yDFK$\"+ZZQjOFK$\"+*f \\'oZFK$\"+y([=\"fFK$\"+*ztY6(FK$\"+FYt-%)FK$\"+e9G1)*FK$\"+_G;O6FZ$\" +YWP68FZ$\"+#eZ@^\"FZ$\"+(3Iqu\"FZ$\"+>B4J?FZFf^l-%*AXESTICKSG6%FFFFFi bl-%*AXESSTYLEG6#%&FRAMEG-%+AXESLABELSG6%Q\"y6\"Q\"xFa_nQ%u~~~Fa_n-%+P ROJECTIONG6%$!#?FF$Fc^lFFF'" 1 2 0 1 10 0 2 1 1 3 2 1.000000 45.000000 -20.000000 1 0 "Curve 1" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 332 "The differen tial equation corresponds to the Poisson equation for the electrostat ic potential with a uniform negative charge distribution. Hence the mi nimum in u in internal regions far from walls where the potential is h eld fixed. In the work sheet you can change the view by clicking with \+ the mouse on the figure and dragging it." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 306 "I have suppressed a lot o f outputs by using colons rather than semicolons at the end of calcula tions. You should play with the grid sizes and have Maple print some o f these outputs to get a feeling for how the computation works. You \+ should also play with modifying the differential equation and the grid ." }}}}{MARK "1 0 0" 30 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }