ecterrab

14605 Reputation

24 Badges

20 years, 97 days

MaplePrimes Activity


These are answers submitted by ecterrab

restart

with(Physics)

with(Vectors)

Setup(spacetimeindices = greek, spaceindices = lowercaselatin, signature = `+++-`, coordinates = spherical)

[coordinatesystems = {X}, signature = `+ + + -`, spaceindices = lowercaselatin, spacetimeindices = greek]

(1)

Note that r is a coordinate, do not define it also as a tensor. Use another letter, for instance R

Also, define all the components in one go instead of one component at a time

 

NULL 

NULL

 

Define(R[a] = [sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta)])

{Physics:-Dgamma[mu], Physics:-Psigma[mu], R[a], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-gamma_[a, b], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(2)

Check it out

R[definition]

R[a] = [sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta)]

(3)

The same for A[mu, a], define all its components in one go, it is simpler, so comment these lines, then define it

NULL

NULL

NULL

NULL
NULL
NULL``

NULL

NULL

NULL

NULL``

NULLNULL


Here is the above in one go: use LeviCivita with four indices, as in `ε`[a, mu, j, 4]

Define(A[mu, a] = (1-f__A(X[1]))*LeviCivita[a, mu, j, 4]*R[j]/(g*X[1]))

{A[mu, a], Physics:-Dgamma[mu], Physics:-Psigma[mu], R[a], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-gamma_[a, b], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(4)

Check it out

A[definition]

A[mu, a] = (1-f__A(r))*Physics:-LeviCivita[4, a, j, mu]*R[j]/(g*r)

(5)

A[]

A[mu, a] = Matrix(%id = 36893488151887036156)

(6)

``

Your next definition: my suggestion to you is again to use LeviCivita with four indices, the forth being the number 4

Define(F[mu, nu, a] = d_[nu](A[mu, a])-d_[mu](A[nu, a])+LeviCivita[a, b, c, 4]*A[mu, `~b`]*A[nu, `~c`])

{A[mu, a], Physics:-Dgamma[mu], F[mu, nu, a], Physics:-Psigma[mu], R[a], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-gamma_[a, b], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(7)

F[definition]

F[mu, nu, a] = -Physics:-d_[nu](A[a, mu], [X])+Physics:-d_[mu](A[a, nu], [X])-Physics:-LeviCivita[4, a, b, c]*A[mu, `~b`]*A[nu, `~c`]

(8)

Next you could use local D but you will find that the results of your computation involve the D Maple differentiation operator (check its help page), so to avoid this problem use _D, and make it point to any convenient letter you can get from the palettes (the column at our left), for instance `𝒟`

macro(_D = `𝒟`)


Now use _D all around for your covariant derivative operator

Define(_D[mu] = d_[mu]+(1/2*I)*g*Psigma[a]*A[mu, a])

{`𝒟`[mu], A[mu, a], Physics:-Dgamma[mu], F[mu, nu, a], Physics:-Psigma[mu], R[a], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-gamma_[a, b], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(9)

_D[definition]

`𝒟`[mu] = Physics:-d_[mu]-((1/2)*I)*g*A[a, mu]*Physics:-Psigma[a]

(10)

SumOverRepeatedIndices(`𝒟`[mu] = Physics[d_][mu]-((1/2)*I)*g*A[a, mu]*Physics[Psigma][a], a)

`𝒟`[mu] = Physics:-d_[mu]-((1/2)*I)*g*A[1, mu]*Physics:-Psigma[1]-((1/2)*I)*g*A[2, mu]*Physics:-Psigma[2]-((1/2)*I)*g*A[3, mu]*Physics:-Psigma[3]

(11)

To see the components of any tensor, you can use TensorArray, or directly this

_D[]

`𝒟`[mu] = Array(%id = 36893488153853020748)

(12)

NULL

 

simplify(F[])

F[mu, nu, a] = _rtable[36893488153826239660]

(13)

" F[mu,nu,a]*F[~mu,~nu,a]"

F[mu, nu, a]*F[`~mu`, `~nu`, a]

(14)

"Simplify(SumOverRepeatedIndices(F[mu,nu,a]*F[~mu,~nu,a]));"

(1/4)*(-(-r*(diff(f__A(r), r))+(-1+f__A(r))*(r+1))^2*g^2*cos(2*phi-2*theta)-(r*(diff(f__A(r), r))+(-1+f__A(r))*(r-1))^2*g^2*cos(2*phi+2*theta)-8*g*r*(-1+f__A(r))^3*sin(-theta+phi)-2*(r^2*(diff(f__A(r), r))^2-2*r*(-1+f__A(r))*(diff(f__A(r), r))+(-1+f__A(r))^2*(r^2+1))*g^2*cos(2*theta)-2*(r*(diff(f__A(r), r))+(-1+f__A(r))*(r-1))*(-r*(diff(f__A(r), r))+(-1+f__A(r))*(r+1))*g^2*cos(2*phi)-8*g*r*(-1+f__A(r))^3*sin(theta+phi)+10*(diff(f__A(r), r))^2*g^2*r^2-20*g^2*r*(-1+f__A(r))*(diff(f__A(r), r))+14*((4/7)*f__A(r)^2-(8/7)*f__A(r)+4/7+(r^2+5/7)*g^2)*(-1+f__A(r))^2)/(g^4*r^4)

(15)

L__FST := -1/4*((1/4)*(-(-r*(diff(f__A(r), r))+(-1+f__A(r))*(r+1))^2*g^2*cos(2*phi-2*theta)-(r*(diff(f__A(r), r))+(-1+f__A(r))*(r-1))^2*g^2*cos(2*phi+2*theta)-8*g*r*(-1+f__A(r))^3*sin(-theta+phi)-2*(r^2*(diff(f__A(r), r))^2-2*r*(-1+f__A(r))*(diff(f__A(r), r))+(-1+f__A(r))^2*(r^2+1))*g^2*cos(2*theta)-2*(r*(diff(f__A(r), r))+(-1+f__A(r))*(r-1))*(-r*(diff(f__A(r), r))+(-1+f__A(r))*(r+1))*g^2*cos(2*phi)-8*g*r*(-1+f__A(r))^3*sin(theta+phi)+10*(diff(f__A(r), r))^2*g^2*r^2-20*g^2*r*(-1+f__A(r))*(diff(f__A(r), r))+14*((4/7)*f__A(r)^2-(8/7)*f__A(r)+4/7+(r^2+5/7)*g^2)*(-1+f__A(r))^2)/(g^4*r^4))

-(1/16)*(-(-r*(diff(f__A(r), r))+(-1+f__A(r))*(r+1))^2*g^2*cos(2*phi-2*theta)-(r*(diff(f__A(r), r))+(-1+f__A(r))*(r-1))^2*g^2*cos(2*phi+2*theta)-8*g*r*(-1+f__A(r))^3*sin(-theta+phi)-2*(r^2*(diff(f__A(r), r))^2-2*r*(-1+f__A(r))*(diff(f__A(r), r))+(-1+f__A(r))^2*(r^2+1))*g^2*cos(2*theta)-2*(r*(diff(f__A(r), r))+(-1+f__A(r))*(r-1))*(-r*(diff(f__A(r), r))+(-1+f__A(r))*(r+1))*g^2*cos(2*phi)-8*g*r*(-1+f__A(r))^3*sin(theta+phi)+10*(diff(f__A(r), r))^2*g^2*r^2-20*g^2*r*(-1+f__A(r))*(diff(f__A(r), r))+14*((4/7)*f__A(r)^2-(8/7)*f__A(r)+4/7+(r^2+5/7)*g^2)*(-1+f__A(r))^2)/(g^4*r^4)

(16)

At this point, your question is about computing the functional derivative with respect to f__A. The help page for Fundiff says that you need to specify a different variable for the differentiation function, and then you get  the expected Dirac function, as in

(%Fundiff = Fundiff)(f(x), f(y))

%Fundiff(f(x), f(y)) = Dirac(x-y)

(17)

 

So not the same variable for the function - you would receive this kind of telling error message

(%Fundiff = Fundiff)(f(x), f(x))

Error, (in Physics:-Fundiff) all the arguments of the differentiation function f(x) must be different from those used for f inside f(x)

 


Also, you do not need to put the Lagrangian density within an integral in order to compute a functional derivative: Fundiff and Int commute, so you can compute, directly
Fundiff(L__FST, f__A(y))

-(1/16)*(-2*(-r*(D(f__A))(r)+(-1+f__A(r))*(r+1))*g^2*cos(2*phi-2*theta)*Dirac(r-y)*(r+1)-2*(r*(D(f__A))(r)+(-1+f__A(r))*(r-1))*g^2*cos(2*phi+2*theta)*Dirac(r-y)*(r-1)-24*(-1+f__A(r))^2*g*r*sin(-theta+phi)*Dirac(r-y)-2*(-2*Dirac(r-y)*r*(D(f__A))(r)+2*(-1+f__A(r))*(r^2+1)*Dirac(r-y))*g^2*cos(2*theta)-2*Dirac(r-y)*(r-1)*(-r*(D(f__A))(r)+(-1+f__A(r))*(r+1))*g^2*cos(2*phi)-2*(r*(D(f__A))(r)+(-1+f__A(r))*(r-1))*Dirac(r-y)*(r+1)*g^2*cos(2*phi)-24*(-1+f__A(r))^2*g*r*sin(theta+phi)*Dirac(r-y)-20*Dirac(r-y)*g^2*r*(D(f__A))(r)+14*((8/7)*f__A(r)*Dirac(r-y)-(8/7)*Dirac(r-y))*(-1+f__A(r))^2+28*((4/7)*f__A(r)^2-(8/7)*f__A(r)+4/7+(r^2+5/7)*g^2)*(-1+f__A(r))*Dirac(r-y)+(2*(-r*(D(f__A))(r)+(-1+f__A(r))*(r+1))*g^2*cos(2*phi-2*theta)*r-2*(r*(D(f__A))(r)+(-1+f__A(r))*(r-1))*g^2*cos(2*phi+2*theta)*r-2*(2*r^2*(D(f__A))(r)-2*(-1+f__A(r))*r)*g^2*cos(2*theta)-2*r*(-r*(D(f__A))(r)+(-1+f__A(r))*(r+1))*g^2*cos(2*phi)+2*(r*(D(f__A))(r)+(-1+f__A(r))*(r-1))*r*g^2*cos(2*phi)+20*(D(f__A))(r)*g^2*r^2-20*(-1+f__A(r))*g^2*r)*Dirac(1, -r+r*sin(theta)*sin(phi))*(sin(theta)*sin(phi)-1))/(g^4*r^4)

(18)

Rewrite the D derivatives using diff

convert(-(1/16)*(-2*(-r*(D(f__A))(r)+(-1+f__A(r))*(r+1))*g^2*cos(2*phi-2*theta)*Dirac(r-y)*(r+1)-2*(r*(D(f__A))(r)+(-1+f__A(r))*(r-1))*g^2*cos(2*phi+2*theta)*Dirac(r-y)*(r-1)-24*(-1+f__A(r))^2*g*r*sin(-theta+phi)*Dirac(r-y)-2*(-2*Dirac(r-y)*r*(D(f__A))(r)+2*(-1+f__A(r))*(r^2+1)*Dirac(r-y))*g^2*cos(2*theta)-2*Dirac(r-y)*(r-1)*(-r*(D(f__A))(r)+(-1+f__A(r))*(r+1))*g^2*cos(2*phi)-2*(r*(D(f__A))(r)+(-1+f__A(r))*(r-1))*Dirac(r-y)*(r+1)*g^2*cos(2*phi)-24*(-1+f__A(r))^2*g*r*sin(theta+phi)*Dirac(r-y)-20*Dirac(r-y)*g^2*r*(D(f__A))(r)+14*((8/7)*f__A(r)*Dirac(r-y)-(8/7)*Dirac(r-y))*(-1+f__A(r))^2+28*((4/7)*f__A(r)^2-(8/7)*f__A(r)+4/7+(r^2+5/7)*g^2)*(-1+f__A(r))*Dirac(r-y)+(2*(-r*(D(f__A))(r)+(-1+f__A(r))*(r+1))*g^2*cos(2*phi-2*theta)*r-2*(r*(D(f__A))(r)+(-1+f__A(r))*(r-1))*g^2*cos(2*phi+2*theta)*r-2*(2*r^2*(D(f__A))(r)-2*(-1+f__A(r))*r)*g^2*cos(2*theta)-2*r*(-r*(D(f__A))(r)+(-1+f__A(r))*(r+1))*g^2*cos(2*phi)+2*(r*(D(f__A))(r)+(-1+f__A(r))*(r-1))*r*g^2*cos(2*phi)+20*(D(f__A))(r)*g^2*r^2-20*(-1+f__A(r))*g^2*r)*Dirac(1, -r+r*sin(theta)*sin(phi))*(sin(theta)*sin(phi)-1))/(g^4*r^4), diff)

-(1/16)*(-2*(-r*(diff(f__A(r), r))+(-1+f__A(r))*(r+1))*g^2*cos(2*phi-2*theta)*Dirac(r-y)*(r+1)-2*(r*(diff(f__A(r), r))+(-1+f__A(r))*(r-1))*g^2*cos(2*phi+2*theta)*Dirac(r-y)*(r-1)-24*(-1+f__A(r))^2*g*r*sin(-theta+phi)*Dirac(r-y)-2*(-2*Dirac(r-y)*r*(diff(f__A(r), r))+2*(-1+f__A(r))*(r^2+1)*Dirac(r-y))*g^2*cos(2*theta)-2*Dirac(r-y)*(r-1)*(-r*(diff(f__A(r), r))+(-1+f__A(r))*(r+1))*g^2*cos(2*phi)-2*(r*(diff(f__A(r), r))+(-1+f__A(r))*(r-1))*Dirac(r-y)*(r+1)*g^2*cos(2*phi)-24*(-1+f__A(r))^2*g*r*sin(theta+phi)*Dirac(r-y)-20*Dirac(r-y)*g^2*r*(diff(f__A(r), r))+14*((8/7)*f__A(r)*Dirac(r-y)-(8/7)*Dirac(r-y))*(-1+f__A(r))^2+28*((4/7)*f__A(r)^2-(8/7)*f__A(r)+4/7+(r^2+5/7)*g^2)*(-1+f__A(r))*Dirac(r-y)+(2*(-r*(diff(f__A(r), r))+(-1+f__A(r))*(r+1))*g^2*cos(2*phi-2*theta)*r-2*(r*(diff(f__A(r), r))+(-1+f__A(r))*(r-1))*g^2*cos(2*phi+2*theta)*r-2*(2*r^2*(diff(f__A(r), r))-2*(-1+f__A(r))*r)*g^2*cos(2*theta)-2*r*(-r*(diff(f__A(r), r))+(-1+f__A(r))*(r+1))*g^2*cos(2*phi)+2*(r*(diff(f__A(r), r))+(-1+f__A(r))*(r-1))*r*g^2*cos(2*phi)+20*(diff(f__A(r), r))*g^2*r^2-20*(-1+f__A(r))*g^2*r)*Dirac(1, -r+r*sin(theta)*sin(phi))*(sin(theta)*sin(phi)-1))/(g^4*r^4)

(19)

Now you can now integrate this result with any limits of integration that you prefer. Note however that you have two Dirac functions

indets(-(1/16)*(-2*(-r*(diff(f__A(r), r))+(-1+f__A(r))*(r+1))*g^2*cos(2*phi-2*theta)*Dirac(r-y)*(r+1)-2*(r*(diff(f__A(r), r))+(-1+f__A(r))*(r-1))*g^2*cos(2*phi+2*theta)*Dirac(r-y)*(r-1)-24*(-1+f__A(r))^2*g*r*sin(-theta+phi)*Dirac(r-y)-2*(-2*Dirac(r-y)*r*(diff(f__A(r), r))+2*(-1+f__A(r))*(r^2+1)*Dirac(r-y))*g^2*cos(2*theta)-2*Dirac(r-y)*(r-1)*(-r*(diff(f__A(r), r))+(-1+f__A(r))*(r+1))*g^2*cos(2*phi)-2*(r*(diff(f__A(r), r))+(-1+f__A(r))*(r-1))*Dirac(r-y)*(r+1)*g^2*cos(2*phi)-24*(-1+f__A(r))^2*g*r*sin(theta+phi)*Dirac(r-y)-20*Dirac(r-y)*g^2*r*(diff(f__A(r), r))+14*((8/7)*f__A(r)*Dirac(r-y)-(8/7)*Dirac(r-y))*(-1+f__A(r))^2+28*((4/7)*f__A(r)^2-(8/7)*f__A(r)+4/7+(r^2+5/7)*g^2)*(-1+f__A(r))*Dirac(r-y)+(2*(-r*(diff(f__A(r), r))+(-1+f__A(r))*(r+1))*g^2*cos(2*phi-2*theta)*r-2*(r*(diff(f__A(r), r))+(-1+f__A(r))*(r-1))*g^2*cos(2*phi+2*theta)*r-2*(2*r^2*(diff(f__A(r), r))-2*(-1+f__A(r))*r)*g^2*cos(2*theta)-2*r*(-r*(diff(f__A(r), r))+(-1+f__A(r))*(r+1))*g^2*cos(2*phi)+2*(r*(diff(f__A(r), r))+(-1+f__A(r))*(r-1))*r*g^2*cos(2*phi)+20*(diff(f__A(r), r))*g^2*r^2-20*(-1+f__A(r))*g^2*r)*Dirac(1, -r+r*sin(theta)*sin(phi))*(sin(theta)*sin(phi)-1))/(g^4*r^4), specfunc(Dirac))

{Dirac(r-y), Dirac(1, -r+r*sin(theta)*sin(phi))}

(20)

and no Dirac function for the other variables, so how do you intend to integrate in the other variables? Also, are these Dirac functions what you expect?  The computer can perform for you a computation that you know how to do it. That is important also to know whether the result is actually what you wanted to compute.

 

I suggest you to give a look for instance at at this link with brief information on "The Dirac Delta Function in Three Dimensions", or search the web for related material. Using Intc as you did will integrate over these coordinates as if they were Cartesian, from - to + infinity. If after formulating the problem in a way that you are sure you are computing what you want to compute you still have a doubt, feel free to post here again and we take if from there.
 

 

Download YANG-MILLS-Theorie_(reviewed).mw


Edgardo S. Cheb-Terrab

 

Physics, Differential Equations and Mathematical Functions, Maplesoft

As said in a previous comment, using the 'methods' option was not implemented when tackling ODE + IC/BC. It is implemented now, and with that the problem is resolved. To install the adjustment, as usual, input Physics:-Version(latest);

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

(Please remember to post a worksheet instead of text and screen shots.)

 

There is no bug. This is the answer to your question, and at the end two suggestions to avoid these subtleties.

 

with(Physics)

Setup(spacetimeindices = greek, spaceindices = lowercaselatin_ah, signature = `-++ +`, coordinates = spherical)

[coordinatesystems = {X}, signature = `- + + +`, spaceindices = lowercaselatin_ah, spacetimeindices = greek]

(1)

From your signature, you are choosing position 1 to be timelike, and 2, 3 and 4 to represent the three spacelike components. With that in mind, take a look at the components of sigma[mu]

TensorArray(Psigma[mu])

Array(%id = 36893488152415651468)

(2)

So the Pauli matrices are sigma[2], sigma[3] and sigma[4], as you can also see in this output

TensorArray(Psigma[mu], rewriteinmatrixform)

Array(%id = 36893488152391441452)

(3)

So what you do expect for the components of sigma[a] where Psigma is indexed with a space index a?

TensorArray(Psigma[a])

Array(%id = 36893488152391429764)

(4)

TensorArray(Psigma[a], rewriteinmatrixform)

Array(%id = 36893488152391420252)

(5)

The above turns on the lights regarding the shifted value of the space index a : the tensor you are indexing, sigma is a 4-dimensional tensor, and being that the 1st component is timelike (not Physics's default but your choice of signature), the space components are given by shifting the 4-dimensional index by one.

 

How about a true space tensor? Let's define one of them, another mixed, and one all spacetime for experimentation

Define(S[a], A[mu, a], B[mu, nu])

{A[mu, a], B[mu, nu], Physics:-Dgamma[mu], Physics:-Psigma[mu], S[a], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-gamma_[a, b], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(6)

For S[a], a space tensor, the components are given by

TensorArray(S[a])

Array(%id = 36893488152391393996)

(7)

You see they are not shifted. The index a runs from 1 to 3, not from 1 to 4 such that you are only interested in the components from 2 to 4.

How about the mixed tensor A[mu, a]?

TensorArray(A[mu, a])

Matrix(%id = 36893488152391382188)

(8)

Again OK, and you see: there are 4 lines indexed from 1 to 4, and 3 colums indexed from 1 to 3, because a is a space index. How about B[mu, a], where in B[mu, nu] we want only the space part of the spactime index nu?

TensorArray(B[mu, a])

Matrix(%id = 36893488151936346220)

(9)

This is again correct, but the 3 columns are indexed from 2 to 4, not from 1 to 3 as in (8) for A[mu, a]. I hope it is clear now: when you set a signature with timelike component in position 1, the space part of a spacetime index is given by shifting the value by 1 to skip the timelike component in position 1.

 

With these things in mind lets give a closer look at your example where you define a covariant derivative operator as D[mu] = `∂`[mu]+(1/2)*ig*sigma[a]*A[mu, a]. The first problem is that you use the letter D, which is a Maple command representing differentiation. If you proceed as you did, you effectively not have the D command anymore, which is bad. Instead, I suggest you first input

_local(D)

D

(10)

Now you can use D without cancelling the Maple differentiation command D

Define(D[mu] = d_[mu]+(1/2)*ig*Psigma[a]*A[mu, a])

{A[mu, a], B[mu, nu], D[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], S[a], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-gamma_[a, b], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(11)

Check

D[definition]

D[mu] = Physics:-d_[mu]+(1/2)*ig*A[mu, a]*Physics:-Psigma[a]

(12)

Let's sum over the repeated index a. In view of the comments lines above, what do we expect? In A[mu, a], the index a is a space index, running from 1 to 3. In sigma[a], the index a represents the space part of a spacetime index so it runs from 2 to 4. Then

SumOverRepeatedIndices(D[mu] = Physics[d_][mu]+(1/2)*ig*A[mu, a]*Physics[Psigma][a], a)

D[mu] = Physics:-d_[mu]+(1/2)*ig*A[mu, 1]*Physics:-Psigma[2]+(1/2)*ig*A[mu, 2]*Physics:-Psigma[3]+(1/2)*ig*A[mu, 3]*Physics:-Psigma[4]

(13)

That is the result you are getting when entering TensorArray(D[mu])and that motivated your question: the index a in A[mu, a] runs from 1 to 3 but the index a in sigma[a] runs from 2 to 4.

A[mu, a]

(14)

 

Of course you could have all this in mind, and the computations will run correctly, you don't need to worry. Or the details are not in your mind and get in doubt (your post). I have some suggestions to avoid falling in these subtleties

1. 

Do not use a signature with the timelike component in position 1. Instead, use either "+++-" or "- - -+"the latter is Physics's default.

2. 

Or, use the signature "-+++" but define your tensor A with two spacetime indices, as is the case of sigma[mu], then use A with a space index,as you are doing when entering sigma[a]

Compare. These are the current components for your A defined as a mixed components tensor

TensorArray(A[mu, a])

Matrix(%id = 36893488152415701820)

(15)

with these other ones after redefining A with two spacetime indices

Define(redo, A[mu, nu], quiet)

{A[mu, nu], B[mu, nu], D[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], S[a], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-gamma_[a, b], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(16)

TensorArray(A[mu, a])

Matrix(%id = 36893488152415657244)

(17)

I believe the above is what you wanted. So now you have

D[definition]

D[mu] = Physics:-d_[mu]+(1/2)*ig*A[mu, a]*Physics:-Psigma[a]

(18)

 

SumOverRepeatedIndices(D[definition], a)

D[mu] = Physics:-d_[mu]+(1/2)*ig*A[mu, 2]*Physics:-Psigma[2]+(1/2)*ig*A[mu, 3]*Physics:-Psigma[3]+(1/2)*ig*A[mu, 4]*Physics:-Psigma[4]

(19)

and you get what you where expecting  for TensorArray(D[mu]).``


Download signatures_and_mixed_type_of_tensors.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Yes. See the help page?Physics,Tensors, section 2.b and 2.c; those pages also illustrate the Library:-RedefineTensorComponent, useful for changing the value of a component after you have defined the tensor's components using Define. You have as well more details in the help page of the command you are using, ?Physics,Define.

Regarding your question, "What exactly am I doing wrong?", you are not defining tensor components the way indicated in the help page. It is not correct to "assign" a component, e.g., via A[a, 1]:= 0; in Maple, that actually reassigns all of A, creating a table and undoing the tensor definition previously done using Define.

Overall, I suggest you invest more time in the related help pages. It pays off, the functionality available is enormous, and it saves you time despite the time invested.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

This first part is your worksheet:
restart; with(Physics)

NULLg_[euclid]

Physics:-g_[mu, nu] = Matrix(%id = 36893488153354589116)

(1)

Setup(mathematicalnotation = true)

[mathematicalnotation = true]

(2)

NULL
Define(A[mu] = [1, 2, 3, 4])

{A[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(3)

A[]

A[mu] = Array(%id = 36893488153354570796)

(4)

"A[~]"

A[`~mu`] = Array(%id = 36893488153354567540)

(5)

SumOverRepeatedIndices(A[`~mu`]*A[mu], mu)

30

(6)

NULL  Simplify(A[`~mu`]*A[mu])

A[mu]^2

(7)

Simplify(A[mu]^2)

A[mu]^2

(8)

NULL

Simplify(g_[nu, mu]^2)

4

(9)

"#  g Simplifies to a number, why doesn't A"?" thanks"

====================================================
Answer: that simplification only works for the metric. What you see in

g_[nu, mu]^2

Physics:-g_[mu, nu]^2

(10)

Simplify(%)

4

(11)

is the trace, as in

g_[trace]

4

(12)

For A[mu]^2  there is no trace, and if you want the sum over repeated indices, you already have that command, as you show in (6). This other example, of a tensor with two indices, may help see the difference

Define(B[mu, nu] = Matrix(4, proc (i, j) options operator, arrow; i+j end proc))

{A[mu], B[mu, nu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(13)

B[definition]

B[mu, nu] = Matrix(%id = 36893488153328980684)

(14)

B[trace]

20

(15)

Also

B[mu, mu]

B[mu, mu]

(16)

SumOverRepeatedIndices(B[mu, mu])

20

(17)

But not Simplify

Simplify(B[mu, mu])

B[mu, mu]``

(18)

The case of the metric is indeed special. In computations with paper and pencil in Physics, we (more often than otherwise) want the trace to be explicitly computed, but not for all other tensors. For them SumOverRepeatedIndices does the job and with several options (check its help page). And what if you want the trace of the metric to not be computed? Use the inert form

%g_[nu, mu]^2

%g_[nu, mu]^2

(19)

Simplify(%)

%g_[mu, nu]^2

(20)

NULL

 

Download simp_(reviewed).mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions

 

Download Differentiate_the_solution_you_get_the_ODE.mw
 

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Matheatical Functions, Maplesoft

Download SumOverRepeatedIndices_works_fine.mw
 

PS: Next time, please upload a worksheet with your input - see the green arrow in the post menu for that purpose; to copy and paste is not convenient.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Good catch, this weakness is fixed in v.1752 of the Maplesoft Physics Updates. As usual, to install, open Maple and input Physics:-Version(latest);

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi

It is difficult to help without a worksheet where you show, e.g. what makes you say "I caught aome serious errors with Maple 22 calculating the Ricci tensor". Regarding "How do I tell Maple to contract thae alpha and beta indices in above expression", maybe you mean multiplying by the metric to contract? If so, you can use * or . that includes simplification - all these things are explained in detail and with examples on the help page ?Physics,Tensors.

Anyway, if you post your worksheet (see the green arrow to upload it), it becomes possible to understand what you are saying and, from there, provide more specific feedback.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft



Download Total_differential.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

In short: what you are saying is not correct. The solution y(x) = 3 is a particular solution, you get it taking c__1 = infinity.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

This is your ODE and dsolve's solution, all tests OK

ode := diff(y(x), x)-cot(x)*(y(x)^(1/2)-y(x)) = 0

sol := dsolve(ode)

y(x)^(1/2)-(Int((1/2)*sin(x)^(1/2)*cot(x), x)+c__1)/sin(x)^(1/2) = 0

(1)

odetest(sol, ode)

0

(2)

dsolve's solution computing the integral also tests OK

sol := dsolve(ode, useint)

y(x)^(1/2)-1-c__1/sin(x)^(1/2) = 0

(3)

odetest(sol, ode)

0

(4)

dsolve's solution in explicit form requires RootOf and also tests OK

sol := dsolve(ode, useint, explicit)

y(x) = RootOf(-_Z^(1/2)*sin(x)^(1/2)+sin(x)^(1/2)+c__1)

(5)

odetest(sol, ode)

0

(6)

Now, this is your solution, nm,

sol_NM := y(x) = (exp(RootOf(-sin(x)*tanh((1/2)*_Z+(1/2)*c__1)^2+sin(x)+exp(_Z)))+sin(x))/sin(x)

y(x) = (exp(RootOf(-sin(x)*tanh((1/2)*_Z+(1/2)*c__1)^2+sin(x)+exp(_Z)))+sin(x))/sin(x)

(7)

I don't know from where you got this expression, but to my eyes it is not a solution to ODE. Remove the RootOf to test the actual expression behind

DEtools:-remove_RootOf(sol_NM)

-sin(x)*tanh((1/2)*ln(y(x)*sin(x)-sin(x))+(1/2)*c__1)^2+y(x)*sin(x) = 0

(8)

odetest(-sin(x)*tanh((1/2)*ln(y(x)*sin(x)-sin(x))+(1/2)*c__1)^2+y(x)*sin(x) = 0, ode)

`odetest/PIECEWISE`([0, -ln(y(x)*sin(x)-sin(x))+2*arctanh(y(x)^(1/2)) = c__1], [2*(sin(x)*exp(c__1)*(exp(-c__1)*(exp(c__1)-csc(x)+2*exp((1/2)*c__1)*(-sin(x))^(1/2)*csc(x)))^(1/2)-exp(c__1)*sin(x)-2*exp((1/2)*c__1)*(-sin(x))^(1/2)+1)*exp(-c__1)*cot(x)*csc(x)/((exp(-c__1)*(exp(c__1)-csc(x)+2*exp((1/2)*c__1)*(-sin(x))^(1/2)*csc(x)))^(1/2)-1), -ln(y(x)*sin(x)-sin(x))-2*arctanh(y(x)^(1/2)) = c__1])

(9)

Regarding testing your expression (not a solution) explicitly as if it were a solution, you hit a bug, but not in odetest; it is in radnormal, this is the expression, resulting from your not-a-solution, that goes into an infinite loop within radnormal

NULL

ee := (((2*I)*RootOf(_Z^3*_a^(2*c__1)+2*_Z^2*_a^c__1+((2*I)*_a^(c__1-I*x)-(2*I)*_a^(c__1+I*x)+1)*_Z)*_a^(I*x)+_a^((2*I)*x)-1)/(_a^((2*I)*x)-1))^(1/2)

radnormal(ee);radnormal(ee)

Error, (in anonymous procedure called from depends) too many levels of recursion |lib/depends/src/depends.mpl:80|

 

NULL


Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Download ode_solved_and_tested_OK.mw

This is resolved; the integration constants shown by ODESteps are now the new ones (nicer), as the ones returned by default by dsolve. For this change to be active, as usual, install the latest update by opening Maple 2024 and entering Physics:-Version(latest)

Regarding your question in the worksheet, as explained in ?dsolve,details, by default, dsolve and pdsolve return integration constants and functions as c__n and f__n(...), where n is an integer and is displayed as a subscript (and the `__` is not visible, it just produces the subscript), but you can set these commands to work as in the past (2 releases ago), i.e. using _Cn and _Fn.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Thanks for the report, @nm. This one is fixed in the Updates v.1724 or newer. As usual, to install, open Maple and input Physics:-Version(latest);

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi @nm, good catch. It's was a subtle issue. It is fixed in the Udpates v.1723 for Maple 2024. As usual, to install, open Maple 2024 and input Physics:-Version(latest).

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

2 3 4 5 6 7 8 Last Page 4 of 60