MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

solving vector equations in mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34356] solving vector equations in mathematica
  • From: Hal Daume III <hdaume at isi.edu>
  • Date: Thu, 16 May 2002 05:08:44 -0400 (EDT)
  • Organization: University of Southern California
  • Sender: owner-wri-mathgroup at wolfram.com

Hi All,

I'm somewhat new to mathematica, at least in the world of vectors, and
I'm having trouble getting it to solve an equation for me.  

I basically want to solve:

\sum_{i=1}^n x_i = 0

for x_k

I tried:

Solve[Sum[x[[i]],{i,1,5}] == 0, x[[2]]]

as an example, but mathematica complains:

In[118]:= Solve[Sum[w[[i]],{i=1,5}] == 0, w[[1]]]

Sum::write: Tag Set in i = 1 is Protected.

Part::partd: Part specification w[[1]] is longer than depth of object.

Part::partd: Part specification w[[1]] is longer than depth of object.

Part::partd: Part specification w[[1]] is longer than depth of object.

General::stop: Further output of Part::partd
     will be suppressed during this calculation.

Out[118]= {{w[[1]] -> 0}}

I'm not exactly sure what this means.

I could write it out:

In[119]:= Solve[w1+w2+w3+w4+w5==0, w1]

Out[119]= {{w1 -> -w2 - w3 - w4 - w5}}

But this isn't very helpful in my situation (my equations are huge*), and
doesn't reflect the vector quality of the situation.

If such a thing is possible, I'd appreciate some pointers (I read the
mathematica docs on the wolfram site, but couldn't find anything talking
about this).

Thanks!

 - Hal

* the equation i'm working with is something like:

sum_{C,x,y,y'} (wx . wy) (wx . wy') (|wx * wy'| (wx . wy) - |wx * wy| (wx
. wy')) / (|wx|^4 |wy|^2 |wy'|^2) == 0

where 

  .   is dot product
  *   is cross product
  |x| is magnitude of x
and
  for vectors w=<w1,w2,...,wn>, x=<x1,x2,...,xn>,
  wx = <w1*x1,w2*x2,...,wn*xn>

Thanks again.

--
Hal Daume III

 "Computer science is no more about computers    | hdaume at isi.edu
  than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume



  • Prev by Date: RE: how mathematica deals with complex i in output
  • Next by Date: Re: ValueQ
  • Previous by thread: integrating matlab compiled code into Mathematica
  • Next by thread: Re: solving vector equations in mathematica