Re: optimization nested in root-finding
- To: mathgroup at smc.vnet.net
- Subject: [mg64998] Re: [mg64984] optimization nested in root-finding
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sat, 11 Mar 2006 05:15:33 -0500 (EST)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
obj2[x_,y_]:=(x-2)^2+(y-3)^2; f2[x_?NumericQ]:=Module[{y},FindMinimum[obj2[x,y],{y,0}][[1]]]; FindRoot[f2[x]==5,{x,3,5}] {x -> 4.23606797749979} Bob Hanlon > > From: "E. Neely Atkinson" <eatkinso at mdanderson.org> To: mathgroup at smc.vnet.net > Subject: [mg64998] [mg64984] optimization nested in root-finding > > I want to find some zeros of a function f(x). The evaluation of > f in turn requires finding a minimum. For a simple example. > > obj2[x_, y_] := (x - 2)^2 + (y - 3)^2 > > f2[x_] := > Module[ > {y}, > FindMinimum[obj2[x, y], {y, 0}][[1]] > ] > > Thus, f2[x] is the minimum value obj[x,y] can take for a > given fixed x. > > Now, I can plot f2[x] and all is well. However, when > I try to solve f2[x]==5, I have trouble. > > FindRoot[f2[x] == 5, {x, 1, 1.01}] > > complains and returns. I am sure I am doing something silly, > but I am having a slow-brain day and would appreciate any help. > > Neely Atkinson > Department of Biostatistics and Applied Mathematics > M. D. Anderson Cancer Center > > eatkinso at mdanderson.org > >