Re: Using FindRoot on a numerical vector-valued function
- To: mathgroup at smc.vnet.net
- Subject: [mg41136] Re: [mg41123] Using FindRoot on a numerical vector-valued function
- From: Selwyn Hollis <selwynh at earthlink.net>
- Date: Mon, 5 May 2003 02:41:36 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Without more information, I see no reason why FindRoot[F[y1, y2, y3], {y1, -1, 1}, {y2, -1, 1}, {y3, -1, 1}] shouldn't work. For example, this seems to be something like you describe, and it works fine: f[x_, y_, z_] := {NIntegrate[Sin[t^3],{t,0,x}] - y, y - z + (t /. FindRoot[ Sin[t] - Cos[z] + .1y, {t, x}]), x^2 + y^2 + z^2 - 1}; FindRoot[f[x, y, z], {x, 0, 1}, {y, 0, 1}, {z, 0, 1}] {x -> 0.600056, y -> 0.0323114, z -> 0.799305} Can you give us more information about your function F? What kind of "object" does it compute, and what kind of "components" are you talking about? ----- Selwyn Hollis http://www.math.armstrong.edu/faculty/hollis On Sunday, May 4, 2003, at 03:55 AM, Randall Beer wrote: > Suppose I have a function F that takes N arguments and returns a > length-N vector: F[1,2,3] => {-1.1,2.08,0.03}. This function involves > numerically computing an object and then returning certain components > of > that object, so it cannot be expanded with symbolic arguments (e.g., > F[x,y,z] will not work). > > I need to find the arguments that make F return a vector of all 0s. > That is, I would like to do something like: > > FindRoot[F[y1, y2, y3], {y1, -1, 1}, {y2, -1, 1}, {y3, -1, 1}] > > Unfortunately, this doesn't work because FindRoot wants 3 things, not a > function returnning a vector of 3 things > > I could do > > FindRoot[{F1[y1, y2, y3] == 0, F2[y1, y2, y3] == 0, F3[y1, y2, y3] == > 0}, . . .] > > but then I would have to numerically recompute the object 3 times. > > > Any suggestions would be greatly appreciated. >