I am discovering the Physics:-Vectors Package a bit, and as an example i wanted to calculae the Tensor of moments of inertia I, for a continuous mass disribution.
Maple Help contains an Example-Worksheet on the Physics:-Vectors Package, that also contains calculating some Inertia-Tensor I, but for a discrete mass distribution. The formular there is entered as follows:
> restart; with(Physics, KroneckerDelta): with(Physics:-Vectors): Setup(mathematicalnotation = true);
> InertiaTensor := Sum(m[k] * (Norm(r_[k])^2 * kd_[i,j] - Component(r_[k], i)*Component(r_[k], j)), k=1..N);
So it's written in a very elegant way, with indices, and the Delta, just as you also find this Formula in the physics books. I thought now, when i want the Formula now for a continuous mass distribution, i just substitute an tripple Integral over x,y,z instead of the Sum over [k], and a mass density instead of the mass. Befor i defined r_ as the vector (x,y,z):
(i,j,k are the unit vectors in x,y,z direction in the Physics:-Vectors package)
> r_ := x _i + y _j + z _k;
> In := int(int(int(Dichte*r_.r_)*kd_[i, j] - Component(r_, i)*Component(r_, j), x = 0 .. a), y = 0 .. a), z = 0 .. a)));
But when executing this i get the ERROR:
Error, (in Component) first argument is not a vector
It has it's roots in the 2nd Term withe the "Component(r_, i)*Component(r_, j)". When I put numbers (1,2 or 3) instead of i and j it works fine, but it doesn't seem to like a variable there, which is strange, because it doesn't have a Problem with that, when it is in a Sum, instead of an Integral.
Anyone knows what i am doing wrong, or how i could do better?
thx for Help :)