Re: FindMinimum
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg257] Re: [mg242] FindMinimum
- From: Jerry Keiper <keiper>
- Date: Thu, 1 Dec 1994 09:08:36 -0600
> A colleague of mine is having trouble with FindMinimum. When minimizing a > function, FindMinimun tries to evaluate the function outside the bounds > set. This in turn causes Mathematica to more or less hang, since the > function to minimize is not well behaived outside the specified interval. > Any suggestions? Yes, simply define the function outside the specified interval to be well behaved and huge. For example: f[x_] := x^2 + Sqrt[100 - x^2] This function is very nice between -10 and 10, but is not real outside that interval. So use instead the function f[x_] := 1000000000000000000000 Abs[x] /; Abs[x] >= 10 f[x_] := x^2 + Sqrt[100 - x^2] In[5]:= FindMinimum[Print[x]; f[x], {x, 200, 300}] 200. 203.136 198.062 196.864 188.479 181.358 169.837 151.195 121.032 72.2272 -6.74066 -559.516 -217.882 -87.3895 -6.74066 -37.5458 23.4224 -3.5226 -3.5226 -5.13163 6.76947 -3.8581 0.119591 0.119591 0.0121442 -0.000110698 0.000147675 -0.000110698 -12 -3.59432 10 -12 Out[5]= {10., {x -> -3.59432 10 }} Jerry B. Keiper keiper at wri.com Wolfram Research, Inc.