Vector algebra and some other things



On 2/18/07, Todor Kondic <dolichenus at gmail.com> wrote:
>
> 1) is it possible to just declare variables as e.g 3-dim vectors and
> then, without further specification, if I use some kind of a scalar
> product on these variables (e.g a . b), i get a1b1+a2b2+a3b3 expansion
> right away?


I don't think there is a built-in way to consider a to represent
[a[1],a[2],a[3]], but you can easily set this up yourself:

       a: makelist(a[i],i,1,3)$
       b: makelist(b[i],i,1,3)$
or even
      make3vec(v) := v :: makelist(v[i],i,1,3)$         (just be sure not to
give "v" itself a value)
      map(make3vec,[a,b,c,d,e])$

If you want to re-assign a, you must first kill it (don't ask), so if you
are writing a batch script, it should look like:

      kill(a,b,c,d,e)$
      make3vec(v) := v :: makelist(v[i],i,1,3)$
      map(make3vec,[a,b,c,d,e])$


2) in addition, if you work with expressions which contain some vector
> algebra, would you use matrix form for such quantities, or just use
> the "vect" package (which I did not find really useful, but I might be
> missing something)?
>

The vect package is intended to be the way to deal with symbolic vector
calculations.  I'm afraid I'm not an expert on it, though.

               -s