synred

20 Reputation

One Badge

13 years, 210 days

MaplePrimes Activity


These are replies submitted by synred

@tomleslie 

Much thanks. Your version works and is much clearer besides. It would never have occured to me to do this. Doesn't seem like I should have to, but whatever works.

I only have Maple 2018 (no access to newer versions), but that doesn't seem to be related.

@acer evalf was an attempt to fix the problem. I also took real part via Re though by construction it should be real. Numerical problem I guess. Still does not exlain why it works for some intervals but not others.

I will try your suggestions

Thanks!

@acer Thanks. That's exactly what I was trying to recall! 

Little luck trying to find it in documentation though it must be there somewhere!

@synred Thanks. You done the 'pain' for me. Thanks.

@ecterrab Vert nice. You seem to have done the conversion for me. Thanks!

@Carl Love Ok. Thanks. 

But how do I mulitply a Differential Geometry tensor? 

I see suuggestion I change to Physics, but at this point that would be a pain...

5*g5 gives the same result, so appaently it is using linear algbra inapproriately too...(Im inclined to call that a 'bug').

Ok. I think I got it done. Previous one may have worked to. Line 35 is multiply attempt. I uss DifferentialGeometry package.

with(DifferentialGeometry); with(Tensor); with(LinearAlgebra); with(Tools)

[`&MatrixAlgMult`, `&MatrixMinus`, `&MatrixMult`, `&MatrixPlus`, `&MatrixWedge`, CalculationHistory, CanonicalBasis, DGbiform, DGequal, DGform, DGinfo, DGmain, DGmap, DGmultivector, DGscalar, DGsimplify, DGtensor, DGvector, DGvolume, DGzero, Divergence, GenerateForms, IdentityTransformation]

(1)

DGsetup([x, y, z, t], M5)

`frame name: M5`

(2)
M5 > 

``

M5 > 

B := 1+dBdz*z+.5*d2Bdz2*z^2

1+dBdz*z+.5*d2Bdz2*z^2

(3)
M5 > 

exp(-2)

exp(-2)

(4)
M5 > 

B := -2*g*z+1

-2*g*z+1

(5)
M5 > 

B := exp(-2*g*z)

exp(-2*g*z)

(6)
M5 > 

B := (1+exp(-gz))^2

(1+exp(-gz))^2

(7)
M5 > 

B := 2*g*z+1

2*g*z+1

(8)
M5 > 

omega := evalDG(sqrt(B)*dt)

_DG([["form", M5, 1], [[[4], (2*g*z+1)^(1/2)]]])

(9)
M5 > 

g5 := evalDG(-`&t`(dx, dx)-`&t`(dy, dy)-`&t`(dz, dz)+`&t`(omega, omega))

_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 2*g*z+1]]])

(10)
M5 > 

``

M5 > 

h5 := InverseMetric(g5)

_DG([["tensor", M5, [["con_bas", "con_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 1/(2*g*z+1)]]])

(11)
M5 > 

g5

_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 2*g*z+1]]])

(12)
M5 > 

c := CurvatureTensor(g5)

_DG([["tensor", M5, [["con_bas", "cov_bas", "cov_bas", "cov_bas"], []]], [[[3, 4, 3, 4], -g^2/(2*g*z+1)], [[3, 4, 4, 3], g^2/(2*g*z+1)], [[4, 3, 3, 4], -g^2/(2*g*z+1)^2], [[4, 3, 4, 3], g^2/(2*g*z+1)^2]]])

(13)
M5 > 

``

M5 > 

g5

_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 2*g*z+1]]])

(14)
M5 > 

ct := CurvatureTensor(g5)

_DG([["tensor", M5, [["con_bas", "cov_bas", "cov_bas", "cov_bas"], []]], [[[3, 4, 3, 4], -g^2/(2*g*z+1)], [[3, 4, 4, 3], g^2/(2*g*z+1)], [[4, 3, 3, 4], -g^2/(2*g*z+1)^2], [[4, 3, 4, 3], g^2/(2*g*z+1)^2]]])

(15)
M5 > 

rc := RicciTensor(g5)

_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[3, 3], g^2/(2*g*z+1)^2], [[4, 4], -g^2/(2*g*z+1)]]])

(16)
M5 > 

l := DGinfo(ct, "CoefficientList", "all")

