Re: Solve Function
- To: mathgroup at smc.vnet.net
- Subject: [mg44958] Re: Solve Function
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Thu, 11 Dec 2003 05:28:04 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <br6oqv$2lb$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi, type f[x_] := Table[x[i], {i, 1, 4}] g[x_] := Table[x[i]^2, {i, 1, 4}] Solve[f[x] == g[x], Table[x[i], {i, 1, 4}]] and see what Mathematica reply .. Regards Jens Gregory Lypny wrote: > > Hello Everyone, > > I've got a question about the Solve function. I read in the > Mathematica Book that Solve can handle a set of simultaneous equations > (page 88) and that the syntax for the function is to list each equation > followed by the variables to solve for. What if all of the equations > have the same form, say, because they're constraints in the first-order > conditions of an optimization? I'm wondering whether Solve can handle > a neater specification in matrix form, something along the lines of > > Solve[f[x]==g[x], x], > > where x is a vector of variables {x1, x2, x3, ... , xn}. It would save > a lot of typing. I've tried to feed solve a variable defined as an > array, but I keep getting errors to the effect that the equation is not > well formed. > > Greg