Question: Problem with TransformCoordinates

Hello.
Have a question for use Physics[TransformCoordinates] . For example, in a Cartesian coordinate system is an arbitrary tensor. As you know, in this case the covariant, contravariant and mixed components are the same. We have a coordinate transformation such as transforming our Cartesian coordinate system in the oblique coordinate system. In this simple example, correctly calculated the covariant, contravariant and mixed components (structure: covariant and contravariant), but other mixed components (structure: contravariant and covariant) are calculated is not correct. I checked by hand.



restart

with(Physics):

Setup(mathematicalnotation = true):

ds := dx[1]^2+dx[2]^2+dx[3]^2:

Setup(coordinates = (X = [x[1], x[2], x[3]]), dimension = 3, metric = ds, spacetimeindices = lowercaselatin, quiet):

g_[]:

A[a, b] = Matrix(3, 3, {(1, 1) = 2, (1, 2) = 1, (1, 3) = 3, (2, 1) = 2, (2, 2) = 3, (2, 3) = 4, (3, 1) = 1, (3, 2) = 2, (3, 3) = 1})

A[a, b] = (Matrix(3, 3, {(1, 1) = 2, (1, 2) = 1, (1, 3) = 3, (2, 1) = 2, (2, 2) = 3, (2, 3) = 4, (3, 1) = 1, (3, 2) = 2, (3, 3) = 1}))

(1)

Define(%):

`Defined objects with tensor properties`

(2)

A[]

A[a, b] = (Matrix(3, 3, {(1, 1) = 2, (1, 2) = 1, (1, 3) = 3, (2, 1) = 2, (2, 2) = 3, (2, 3) = 4, (3, 1) = 1, (3, 2) = 2, (3, 3) = 1}))

(3)

A[`~`]

A[`~a`, `~b`] = (Matrix(3, 3, {(1, 1) = 2, (1, 2) = 1, (1, 3) = 3, (2, 1) = 2, (2, 2) = 3, (2, 3) = 4, (3, 1) = 1, (3, 2) = 2, (3, 3) = 1}))

(4)

A[`~a`,b,matrix]

A[`~a`, b] = (Matrix(3, 3, {(1, 1) = 2, (1, 2) = 1, (1, 3) = 3, (2, 1) = 2, (2, 2) = 3, (2, 3) = 4, (3, 1) = 1, (3, 2) = 2, (3, 3) = 1}))

(5)

A[`a`,~b,matrix]

A[a, `~b`] = (Matrix(3, 3, {(1, 1) = 2, (1, 2) = 1, (1, 3) = 3, (2, 1) = 2, (2, 2) = 3, (2, 3) = 4, (3, 1) = 1, (3, 2) = 2, (3, 3) = 1}))

(6)

[y[1] = x[1]-x[2], y[2] = x[2]-x[3], y[3] = x[3]]

[y[1] = x[1]-x[2], y[2] = x[2]-x[3], y[3] = x[3]]

(7)

solve((7), {x[1], x[2], x[3]})

{x[1] = y[1]+y[2]+y[3], x[2] = y[2]+y[3], x[3] = y[3]}

(8)

OK

B[a,b] = TransformCoordinates((8), A[a, b], [y[1], y[2], y[3]], [x[1], x[2], x[3]], simplifier = `@`(`simplify/size`, simplify))

B[a, b] = (Matrix(3, 3, {(1, 1) = 2, (1, 2) = 3, (1, 3) = 6, (2, 1) = 4, (2, 2) = 8, (2, 3) = 15, (3, 1) = 5, (3, 2) = 11, (3, 3) = 19}))

(9)

OK

C[a,b] = TransformCoordinates((8), A[~a,~b], [y[1], y[2], y[3]], [x[1], x[2], x[3]], simplifier = `@`(`simplify/size`, simplify))

C[a, b] = (Matrix(3, 3, {(1, 1) = 2, (1, 2) = -1, (1, 3) = -1, (2, 1) = 0, (2, 2) = -2, (2, 3) = 3, (3, 1) = -1, (3, 2) = 1, (3, 3) = 1}))

(10)

OK

D[a,b] = TransformCoordinates((8), A[a,~b], [y[1], y[2], y[3]], [x[1], x[2], x[3]], simplifier = `@`(`simplify/size`, simplify))NULL

D[a, b] = Matrix(%id = 4452149890)

(11)

Bug

E[a, b] = TransformCoordinates((8), A[~a,b], [y[1], y[2], y[3]], [x[1], x[2], x[3]], simplifier = `@`(`simplify/size`, simplify))NULLNULL

E[a, b] = Matrix(%id = 4452139458)

(12)

should be

LinearAlgebra:-Transpose(rhs((12)))

Matrix(3, 3, {(1, 1) = 0, (1, 2) = -2, (1, 3) = -3, (2, 1) = 1, (2, 2) = 2, (2, 3) = 5, (3, 1) = 1, (3, 2) = 3, (3, 3) = 4})

(13)

``



Download Transformation_tensor_components.mw

Please Wait...