itensor and vector norm (?)



I think your e-mail implies somewhat of a misunderstanding about the
intended purpose of the itensor and ctensor packages.

The itensor package is meant to be used when you do NOT know the components
of a tensor. In itensor, tensors are opaque objects; their components are
unknown, the metric is unknown, you have not chosen a system of coordinates.
What itensor knows is how to manipulate indexed objects.

If you actually know the components, you don't need either of the tensor
packages; Maxima can deal with vectors and matrices just fine. The ctensor
package adds a bunch of specific functions for dealing with tensors in a
non-rectilinear metric, but you can build the matrices just fine without
ctensor; you only need ctensor if, for instance, you wish to perform
covariant differentiation.

So in your case, I'd not use either of the tensor packages and just do
things the pedestrian way. Something along these lines:

X:matrix([x,y]);
r:mat_norm(X,frobenius);
H:1/(8*%pi*eta*r)*(ident(2)+transpose(X).X/r^2);
diff(1/r,X[1][1]);

I hope this helps.


Viktor




-----Original Message-----
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
On Behalf Of vputz at nyx.net
Sent: Wednesday, March 24, 2010 8:59 AM
To: maxima at math.utexas.edu
Subject: itensor and vector norm (?)

I'm trying to do some hydrodynamics calculations using the Oseen tensor,
and running into a little trouble trying to use itensor--was wondering
if folks could give some hints (or explain why/how ctensor would be
better, or not!).  I've worked through a few examples using itensor, but
progress is slow.

Anyway, the Oseen tensor is just an order-2 tensor; in cartesian
coordinates, it looks something like (using mushy pseudosyntax;
hopefully this makes sense)

H([i,j])= 1(8*pi*eta*|r|) * ( kdelta(i,j) + (r([i])*r([j])/(|r|^2))

(it relates the force applied to a point to the induced velocity in
low Reynolds number fluid at a position r away from the point, ie
u(x) = H(x).F)

So what I'm working on involves multipole expansions of this fellow, and 
I can't for the life of me figure out how to do taylor expansions or
derivatives using itensor.  In particular, the "vector norm" is giving
me issues.  I'm having real trouble putting it in a form that plays
nicely with derivatives, ie something where you could say
"diff( 1/|r|, r([k]) )".  The closest I've come is by something really
bastardized like

defcon(Ti);
inorm(x) := block( [m,n], m:idummy(), n:idummy(), 
   sqrt( x([m])*Ti([],[m,n])*x([n]) ) );

...using Ti to raise one index but leaving the basic expression such
that both indices are lowered and I can still "diff(inorm(x),x([k]))"
and get a result.

I've tried poking about with ctensor (since I'm using a cartesian
metric) but haven't worked out how ctensor works with vectors and the
kronecker product on the right (r([i])*r([j])).  If I can use itensor,
I'd like to (it seems more elegant for some things) but I can't figure this
norm
business for the life of me; been hacking at this a day and a half by
now.

Any suggestions?  I'm finally getting used to maxima for straightforward
algebra, but still find it pretty opaque for this sort of thing.

Thanks,
V. Putz

_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima