Re: Root search on results of minimization with free
- To: mathgroup at smc.vnet.net
- Subject: [mg114796] Re: Root search on results of minimization with free
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Fri, 17 Dec 2010 03:29:55 -0500 (EST)
- Reply-to: hanlonr at cox.net
example[c_, x_] = x^2 + c/2; f[c_?NumericQ] := NMinimize[example[c, x], x][[1]]; FindRoot[f[c] == 0, {c, 14}] {c -> 0.} Bob Hanlon ---- "Philipp Wei=C3=9Fgraeber" <weissgraeber at fsm.tu-darmstadt.de> wrote: ============= Hello all! I have a function f which is for example the result of a minimization with respect to x. It still depends on a parameter c. Now I want to find the root (or minima or whatever) of the the function f with respect to c. This seems does not work. I always get the errors "NMinimize::nnum: Function value is not a number" resp. "FindRoot::nlnum: The function value is not a list of numbers" Example: example[c_, x_] = x^2 + c/2; f[c_] := NMinimize[example[c, x], x][[1]]; FindRoot[f[c] == 0, {c, 14}] How can I implement this? My original problem is of course of more complex nature, but it boils down to this. Thank you Philipp