Here are a couple of functions that are similar to the bisect ones. decimate finds a better minimum point by checking points which neighbor our original guess. f is the function that you want to minimize, center_x etc is the center point, ie our first guess, radius is the farthest distance from the center that you want to check, and new_x etc stores the x, y, and z values of the new minimum point. > decimate:= > proc(f,center_x,center_y,center_z,radius,new_x,new_y,new_z) > local i,j,k,min_point_x, min_point_y, min_point_z, min_f, temp_f; > min_point_x:=center_x; > min_point_y:=center_y; > min_point_z:=center_z; > min_f:=f(center_x,center_y,center_z); > for i from -5 to 5 do > for j from -5 to 5 do > for k from -5 to 5 do > temp_f:= f(center_x + i/10*radius, center_y + j/10*radius, center_z + k/10*radius); > if(temp_f < min_f) then > min_point_x:=center_x + i/10*radius; > min_point_y:=center_y + j/10*radius; > min_point_z:=center_z + k/10*radius; > min_f:=temp_f; > > > end if; > od; > od; > od; > new_x:=min_point_x; > new_y:=min_point_y; > new_z:=min_point_z; > > end: decimate_solve iterates the process and finds a new x,y,x. f is the function that you want to minimize, center_x etc is the center point, ie our first guess, init_rad is the farthest distance from the center that you want to check, final_rad is the farthest that you want to be from the actual minimum, and new_x etc stores the x, y, and z values of the new minimum point. > decimate_solve:= > proc(f,center_x,center_y,center_z,init_rad,final_rad, > new_x,new_y,new_z) > local nx,ny,nz,temp_x,temp_y,temp_z,temp_rad; > temp_x:=center_x; > temp_y:=center_y; > temp_z:=center_z; > temp_rad:=init_rad; > > while (temp_rad >= final_rad) do > unassign('nx','ny','nz'); > decimate(f,temp_x,temp_y,temp_z,temp_rad,nx,ny,nz); > temp_x:=nx; > temp_y:=ny; > temp_z:=nz; > temp_rad:=temp_rad/10; > end do; > > new_x:=temp_x;new_y:=temp_y;new_z:=temp_z; > end; decimate_solve := proc(f, center_x, center_y, center_z, init_rad, final_rad, new_x, new_y, new_z) local nx, ny, nz, temp_x, temp_y, temp_z, temp_rad; temp_x := center_x; temp_y := center_y; temp_z := center_z; temp_rad := init_rad; while final_rad <= temp_rad do unassign('nx', 'ny', 'nz'); decimate(f, temp_x, temp_y, temp_z, temp_rad, nx, ny, nz); temp_x := nx; temp_y := ny; temp_z := nz; temp_rad := 1/10*temp_rad end do; new_x := temp_x; new_y := temp_y; new_z := temp_z end proc Here's an example. We'll find the minimum of g: > unassign('nx1','ny1','nz1'); > g:=proc(x,y,z) x^2 +(y-2.2)^2 +z^2 end; g := proc(x, y, z) x^2 + (y - 2.2)^2 + z^2 end proc > decimate(g,1,1,-1,5,nx1,ny1,nz1): > nx1; > ny1; > nz1; This is an okay approximation, but we really want y to be 2.2. decimate_solve does a better job: > unassign('nx1','ny1','nz1'); > decimate_solve(g,1,1,-1,5,.1,nx1,ny1,nz1): > nx1; > ny1; > nz1; .04 x_is, 0 y_is, 2 z_is, 0 1/2 0. x_is, 0 y_is, 11/5 z_is, 0 1/20 0 11/5 0 That works! Yay! I think you'll want to use this on the function for energy. For you, the x, y, and z will be the values for T[[0,1],8], T[[1,2],8],T[[0,2],8]. You might want the initial radius to be 1, and the final to be .00001, or something similar. Remember to use unassign! :) Melanie > >