Re: Extrema of 2D Interpolating function

*To*: mathgroup at smc.vnet.net*Subject*: [mg91440] Re: [mg91435] Extrema of 2D Interpolating function*From*: Bob Hanlon <hanlonr at cox.net>*Date*: Fri, 22 Aug 2008 03:10:25 -0400 (EDT)*Reply-to*: hanlonr at cox.net

Use FindRoot approx[x_, base_] := RootApproximant[x/base, 2]*base data = Flatten[Table[{{x, y}, Sin[x] Sin[y]}, {x, 0, 2 Pi, Pi/3}, {y, 0, 2 Pi, Pi/3}], 1]; f[x_, y_] = Interpolation[data][x, y]; Plot3D[f[x, y], {x, 0, 2 Pi}, {y, 0, 2 Pi}] soln = FindRoot[{D[f[x, y], x] == 0, D[f[x, y], y] == 0}, {{x, #[[1]]}, {y, #[[2]]}}] & /@ {{1, 1}, {1, 5}, {3, 3}, {5, 1}, {5, 5}}; soln /. n_?NumberQ :> approx[n, Pi] {{x -> Pi/2, y -> Pi/2}, {x -> Pi/2, y -> (3*Pi)/2}, {x -> Pi, y -> Pi}, {x -> (3*Pi)/2, y -> Pi/2}, {x -> (3*Pi)/2, y -> (3*Pi)/2}} Bob Hanlon ---- Modeler <eabad at ulb.ac.be> wrote: ============= Hi, I'd like to compute the minima and the saddle points of a 2D interpolating function f[x,y] obtained from a list of points with mathematica 6.0 (if possible in a specified x-y range0. The Nsolve standard routines do not seem to work in this case. Can anyone help? Thanks in advance.