Items tagged with tensor

Feed
Also available: tensor

Hi guys ,

i computed a tensorial term with respect to a metric and i think i made mistake !! what do you think ?

problem.mw

Best Regards

 

 

This might be considered nit-picking, but nonetheless I think there is an issue: The metric tensor and its inverse are types (0,2) and (2,0) tensors, respectively. When once contracted with each other, the result is the Kronecker delta, which is then (necessarily) a tensor of type (1,1). I am therefore surprised to find that in Maple, this Kronecker delta is implemented as a type (0,2) tensor, via the command KroneckerDelta:

KroneckerDelta[mu,nu];

I don't think this makes any proper sense. I think that such an object of type (0,2) is, in fact, the metric itself. On a similar note, the (mixed tensor type) objects g_[mu,~nu] and g_[~mu,nu] are actually both Kronecker deltas, because they correspond to the metric having one index raised by contraction with the inverse metric itself. But, nonetheless, the following is the case:

g_[ mu,~nu],
g_[~mu, nu];

Relatedly, consider the following single contraction of the metric with its own inverse:

SumOverRepeatedIndices(g_[mu,nu]*g_[~nu,~sigma]);

Although this sum is formally quite correct, I think it should be given as just a Kronecker delta (of the correct mixed tensor type, that is).

A lot of efforts I performed to obtained the right results, somehow I remain sucessful but the results are not exactly same as expected. I request you to kindly see at the christoffel symbol. I also sent the right results.

some_mistakes_in_christoffel.mw

you can see the right results in the given below attachment

right_christoffel_symbols.pdf

as you can comprare the results of both file. the obtain crystoffel are not same as the requied.

How can we find ricci tensor of a metric attaced in given file that involve two unknown functions phi(r) and nu(r).metric.mw

I attempt to understand is it possible whether to calculate the next expression by means of mathematica:

where

{,}- anti-communicator;

 a=0,1,2,3;

\tau^{0}-unity matrix; \tau^{i} - Pauli matrix;

and:
 

 

 


 
finally - Levi-Civita symbol; -Hermitian conjugation.

 

Thank you for your kind replies .

Dear All

I calculate something with gr tensor, for example Ricciscalar. How can I save it in maple memory? As you know, in this situation you can not use your calculation directly and it seems that it saved in grtensor memory not maple memory. For example, if you want to plot Ricciscalar, you should save it as a new definition in maple and then plot it. 

Thank you.

Here's a short tensor manipulation which goes totally bananas. Basically I have a metric, and I define a vector k, and right at the end I calcualte the covariant derivative of it. In the metric and elsewhere I have a constant epsilon, a function of time a(t), and 2 functions of all coords, Phi and psi. Then at the end it gives the covariant derivative of k, but now with epsilon and a as functions of all coordinates. 

Any idea what's going on??

 

code:

 

restart;
with(Physics);with(PDEtools):
Setup(coordinatesystems=spherical);

ds2:=expand(a(t)^2*(-(1+2*epsilon*Phi(r,theta,phi,t))*dt^2+(1-2*epsilon*psi(r,theta,phi,t))*(dr^2+r^2*dtheta^2+r^2*sin(theta)^2*dphi^2)));
declare(%,(H)(t),(k0,k1,k2,k3)(X));
Setup(metric = ds2);

Define(k[~mu]=[-1/a(t)^2+epsilon*k1(X),epsilon*k2(X),epsilon*k3(X),1/a(t)^2+epsilon*k0(X)]);

Define(NullGDE[nu]=(k[~mu](X)*D_[mu](k[nu](X))),OpticalDeformationMatrix[mu,nu]=(D_[mu](k[nu](X))));

(OpticalDeformationMatrix[1,1,nonzero]);

 

