{VERSION 4 0 "IBM INTEL LINUX" "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 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 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 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 "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 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "Here are a couple of funct ions that are similar to the bisect ones. " }{TEXT 260 8 "decimate" } {TEXT -1 85 " finds a better minimum point by checking points which ne ighbor our original guess. " }{TEXT 256 1 "f" }{TEXT -1 44 " is the f unction that you want to minimize, " }{TEXT 257 8 "center_x" }{TEXT -1 46 " etc is the center point, ie our first guess, " }{TEXT 258 6 "r adius" }{TEXT -1 70 " is the farthest distance from the center that yo u want to check, and " }{TEXT 259 5 "new_x" }{TEXT -1 60 " etc stores \+ the x, y, and z values of the new minimum point." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 896 "decimate:=\nproc(f,center_x,center_y,center_ z,radius,new_x,new_y,new_z)\n local i,j,k,min_point_x, min_point_y, m in_point_z, min_f, temp_f;\n min_point_x:=center_x;\n min_point_y:=c enter_y;\n min_point_z:=center_z;\n min_f:=f(center_x,center_y,cente r_z);\n for i from -5 to 5 do \n for j from -5 to 5 do\n f or k from -5 to 5 do\n temp_f:= f(center_x + i/10*radius, ce nter_y + j/10*radius, \+ center_z + k/10*ra dius);\n if(temp_f < min_f) then\n min_point_x: =center_x + i/10*radius;\n min_point_y:=center_y + j/10*r adius;\n min_point_z:=center_z + k/10*radius;\n \+ min_f:=temp_f; \n \n \n end i f;\n od;\n od;\n od;\n new_x:=min_point_x;\n new_y:=min_p oint_y;\n new_z:=min_point_z;\n\nend:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 266 15 "decimate_solve " }{TEXT -1 46 "iterates the process and \+ finds a new x,y,x. " }{TEXT 261 1 "f" }{TEXT -1 44 " is the function that you want to minimize, " }{TEXT 262 8 "center_x" }{TEXT -1 46 " e tc is the center point, ie our first guess, " }{TEXT 263 8 "init_rad" }{TEXT -1 66 " is the farthest distance from the center that you want \+ to check, " }{TEXT 265 9 "final_rad" }{TEXT -1 66 " is the farthest th at you want to be from the actual minimum, and " }{TEXT 264 5 "new_x" }{TEXT -1 60 " etc stores the x, y, and z values of the new minimum po int." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 467 "decimate_solve:=\n proc(f,center_x,center_y,center_z,init_rad,final_rad,\n new_x,new _y,new_z)\n local nx,ny,nz,temp_x,temp_y,temp_z,temp_rad;\n temp_x:=ce nter_x;\n temp_y:=center_y;\n temp_z:=center_z;\n temp_rad:=init_rad; \n\n while (temp_rad >= final_rad) do\n unassign('nx','ny','nz');\n \+ decimate(f,temp_x,temp_y,temp_z,temp_rad,nx,ny,nz);\n temp_x:=nx; \n temp_y:=ny;\n temp_z:=nz;\n temp_rad:=temp_rad/10; \nend do;\n\n new_x:=temp_x;new_y:=temp_y;new_z:=temp_z;\nend;" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%/decimate_solveGR6+%\"fG%)center_xG%)center_yG%)cente r_zG%)init_radG%*final_radG%&new_xG%&new_yG%&new_zG6)%#nxG%#nyG%#nzG%' temp_xG%'temp_yG%'temp_zG%)temp_radG6\"F8C*>8'9%>8(9&>8)9'>8*9(?(F8\" \"\"FGF819)FDC(-%)unassignG6%.8$.8%.8&-%)decimateG6*9$F;F>FAFDFOFQFS>F ;FO>F>FQ>FAFS>FD,$FD#FG\"#5>9*F;>9+F>>9,FAF8F8F8" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 48 "Here's an example. We'll find the minimum of g:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "unassign('nx1','ny1','nz1 ');" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "g:=proc(x,y,z) x^2 + (y-2.2)^2 +z^2 end;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"gGR6%%\"xG% \"yG%\"zG6\"F*F*,(*$)9$\"\"#\"\"\"F0*$),&9%F0$\"#A!\"\"F7F/F0F0*$)9&F/ F0F0F*F*F*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "decimate(g,1, 1,-1,5,nx1,ny1,nz1):\nnx1;\nny1;\nnz1;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 97 "This is an okay approximation, but we really want y to be 2.2. decimate_solve does a better job:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "unassign('nx1','ny1','nz1');" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "decimate_solve(g,1,1,-1,5,.1,nx1,ny1,nz1):\nnx1; \nny1;\nnz1;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"\"%!\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$%%x_isG\"\"!" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$%%y_isG\"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$%%z_isG\"\"!" }} {PARA 11 "" 1 "" {XPPMATH 20 "6##\"\"\"\"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"\"!F$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$%%x_isG\"\" !" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$%%y_isG#\"#6\"\"&" }}{PARA 11 "" 1 "" {XPPMATH 20 "6$%%z_isG\"\"!" }}{PARA 11 "" 1 "" {XPPMATH 20 "6## \"\"\"\"#?" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"!" }}{PARA 11 "" 1 " " {XPPMATH 20 "6##\"#6\"\"&" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"!" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 297 "That works! Yay! I think you 'll want to use this on the function for energy. For you, the x, y, a nd z will be the values for T[[0,1],8], T[[1,2],8],T[[0,2],8]. You m ight want the initial radius to be 1, and the final to be .00001, or s omething similar. Remember to use unassign! :) Melanie" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "3 0 0" 410 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }