Re: FindRoot with a vector of unknowns
- To: mathgroup at smc.vnet.net
- Subject: [mg125095] Re: FindRoot with a vector of unknowns
- From: Ray Koopman <koopman at sfu.ca>
- Date: Tue, 21 Feb 2012 06:13:45 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <jhqmed$f70$1@smc.vnet.net>
On Feb 19, 3:29 am, Sam Takoy <sam.ta... at yahoo.com> wrote:
> Hi,
>
> Is there an elegant way to implement what I am trying to do here,
> that is, solve for a vector of unknowns:
>
> FindRoot[x - {1, 2, 3} == {0, 0, 0}, {x, {1, 1, 1}}]
>
> I can do this writing a loop, but hoping for a "vectorized" solution.
>
> Thanks,
>
> Sam
I usually use different symbols for the vector and its elements.
In[1]:= Clear[x]; X = Array[x,3];
FindRoot[X - {1,2,3} == {0,0,0}, Thread@{X,1}]
Out[2]= {x[1] -> 1., x[2] -> 2., x[3] -> 3.}