the final output is Matrix(1, 1, [[(-(2*((diff(epsilon(X), r))*(psi(X))(X))+2*epsilon(X)*(diff((psi(X))(X), r)))*(epsilon(X)*(k1(X))(X)*((a(t))(X)^2)-1)*a(t)-(2*epsilon(X)*(psi(X))(X)-1)*((diff(epsilon(X), r))*(k1(X))(X)*((a(t))(X)^2)+epsilon(X)*((diff((k1(X))(X), r))*((a(t))(X)^2))+2*epsilon(X)*(k1(X))(X)*(a(t))(X)*(diff((a(t))(X), r)))*a(t)+epsilon*psi[r]*(epsilon*k1(X)*(a(t)^2)-1)*a(t)-epsilon^2*psi[theta]*(a(t)^3)*k2(X)-epsilon^2*psi[phi]*(a(t)^3)*k3(X)-(2*(diff(a(t), t))*psi(X)*epsilon+psi[t]*a(t)*epsilon-(diff(a(t), t)))*(epsilon*k0(X)*(a(t)^2)+1))*(1/a(t))]])

where epsilon is now a function!

 

 

 

Hi

We know determinant of a square matrix A[ij] (i,j ∈ {1,2,3}) is equal to the following expression

det(A) = 1/6 * e[ijk] * e[pqr] * A[ip] * A[jq] * A[kr] 

in which e[ijk] is a third order Tensor (Permutation notation or Levi-Civita symbol) and has a simple form as follows:

e[mnr] = 1/2 * (m-n) * (n-r) * (r-m).

The (i,j) minor of A, denoted Mij, is the determinant of the (n − 1)×(n − 1) matrix that results from deleting row i and column j of A. The cofactor matrix of A is the n×n matrix C whose (i, j) entry is the (i, j) cofactor of A,

C[ij]= -1 i+j * M[ij]

A-1=CT/det(A)

The general form of Levi-Civita symbol is as bellow:

 

I want to write a program for finding inverse of (NxN) matrix:

N=2 →

restart;
N := 2:
with(LinearAlgebra):
f := (1/2)*(sum(sum(sum(sum((m-n)*(p-q)*A[m, p]*A[n, q], q = 1 .. 2), p = 1 .. 2), n = 1 .. 2), m = 1 .. 2)):
A := Matrix(N, N, proc (i, j) options operator, arrow; evalf((37*i^2+j^3)/(2*i+4*j)) end proc):
f/Determinant(A);

N=3 →

restart;
N := 3:
with(LinearAlgebra):
f := (1/24)*(sum(sum(sum(sum(sum(sum((m-n)*(n-r)*(r-m)*(p-q)*(q-z)*(z-p)*A[m, p]*A[n, q]*A[r, z], m = 1 .. N), n = 1 .. N), r = 1 .. N), p = 1 .. N), q = 1 .. N), z = 1 .. N)):
A := Matrix(N, N, proc (i, j) options operator, arrow; 10*i^2/(20*i+j) end proc):
f/Determinant(A);

The results of above programs are equal to 1 and validation of method is observed.

If we can write the general form of determinant then we can find the inverse of any square non-singular matrices.

Now I try to write the mentioned program.

restart;
with(linalg):
N := 7:
Digits := 40:
e := product(product(signum(a[j]-a[i]), j = i+1 .. N), i = 1 .. N):
ML := product(A[a[k], b[k]], k = 1 .. N):
s[0] := e*subs(`$`(a[q] = b[q], q = 1 .. N), e)*ML:
for i to N do
s[i] := sum(sum(s[i-1], a[i] = 1 .. N), b[i] = 1 .. N)
end do:
A := Matrix(N, N, proc (i, j) options operator, arrow; evalf((3*i+j)/(i+2*j)) end proc): # arbitrary matrix
CN:=simplify(s[N]/det(A));

Therefore det(A)= CN-1 * e[a1,a2,..an] * e [b1,b2,.., bn] * A[a1,b1] * A[a2,b2] * ... * A[an,bn].

The correction coefficient is CN(for N)/CN(for N-1) = N!/(N-1)! =N.

restart:
with(linalg): N := 4: Digits := 20:
e := product(product(signum(a[j]-a[i]), j = i+1 .. N), i = 1 .. N):
ML := product(A[a[k], b[k]], k = 1 .. N):
s[0] := e*subs(`$`(a[q] = b[q], q = 1 .. N), e)*ML:
for r to N do s[r] := sum(sum(s[r-1], a[r] = 1 .. N), b[r] = 1 .. N) end do:
A := Matrix(N, N, proc (i, j) options operator, arrow; evalf((3*i+2*j)/(i+2*j)) end proc):
DET:=S[N]:
for x to N do for y to N do
e := product(product(signum(a[j]-a[i]), j = i+1 .. N-1), i = 1 .. N-1):
ML := product(AA[a[k], b[k]], k = 1 .. N-1):
S[0, x, y] := e*subs(`$`(a[q] = b[q], q = 1 .. N-1), e)*ML:
for r to N-1 do S[r, x, y] := sum(sum(S[r-1, x, y], a[r] = 1 .. N-1), b[r] = 1 .. N-1) end do:
f[y, x] := (-1)^(x+y)*subs(seq(seq(AA[t, u] = delrows(delcols(A, y .. y), x .. x)[t, u], t = 1 .. N-1), u = 1 .. N-1), S[N-1, x, y])
end do: end do:
Matrix(N, N, f)/(DET)*(24/6);
A^(-1);

CN for N=4 and N=3 is 24 and 6 respectively i.e. CN(4)/CN(3)=24/6.

When I use bellow procedure the error "(in S) bad index into Matrix" is occurred.

Please help me to write this algorithm by using procedure.

Thank you 

restart; with(linalg): Digits := 40: n := 7:
S := proc (N) local e, ML, s, i:
e := product(product(signum(a[j]-a[i]), j = i+1 .. N), i = 1 .. N):
ML := product(A[a[k], b[k]], k = 1 .. N):
s[0] := e*subs(`$`(a[q] = b[q], q = 1 .. N), e)*ML:
for i to N do s[i] := sum(sum(s[i-1], a[i] = 1 .. N), b[i] = 1 .. N) end do
end proc:
A := Matrix(n, n, proc (i, j) options operator, arrow; evalf((3*i+j)/(i+2*j)) end proc): # arbitrary matrix
CN := simplify(S(n)/det(A))

I need to create n-order tensor filled with any symbolic variable, for exemple 'x', but "symbol" option works only on vectors and matrix, so i don't know how to do that on n-order array.

X := Vector(3, symbol = x);#------ Work
Matrix(3, 3, symbol = x);#------ Work


Array(1 .. 3, 1 .. 3, 1 .. 3, symbol = x);
Error, argument `symbol = x` is incorrect or out of order

And 2nd problem thet globaly i need to create symmetric n-order tensor with symmitry for any pair of index and with contraction for any couple of indexes equal to zero. As i understend i need to create a big list of equations for every individual pair of index and 2 conditions (contraction and symmitry) and solve it to get a match and combination of independent index and paste values in them?

 

greatings all,

I want to calculate energy momentum tensor for a given metric. is it possible to calculate it in the physics package?
thanks.

@ecterrab 


hello dear,

was working with tensor package using debever formalism in maple v release 5 and got this problem, 
Error, (in factor) expecting a polynomial over an algebraic number field. would u tell me how to deal with this error in maple v release 5. aprl12.mws
thanks,
suresh

I need to calculate Weyl scalar for a metric using null tetrad using debever package in maple 13. However, I am stuck at the defination of h (representing the covariant complex null tetrad). Is it the product of covariant null tetrad? I have worked it out by using covariant, contravariant and both covariant and contravariant null tetrad (like l_a*l_a, l^a*l^a, l_a*l^a), however, i am not getting the right result not even for the example given in the maple help for plane wave. please help me out that how should i define this h.

thanks,
suresh

Hi,

what i have to calculate in Maple for q=Mises-Stress and the third invariant of deviatoric stress as r???

It is for:

Link:
http://www.egr.msu.edu/software/abaqus/Documentation/docs/v6.7/books/stm/default.htm?startat=ch04s04ath116.html

 

 

I am trying to use the Define() funtion for the tetrad form of the Ricci Tensor. I use the Setup() function to define the tetradmetric and the tetrad labels. However, the function continues do some strange things with the d_ . It should be just a simple sum over the repeated indices, but I am getting imaginary terms.

 

  restart; with(Physics); with(Tetrads)

0, "%1 is not a command in the %2 package", Tetrads, Physics

(1)

Physics:-Setup(coordinatesystems = {X}, spacetimeindices = greek, tetradindices = lowercaselatin, tetradmetric = Matrix([[0, 1, 0, 0], [1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]], shape = symmetric), mathematicalnotation = true)

[coordinatesystems = {X}, mathematicalnotation = true, spacetimeindices = greek, tetradindices = lowercaselatin, tetradmetric = {(1, 2) = 1, (3, 4) = 1}]

(2)

Physics:-Define(GammaT[a, b, c], RicciT[b, c] = -%d_[c](GammaT[`~a`, b, a])+%d_[a](GammaT[`~a`, b, c])-Physics:-`*`(GammaT[`~m`, b, a], GammaT[`~a`, m, c])+Physics:-`*`(GammaT[`~m`, b, c], GammaT[`~a`, m, a])-Physics:-`*`(GammaT[`~a`, b, m], GammaT[`~m`, c, a]-GammaT[`~m`, a, c]))

{Physics:-Dgamma[mu], GammaT[a, b, c], Physics:-Psigma[mu], RicciT[b, c], Physics:-d_[mu], Physics:-Tetrads:-eta_[a, b], Physics:-g_[mu, nu], Physics:-Tetrads:-l_[mu], Physics:-Tetrads:-m_[mu], Physics:-Tetrads:-mb_[mu], Physics:-Tetrads:-n_[mu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(3)

RicciT[1, 2]

-%d_[2](GammaT[`~1`, 1, 1]+GammaT[`~2`, 1, 2]+GammaT[`~3`, 1, 3]+GammaT[`~4`, 1, 4])-GammaT[`~1`, 1, 3]*GammaT[`~3`, 2, 1]-GammaT[`~3`, 1, 3]*GammaT[`~3`, 2, 3]-GammaT[`~4`, 1, 3]*GammaT[`~3`, 2, 4]+GammaT[`~4`, 1, 2]*GammaT[`~1`, 4, 1]+GammaT[`~4`, 1, 2]*GammaT[`~3`, 4, 3]+GammaT[`~4`, 1, 2]*GammaT[`~4`, 4, 4]+GammaT[`~1`, 1, 2]*GammaT[`~3`, 1, 3]+GammaT[`~1`, 1, 2]*GammaT[`~4`, 1, 4]+GammaT[`~2`, 1, 2]*GammaT[`~1`, 2, 1]+GammaT[`~2`, 1, 2]*GammaT[`~3`, 2, 3]+GammaT[`~2`, 1, 2]*GammaT[`~4`, 2, 4]+GammaT[`~3`, 1, 2]*GammaT[`~1`, 3, 1]+GammaT[`~3`, 1, 2]*GammaT[`~3`, 3, 3]+GammaT[`~3`, 1, 2]*GammaT[`~4`, 3, 4]-GammaT[`~1`, 1, 4]*GammaT[`~4`, 2, 1]-GammaT[`~3`, 1, 4]*GammaT[`~4`, 2, 3]-GammaT[`~4`, 1, 4]*GammaT[`~4`, 2, 4]-GammaT[`~1`, 1, 1]*GammaT[`~1`, 2, 1]-GammaT[`~3`, 1, 1]*GammaT[`~1`, 2, 3]-GammaT[`~4`, 1, 1]*GammaT[`~1`, 2, 4]-GammaT[`~1`, 1, 2]*GammaT[`~2`, 2, 1]-GammaT[`~3`, 1, 2]*GammaT[`~2`, 2, 3]-GammaT[`~4`, 1, 2]*GammaT[`~2`, 2, 4]-(1/2)*2^(1/2)*%d_[3](GammaT[`~2`, 1, 2])+(1/2)*2^(1/2)*%d_[3](GammaT[`~1`, 1, 2])+GammaT[`~2`, 3, 2]*GammaT[`~3`, 1, 2]+GammaT[`~2`, 4, 2]*GammaT[`~4`, 1, 2]+GammaT[`~1`, 1, 1]*GammaT[`~1`, 1, 2]+GammaT[`~1`, 1, 2]*GammaT[`~2`, 1, 2]-GammaT[`~1`, 2, 2]*GammaT[`~2`, 1, 1]-GammaT[`~2`, 1, 3]*GammaT[`~3`, 2, 2]-GammaT[`~2`, 1, 4]*GammaT[`~4`, 2, 2]+((1/2)*I)*2^(1/2)*%d_[1](GammaT[`~4`, 1, 2])-((1/2)*I)*2^(1/2)*%d_[4](GammaT[`~4`, 1, 2])+((1/2)*I)*2^(1/2)*%d_[1](GammaT[`~3`, 1, 2])+((1/2)*I)*2^(1/2)*%d_[4](GammaT[`~3`, 1, 2])+((1/2)*I)*2^(1/2)*%d_[2](GammaT[`~2`, 1, 2])+((1/2)*I)*2^(1/2)*%d_[2](GammaT[`~1`, 1, 2])

(4)

 

``

 

Download Problem_with_Defined_Tetrad_Function.mw

 

restart; with(Physics); with(Tetrads)

0, "%1 is not a command in the %2 package", Tetrads, Physics

(1)

Physics:-Setup(coordinatesystems = {X}, mathematicalnotation = true)

[coordinatesystems = {X}, mathematicalnotation = true]

(2)

Physics:-Define(Ybar[a], Y[a], GammaT[a, b, c], RicciT[b, c] = %d_[c](GammaT[`~a`, b, a])-%d_[a](GammaT[`~a`, b, c])+Physics:-`*`(GammaT[`~m`, b, a], GammaT[`~a`, m, c])-Physics:-`*`(GammaT[`~m`, b, c], GammaT[`~a`, m, a])+Physics:-`*`(GammaT[`~a`, b, m], GammaT[`~m`, c, a]-GammaT[`~m`, a, c]), RiemannT[k, l, m, n] = %d_[k](GammaT[m, n, l])-%d_[l](GammaT[m, n, k])+Physics:-`*`(GammaT[`~a`, m, l], GammaT[a, n, k])-Physics:-`*`(GammaT[`~a`, m, k], GammaT[a, n, l])+Physics:-`*`(GammaT[m, n, a], GammaT[`~a`, k, l]-GammaT[`~a`, l, k]))

RicciT[1, 3]

%d_[3](GammaT[`~1`, 1, 1]+GammaT[`~2`, 1, 2]+GammaT[`~3`, 1, 3]+GammaT[`~4`, 1, 4])+GammaT[`~4`, 1, 2]*GammaT[`~2`, 3, 4]+GammaT[`~1`, 1, 3]*GammaT[`~3`, 3, 1]+GammaT[`~2`, 1, 3]*GammaT[`~3`, 3, 2]+GammaT[`~4`, 1, 3]*GammaT[`~3`, 3, 4]-GammaT[`~2`, 1, 3]*GammaT[`~1`, 2, 1]-GammaT[`~2`, 1, 3]*GammaT[`~2`, 2, 2]-GammaT[`~2`, 1, 3]*GammaT[`~4`, 2, 4]-GammaT[`~3`, 1, 3]*GammaT[`~1`, 3, 1]-GammaT[`~3`, 1, 3]*GammaT[`~2`, 3, 2]-GammaT[`~3`, 1, 3]*GammaT[`~4`, 3, 4]-GammaT[`~4`, 1, 3]*GammaT[`~1`, 4, 1]-GammaT[`~4`, 1, 3]*GammaT[`~2`, 4, 2]-GammaT[`~4`, 1, 3]*GammaT[`~4`, 4, 4]-GammaT[`~1`, 1, 3]*GammaT[`~2`, 1, 2]-GammaT[`~1`, 1, 3]*GammaT[`~4`, 1, 4]+GammaT[`~1`, 1, 4]*GammaT[`~4`, 3, 1]+GammaT[`~2`, 1, 4]*GammaT[`~4`, 3, 2]+GammaT[`~4`, 1, 4]*GammaT[`~4`, 3, 4]+GammaT[`~1`, 1, 1]*GammaT[`~1`, 3, 1]+GammaT[`~2`, 1, 1]*GammaT[`~1`, 3, 2]+GammaT[`~4`, 1, 1]*GammaT[`~1`, 3, 4]+GammaT[`~1`, 1, 2]*GammaT[`~2`, 3, 1]+GammaT[`~2`, 1, 2]*GammaT[`~2`, 3, 2]+GammaT[`~1`, 3, 3]*GammaT[`~3`, 1, 1]+GammaT[`~2`, 3, 3]*GammaT[`~3`, 1, 2]+GammaT[`~3`, 1, 4]*GammaT[`~4`, 3, 3]-GammaT[`~3`, 4, 3]*GammaT[`~4`, 1, 3]-GammaT[`~1`, 1, 1]*GammaT[`~1`, 1, 3]-GammaT[`~1`, 1, 3]*GammaT[`~3`, 1, 3]-GammaT[`~2`, 1, 3]*GammaT[`~3`, 2, 3]-%d_[4](GammaT[`~4`, 1, 3])+%d_[1](GammaT[`~1`, 1, 3])+%d_[3](GammaT[`~3`, 1, 3])+%d_[2](GammaT[`~2`, 1, 3])

(3)

for a to 4 do for b to 4 do RicciT[a, b] end do end do

Error, (in index/PhysicsTensor) expected summation indices of type symbol, received: 1

 

 

Now, if I type the RicciT from (3) it displays the same result. However,......

 

RicciT[1, 3]

%d_[3](GammaT[`~1`, 1, 1]+GammaT[`~2`, 1, 2]+GammaT[`~3`, 1, 3]+GammaT[`~4`, 1, 4])+GammaT[`~4`, 1, 2]*GammaT[`~2`, 3, 4]+GammaT[`~1`, 1, 3]*GammaT[`~3`, 3, 1]+GammaT[`~2`, 1, 3]*GammaT[`~3`, 3, 2]+GammaT[`~4`, 1, 3]*GammaT[`~3`, 3, 4]-GammaT[`~2`, 1, 3]*GammaT[`~1`, 2, 1]-GammaT[`~2`, 1, 3]*GammaT[`~2`, 2, 2]-GammaT[`~2`, 1, 3]*GammaT[`~4`, 2, 4]-GammaT[`~3`, 1, 3]*GammaT[`~1`, 3, 1]-GammaT[`~3`, 1, 3]*GammaT[`~2`, 3, 2]-GammaT[`~3`, 1, 3]*GammaT[`~4`, 3, 4]-GammaT[`~4`, 1, 3]*GammaT[`~1`, 4, 1]-GammaT[`~4`, 1, 3]*GammaT[`~2`, 4, 2]-GammaT[`~4`, 1, 3]*GammaT[`~4`, 4, 4]-GammaT[`~1`, 1, 3]*GammaT[`~2`, 1, 2]-GammaT[`~1`, 1, 3]*GammaT[`~4`, 1, 4]+GammaT[`~1`, 1, 4]*GammaT[`~4`, 3, 1]+GammaT[`~2`, 1, 4]*GammaT[`~4`, 3, 2]+GammaT[`~4`, 1, 4]*GammaT[`~4`, 3, 4]+GammaT[`~1`, 1, 1]*GammaT[`~1`, 3, 1]+GammaT[`~2`, 1, 1]*GammaT[`~1`, 3, 2]+GammaT[`~4`, 1, 1]*GammaT[`~1`, 3, 4]+GammaT[`~1`, 1, 2]*GammaT[`~2`, 3, 1]+GammaT[`~2`, 1, 2]*GammaT[`~2`, 3, 2]+GammaT[`~1`, 3, 3]*GammaT[`~3`, 1, 1]+GammaT[`~2`, 3, 3]*GammaT[`~3`, 1, 2]+GammaT[`~3`, 1, 4]*GammaT[`~4`, 3, 3]-GammaT[`~3`, 4, 3]*GammaT[`~4`, 1, 3]-GammaT[`~1`, 1, 1]*GammaT[`~1`, 1, 3]-GammaT[`~1`, 1, 3]*GammaT[`~3`, 1, 3]-GammaT[`~2`, 1, 3]*GammaT[`~3`, 2, 3]-%d_[4](GammaT[`~4`, 1, 3])+%d_[1](GammaT[`~1`, 1, 3])+%d_[3](GammaT[`~3`, 1, 3])+%d_[2](GammaT[`~2`, 1, 3])

(4)

 

If I type a different RicciT, then ...

 

RicciT[2, 3]

Error, (in index/PhysicsTensor) expected summation indices of type symbol, received: 1

 

 

The for loop is changing the tetrad definition of RicciT.

 

NULL

 

Download Question_about_tetrads_in_for_loop.mw

1 2 3 Page 1 of 3