[-g^2/(2*g*z+1), g^2/(2*g*z+1), -g^2/(2*g*z+1)^2, g^2/(2*g*z+1)^2]

(17)
M5 > 

G300 := (1/2)*(diff(B, z))

g

(18)
M5 > 

d2zdt2 := -G300

-g

(19)
M5 > 

RicciTensor(c)

_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[3, 3], g^2/(2*g*z+1)^2], [[4, 4], -g^2/(2*g*z+1)]]])

(20)
M5 > 

R := RicciScalar(g5)

-2*g^2/(2*g*z+1)^2

(21)
M5 > 

B := evalDG([dt, dz])

[_DG([["form", M5, 1], [[[4], 1]]]), _DG([["form", M5, 1], [[[3], 1]]])]

(22)
M5 > 

ein := EinsteinTensor(g5)

_DG([["tensor", M5, [["con_bas", "con_bas"], []]], [[[1, 1], -g^2/(2*g*z+1)^2], [[2, 2], -g^2/(2*g*z+1)^2]]])

(23)
M5 > 

g5

_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 2*g*z+1]]])

(24)
M5 > 

rc

_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[3, 3], g^2/(2*g*z+1)^2], [[4, 4], -g^2/(2*g*z+1)]]])

(25)
M5 > 

EinEq := DGinfo(g5, "CoefficientList","all");

[-1, -1, -1, 2*g*z+1]

(26)
M5 > 

XM := 5.0*EinEq

[-5.0, -5.0, -5.0, 10.0*g*z+5.0]

(27)
M5 > 

XN := -2*EinEq

[2, 2, 2, -4*g*z-2]

(28)
M5 > 

XM+XN

[-3.0, -3.0, -3.0, 6.0*g*z+3.0]

(29)
M5 > 

evalDG(XM[1]*dx)

_DG([["form", M5, 1], [[[1], -5.0]]])

(30)
M5 > 

``

M5 > 

g5

_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 2*g*z+1]]])

(31)
M5 > 

G := g5-rc

_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 2*g*z+1]]])-_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[3, 3], g^2/(2*g*z+1)^2], [[4, 4], -g^2/(2*g*z+1)]]])

(32)
M5 > 

simplify(G)

_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 2*g*z+1]]])-_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[3, 3], g^2/(2*g*z+1)^2], [[4, 4], -g^2/(2*g*z+1)]]])

(33)
M5 > 

``

g5

_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 2*g*z+1]]])

(34)

``

M5 > 

g5

_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 2*g*z+1]]])

(35)
M5 > 

xp := Multiply(g5, 5.0)

5.0*_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 2*g*z+1]]])

(36)
M5 > 

``

M5 > 

``

M5 > 

g5+rc

_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 2*g*z+1]]])+_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[3, 3], g^2/(2*g*z+1)^2], [[4, 4], -g^2/(2*g*z+1)]]])

(37)
M5 > 

2+5

7

(38)
M5 > 

Add(g5, rc)

_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 2*g*z+1]]])+_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[3, 3], g^2/(2*g*z+1)^2], [[4, 4], -g^2/(2*g*z+1)]]])

(39)
M5 > 

Mat := Matrix([1, 2, 3, 4])

Matrix(%id = 4409748610)

(40)
M5 > 

Mapp := 2*Mat

Matrix(%id = 4611338242)

(41)
M5 > 

xx := 2*g5

2*_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 2*g*z+1]]])

(42)
M5 > 

g52 := 2*g5

2*_DG([["tensor", M5, [["cov_bas", "cov_bas"], []]], [[[1, 1], -1], [[2, 2], -1], [[3, 3], -1], [[4, 4], 2*g*z+1]]])

(43)
M5 > 

EinEq := DGinfo(g5, "CoefficientList", "all")

[-1, -1, -1, 2*g*z+1]

(44)
M5 > 

"i("

Download GRwork.mw

@Carl Love I'm only asking how to  tensor or by a factor. The rest of the work sheet is pretty messy. The imput g5 is a general relative metric tensor, though the same kind of problem seems to occur with plain matrices and also when trying to multiply square matrices. 

I figured out a way to do it, but it's awkward. Extract the components, multiply them and the reconsctruct the matrix. It seems like there should be somethig simpler. 

@Carl Love Sorry to be so ignorant but how do I find the worksheet you are refering too? I did get to your page (double click) with a lot of worksheets, but it was not clear to me which one I needed.

Thanks.

Page 1 of 1