ecterrab

14540 Reputation

24 Badges

20 years, 22 days

MaplePrimes Activity


These are answers submitted by ecterrab

Hi nm,

Physics:-Version was written having for context the updates distributed with zips, before Maple 2018: nobody remembered the number (e.g., for Maple 2017 there were 300 updates uploaded), so looking at the date was simpler. The date of the last update was (and still is) posted at the Maplesoft R&D Physics webpage; comparing that date with the one shown by Physics:-Version(); you'd know whether you have the last version.

New in Maple 2018, the updates of physics, differential equations and mathematical functions code (that is the "Physics Updates" package) are now distributed through the MapleCloud, making the installation of the update really simpler. And the related MapleCloud version number is just the same version number you always saw in the Maplesoft R&D Physics webpage. Also new: this number can now be retrieved programmatically.

I just uploaded version 39, with several adjustments into the DE code, in connection with the use of the new (fantastic) DifferentialThomas package for performing differential elimination. In this update, I also modified Physics:-Version()so that it returns the version number as well.

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

Hi John

This problem is fixed in the Physics Updates version 37, available from the Maplesoft R&D Physics webpage. Attached is your worksheet revised, with some further comments: you do not need two LeviCivita (galilean and nongalilean) to perform this computation, because your tetrad system is already galilean (orthonormal) so that LeviCivita[a,b,c,d], with tetrad indices, is already galilean in that system of references.

 

Download MixedTypeLeviCivitas_(reviewed).mw

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

Hi Edahl,

The computation you show can be done in a simpler manner using the Physics package - check its help page (?Physics) and the help pages for Setup, g_, Christoffel, Ricci and LieDerivative. Important: if you dump things in text format, in order to help you people need to start copy & paste, prone to mistakes and more work. Instead of that, could you please upload the worksheet? For that purpose, you can use the green arrow you see when you write a question.

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

There is a bug in the MapleCloud regarding reporting the "Physics Updates" as installed, and therefore it also does not tell you there is an update available. For instance, there have been 22 updates already. The fix to this MapleCloud mechanism is scheduled for the end of the Sprint or the Summer. We are also looking for ways to fix this without having to wait for that much, but I am not sure about success.

Regarding how to uninstall a package, since there is this problem with the Cloud, the simplest way is to delete the directory, or depending on how many packages you have, the following suffices:

> PackageTools:-Uninstall(the_package_filename_complete);


If you delete the directory, on a Mac, it is below ~/Maple/toolbox. If you don't figure out where is the package installed, you can reinstall the package, the installer shows a message that includes the path.

Regarding updates, until this problem regarding reporting the "Physics Updates" is resolved,  you can enter 

>  PackageTools : -GetProperty("Physics Updates.maple", version);


and compare with the one shown in the Cloud. Hopefully next week the Maplesoft R&D Physics webpage will start showing the date and version of the latest update too.

Anyway if you reinstall an already installed version, there is no harm, and the simplest instruction to install the "Physics Updates", skipping all the MapleCloud details/steps, is to open Maple and enter this:

> PackageTools:-Install("5137472255164416", overwrite);


I realize all this is suboptimal. Distributing these updates through the MapleCloud is, however, the way to go (please no more prehistoric zips). Sometimes innovation comes flawlessly since day one. Other times, it requires adjustments. These problems are expected to be resolved rather soon anyway.

UPDATE Apr/30:

1) How does one uninstall a package listed in the "installed" list? I see no option to do this.

At this point, use PackageTools:-Uninstall("name_of_the_installed_package");

2) How does one know if the "installed" package needs to be updated or not? And if so, how does one updated it? 

That got fixed: click the upper-right corner MapleCloud and, in the toolbar that opens, on top of Updates, you will see a red icon indicating there are updates to one or more packages. Click Updates, and you will be taken to the MapleCloud window, section on Installed packages, where you will see a different color for the installation icon of those for which there are updates.

3) In the "packages" list, I see "physics Updates".  Now,  I did install this earlier (1-2 weeks ago). Then why is it not listed also under the "installed" list? 

That was a bug; it is fixed now. To have the fix working, however, you need to install the "Physics Updates" version 32 or higher, since to speed up matters the fix itself for this MapleCloud mechanism s distributed within the Physics Updates package.

3.b) And how does one know if they have installed a package that shows in the "packages" list?

Click Installed, and you will see a list of the installed packages. Alternatively, use PackageTools:-ListInstalledPackages(); that now works fine (provided you have "Physics Updates" version 32 or higher)

3.c) There is no marker or anything there to tell one they have installed it or not.  Is one supposed to go look in the "installed" list to manually check if they installed it or not?

Yes.

4) What happens if one install a package/app they have installed before. Will the new package overwrite the older version automatically?

Yes.

5) It seems packages installed go to some temporary folder. Is there a way to configure it, so that all packages installed go to some other user defined folder. This way, if one moves to a new PC or such, they do not lose all the packages they have installed? 

Packages are not installed into a temporary folder. They are installed under toolbox, and when the package only works with a specific Maple version - say 2018 - then it is installed under toolbox/2018. If you move to a new machine, it suffices to copy the entire toolbox directory, in the same parent directory you see it in the old machine (assuming the OS is the same, of course). Otherwise, take a screenshot of the Installed packages and reinstall them directly from the MapleCloud window (it is only one click per package).

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

Hi

I gave a look at the problem you posted. Firstly, there is a typo when you enter the integral, in the integration ranges:

[`p__3x ` = -infinity .. infinity, `p__3y ` = -infinity .. infinity, `p__3y ` = -infinity .. infinity]

You see you p__3y is repeated, that cannot be what you intended (makes no sense, this is a definite integral). I guess you intended the third one to be an integration range for  p__3z.

After fixing that, you receive a result that presents a piecewise function times infinity, basically this integral is undefined, each of the integrals is of the form

> Int(1/(a-b), b = -infinity .. infinity);

                        /infinity         
                       |            1     
                       |          ----- db
                       |          a - b   
                      /-infinity          

> value(%);
                           undefined

where a is a component of p__1 and b is the corresponding component of p__3. (Note that the exponential does not depend on p__3 therefore is taken outside of the integral, as a factor multiplying the result). So could you please clarify what is what you were expecting here (as you say, symbolically and/or numerically).

 

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

 


 

In your worksheet you use blocks of input with several input lines. That can, sometimes, make difficult to understand what is not working as desired. Below, where appropriate, I am splitting these blocks in pieces.

 

So, you first compute the metric matrix, then load Physics, then define the metric. Let's split that; first compute the matrix form of the metric you want to work with

restart

with(VectorCalculus); x := Vector([VectorCalculus:-`*`(VectorCalculus:-`+`(R, VectorCalculus:-`*`(r, cos(p))), cos(t)), VectorCalculus:-`*`(VectorCalculus:-`+`(R, VectorCalculus:-`*`(r, cos(p))), sin(t)), VectorCalculus:-`*`(r, sin(p))]); s := [p, t]; g := Matrix(nops(s), nops(s)); for i to nops(s) do for j to nops(s) do g[i, j] := simplify(DotProduct(diff(x, s[i]), diff(x, s[j]))) end do end do; g

Vector(3, {(1) = (R+r*cos(p))*cos(t), (2) = (R+r*cos(p))*sin(t), (3) = r*sin(p)})

 

s := [p, t]

 

Matrix(2, 2, {(1, 1) = 0, (1, 2) = 0, (2, 1) = 0, (2, 2) = 0})

 

Matrix(%id = 18446744078323134206)

(1)

Now load Physics, and I also see you are not using mathematical notation so that contravariant indices are not being displayed as superscripts. To improve readability, let's the load Physics and set mathematical notation right away

with(Physics); Setup(mathematicalnotation = true)

[mathematicalnotation = true]

(2)

Now set your problem (indeed you do not need Dirac matrices for this so keep that line in comments, or remove it entirely)

Setup(dimension = 2); Coordinates(X = s); Setup(metric = g); g_[]

[dimension = 2]

 

`Systems of spacetime Coordinates are: `*{X = (p, t)}

 

{X}

 

[metric = {(1, 1) = r^2, (2, 2) = (R+r*cos(p))^2}]

 

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

(3)

To the side of the problem: I see that, below, you write text on input lines. You don't need to do that. Instead, place the cursor on an input line and press F5 so that it transforms into a text region where you can write text. You can also embed formulas within.

 

Now to the problem: to compute the Ricci scalar, of course you can substitute indices in the Riemann tensor or compute it directly, or contract with the metric. Let's see these three manners.

 

1. To substitute indices in the Riemann tensor you do not need to compute its Array form because the Array form has no indices. So instead of

NULL

try this

SubstituteTensorIndices({rho = mu, sigma = nu}, Riemann[mu, nu, rho, sigma])

Physics:-Ricci[nu, `~nu`]

(4)

To compute the value, sum over the repeated indices

SumOverRepeatedIndices(Physics[Ricci][nu, `~nu`])

2*cos(p)/((R+r*cos(p))*r)

(5)

I see you do not use equation labels: you can refer to the contents of an equation label by pressing Ctrl + L (or Command + L on a Macintosh).

 

2. Contracting with the metric

g_[mu, nu].Ricci[mu, nu]

Physics:-Ricci[`~nu`, nu]

(6)

SumOverRepeatedIndices(Physics[Ricci][`~nu`, nu])

2*cos(p)/((R+r*cos(p))*r)

(7)

3. Use the keyword scalar

Ricci[scalar]

2*cos(p)/((R+r*cos(p))*r)

(8)

You wrote your first question within an input line. I will split the block of input so that we can revise each of them

# This is the question about the contravariant Form of A[mu] ;

Define(A[mu], F, res)

`Defined objects with tensor properties`

 

{F, res, A[mu], Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[mu, nu], Physics:-SpaceTimeVector[mu](X)}

(9)

Next you attempt indicating the components of F using an assignment, via (here I am commenting the line)

NULL

 

I understand this seemed natural to you but it is not the way you do this. You indicate the components of F directly when you define it. Instead of the above, use the Define  command (in two lines, as I do here for readability, or all in one line):

F[mu, nu] = D_[mu](A[nu](X))

F[mu, nu] = Physics:-D_[mu](A[nu](X), [X])

(10)

Define(F[mu, nu] = Physics[D_][mu](A[nu](X), [X]))

`Defined objects with tensor properties`

 

{res, A[mu], Physics:-D_[mu], Physics:-Dgamma[mu], F[mu, nu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[mu, nu], Physics:-SpaceTimeVector[mu](X)}

(11)

Now you have F[mu, nu] defined as you wanted: check the definition, covariant and contravariant components

F[definition]

F[mu, nu] = Physics:-D_[mu](A[nu](X), [X])

(12)

F[]

F[mu, nu] = Matrix(%id = 18446744078411472758)

(13)

"F[~]"

F[`~mu`, `~nu`] = Matrix(%id = 18446744078421879974)

(14)

"F[mu,~nu,matrix]"

F[mu, `~nu`] = Matrix(%id = 18446744078421819870)

(15)

Note that the three above are different.

 

Next you attempt computing the trace of F. You can do that as you did

g_[mu, nu].F[`~mu`, `~nu`]; SumOverRepeatedIndices(%)

F[`~nu`, nu]

 

(diff(A[1](X), p))/r^2+(diff(A[2](X), t)-(R+r*cos(p))*sin(p)*A[1](X)/r)/(R+r*cos(p))^2

(16)

And also the other way you tried

SubstituteTensorIndices(nu = mu, F[mu, nu]); SumOverRepeatedIndices(%)

F[mu, `~mu`]

 

(diff(A[1](X), p))/r^2+(diff(A[2](X), t)-(R+r*cos(p))*sin(p)*A[1](X)/r)/(R+r*cos(p))^2

(17)

but it is simpler using the keyword trace

F[trace]

(-A[1](X)*sin(p)*cos(p)*r^2+cos(p)^2*(diff(A[1](X), p))*r^2-A[1](X)*sin(p)*R*r+2*cos(p)*(diff(A[1](X), p))*R*r+(diff(A[2](X), t))*r^2+(diff(A[1](X), p))*R^2)/(r^2*(R+r*cos(p))^2)

(18)

The result above is expanded, but it is the same as (16) or (17)

simplify((-A[1](X)*sin(p)*cos(p)*r^2+cos(p)^2*(diff(A[1](X), p))*r^2-A[1](X)*sin(p)*R*r+2*cos(p)*(diff(A[1](X), p))*R*r+(diff(A[2](X), t))*r^2+(diff(A[1](X), p))*R^2)/(r^2*(R+r*cos(p))^2)-(diff(A[1](X), p))/r^2-(diff(A[2](X), t)-(R+r*cos(p))*sin(p)*A[1](X)/r)/(R+r*cos(p))^2)

0

(19)

and if you want it simplified in size use

simplify((-A[1](X)*sin(p)*cos(p)*r^2+cos(p)^2*(diff(A[1](X), p))*r^2-A[1](X)*sin(p)*R*r+2*cos(p)*(diff(A[1](X), p))*R*r+(diff(A[2](X), t))*r^2+(diff(A[1](X), p))*R^2)/(r^2*(R+r*cos(p))^2), size)

((diff(A[1](X), p))*(R+r*cos(p))^2-(-(diff(A[2](X), t))*r+sin(p)*A[1](X)*(R+r*cos(p)))*r)/(r^2*(R+r*cos(p))^2)

(20)

 

In the following block, the problem is the same as before: you do not define tensors via assignment; you do that using the Define  command. I am commenting this  block and showing how to do it right after

# Above I defined the Tensor "res". I'm wondering if this is necessary for later assignments or not, because the following works for neither!;


# I want res when I select an index to show the concent...

Physics:-Christoffel[mu, 1, `~1`]+Physics:-Christoffel[mu, 2, `~2`]

 

res[1]

(21)

Try this instead

res[mu] = Christoffel[mu, nu, nu]

res[mu] = Physics:-Christoffel[mu, nu, `~nu`]

(22)

Define(res[mu] = Physics[Christoffel][mu, nu, `~nu`])

`Defined objects with tensor properties`

 

{A[mu], Physics:-D_[mu], Physics:-Dgamma[mu], F[mu, nu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-g_[mu, nu], res[mu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[mu, nu], Physics:-SpaceTimeVector[mu](X)}

(23)

res[definition]

res[mu] = Physics:-Christoffel[mu, nu, `~nu`]

(24)

res[]

res[mu] = Array(%id = 18446744078323139398)

(25)

"res[~]"

res[`~mu`] = Array(%id = 18446744078323127230)

(26)

res[1]

r*sin(p)/(R+r*cos(p))

(27)

"res[~1]"

sin(p)/(r*(R+r*cos(p)))

(28)

Next there is this other block of text and comments, here I don't understand what you are trying to say. I keep the block and add some comments after it.

# This was the question about the two-fold application of SumOverRepeatedIndices... Actually I'm also a bit confused about the sign issue. Christoffel[mu,nu,nu] should give the correct contracted result or? However comparing this with the Christoffel Term from the covariant Derivative above it has a minus sign... If I do Christoffel[nu,nu,mu] I get the correct sign... ;
Christoffel[mu, 1, `~1`, Matrix]+Christoffel[mu, 2, `~2`, Matrix]; Christoffel[nu, nu, mu].A[mu]; SumOverRepeatedIndices(%); SumOverRepeatedIndices(%)

Christoffel[mu, 1, `~1`]+Christoffel[mu, 2, `~2`] = (Vector(2, {(1) = r*sin(p)/(R+r*cos(p)), (2) = 0}))

 

Physics:-Christoffel[nu, mu, `~nu`]*A[mu]

 

(Physics:-Christoffel[1, mu, `~1`]+Physics:-Christoffel[2, mu, `~2`])*A[`~mu`]

 

-sin(p)*r*A[`~1`]/(R+r*cos(p))

(29)

This is what you have

Christoffel[mu, 1, `~1`, Matrix]+Christoffel[mu, 2, `~2`, Matrix]

Physics:-Christoffel[mu, 1, `~1`]+Physics:-Christoffel[mu, 2, `~2`] = Vector[column](%id = 18446744078411455774)

(30)

"Christoffel[nu,nu,~mu].A[mu];  SumOverRepeatedIndices(`%`); "

Physics:-Christoffel[`~nu`, nu, `~mu`]*A[mu]

 

-sin(p)*A[1]/(r*(R+r*cos(p)))

(31)

Note that (30) and (31) are not using the same components of Christoffel, since, as you see, in (31), the first index is contravariant; the corresponding matrix for Christoffel is

"Christoffel[~nu,nu,~mu] = TensorArray(Christoffel[~nu,nu,~mu])"

Physics:-Christoffel[`~nu`, nu, `~mu`] = Array(%id = 18446744078323108790)

(32)

Summarizing:

 

• 

You can write text within text regions

• 

You can refer to the contents of equation labels using Ctrl + L

• 

To define the compotes of a tensor, use the Define  command, not the assignment operator :=

• 

To compute the Ricci scalar the simplest way, use Ricci[scalar]

• 

To compute the trace of a tensor whose components were defined using Define - say F - use F[trace]

• 

There is nothing wrong with the value of the components of the Christoffel symbols.

 

Regarding the last item, I believe you did not notice that in (29) you were comparing different components of Christoffel because you are not using mathematical notation (that is, extended typesetting), that shows contravariant indices as superscripts. So for that purpose:

• 

Use mathematical notation, via Setup( mathematicalnotation = true );

 

To the side of all this, in the PS you added a comment on the convention for the signature. Physics has a default value, that you can query via

Setup(signature)

[signature = `- +`]

(33)

But you can choose the reverse value (with more than 2 dimensions, there are actually four possible values for the signature). To change the signature use

Setup(signature = `+ -`)

[signature = `+ -`]

(34)

Check the metric

g_[]

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

(35)

Compare with (3)

"?"

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

(36)

So if you want the metric to be redefined according to this change in signature, see the Redefine  command. First check if this is what you want:

Redefine(metric, fromsignature = `-+`)

Matrix(%id = 18446744078421877214)

(37)

If this is what you want, then you can set it via Setup(metric = (37)) or directly copying the line above and adding the keyword setmetric

Redefine(metric, fromsignature = `-+`, setmetric)

Matrix(%id = 18446744078421866006)

(38)

Try it

g_[]

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

(39)

"Christoffel[~1,mu,nu,matrix]"

Physics:-Christoffel[`~1`, mu, nu] = Matrix(%id = 18446744078323150846)

(40)

``


 

Download Riemann-Scalar_for_Torus_MaplePrimes_(reviewed).mw


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

Hi Rahinui,

This one is also fixed, the fix works only in Maple 2018 and is available to everybody within the Maple 2018: Updates to Physics Differential Equations and Mathematical Functions, now distributed through the MapleCloud.

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

Hi Rahinui,

This one was a typo (too stringent restriction) to the arguments allowed as solving variables. It would have worked if you had entered A instead of A(). Anyway, it's fixed; the fix works only in Maple 2018 and is available to everybody within the Maple 2018: Updates to Physics Differential Equations and Mathematical Functions, now distributed through the MapleCloud.

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

 

Hi Rahinui

There is clearly an issue here. Anyway, a workaround is 

> PDEtools:-Solve(eq);
                                       {a = 0, c = c, r = 0}

and

 > PDEtools:-Solve(eq, {{c, r}});
                                 {c = 0, r = a}, {c = Pi, r = -a}

 

Now, indicating the unknowns as a double set or double list should not be necessary in this case. I will fix this in the next update for Maple 2018 distributed from the MapleCloud.

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

Here is a grey issue: in the Physics package, d_ is, more often than otherwise, used indexed as in d_[mu](A(x)), and as such it is a partial differential operator. At some point, this functionality got extended so that d_(A(x)) represents the total differential  of A(x), and summing over the repeated indices you see d_(x) popping around, displayed as `∂`(x)

 

with(Physics); Coordinates(cartesian, quiet)

{X}

(1)

d_(A(x))

Physics:-d_[mu](A(x), [X])*Physics:-d_((X)[`~mu`])

(2)

SumOverRepeatedIndices(Physics[d_][mu](A(x), [X])*Physics[d_]((X)[`~mu`]))

(diff(A(x), x))*Physics:-d_(x)

(3)

The question is whether to display the d-ronde in (3) as a straight d, as we see in textbooks for the total differential of x. There are two inconveniences:

 

1) the same command would have two different displays (easy to implement, but may be confusing, although we already have this kind of different display implemented in diff);

 

"2) d(x)" may mislead people into using d(x) as input to represent d_(x) which of course won't work, while displaying it as a `∂`(x) makes it clear that what you are looking at is not just d(x).

 

Also, introducing a single letter command 'd' for this purpose is not a good idea in general (to mention but one, the existence of D as Maple command is a historical inconvenience).

 

So, any ideas? Taking everything into account, is it d(x) better than `∂`(x)as the display for the total derivative of x that in Physics is implemented as d_(x)? 

 


 

Download d-ronde_or_d-straight.mw

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

For a Minkowski spacetime, we know, without even starting to write anything, that all the Christoffel symbols are equal to 0 and therefore everything that depends on them is too. To go ahead with tensor computations in a flat space as if the space were not flat would not be good.

Then, for a Schwarzschild metric, not only some of the Christoffel symbols are not zero but some of the Ricci rotation coefficients are also not zero. For example, 

So, in this case, it would be wrong to automatically set these rotation coefficients to 0, that is why "not also for Schwarzschild?".

Now, zero recognition "in advance" (this is what is implemented in the Physics code) is non-trivial, as it is zero-recognition in general, so the code does not aim for absolute performance regarding this, and you may find a way to enter a metric where the Christoffel symbols are actually all equal to zero but that is not obvious even after simplifying them. In these case, not wrong, the code will not automatically set everything that is Christoffel related to zero automatically.

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


 

restart

As explained in the LeviCivita  and Setup  help pages (I see you are aware of this), the default setting for LeviCivita is galilean also in a curved spacetime; set for instance, as usual, the simplest case for experimentations, a Schwarzschild metric

with(Physics)

g_[sc]

`Systems of spacetime Coordinates are: `*{X = (r, theta, phi, t)}

 

`Default differentiation variables for d_, D_ and dAlembertian are: `*{X = (r, theta, phi, t)}

 

`The Schwarzschild metric in coordinates `[r, theta, phi, t]

 

`Parameters: `[m]

 

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

(1)

We have (check the symbol on the left-hand side, a lowercase "`ε`)"

LeviCivita[nonzero]

Physics:-LeviCivita[alpha, beta, mu, nu] = {(1, 2, 3, 4) = 1, (1, 2, 4, 3) = -1, (1, 3, 2, 4) = -1, (1, 3, 4, 2) = 1, (1, 4, 2, 3) = 1, (1, 4, 3, 2) = -1, (2, 1, 3, 4) = -1, (2, 1, 4, 3) = 1, (2, 3, 1, 4) = 1, (2, 3, 4, 1) = -1, (2, 4, 1, 3) = -1, (2, 4, 3, 1) = 1, (3, 1, 2, 4) = 1, (3, 1, 4, 2) = -1, (3, 2, 1, 4) = -1, (3, 2, 4, 1) = 1, (3, 4, 1, 2) = 1, (3, 4, 2, 1) = -1, (4, 1, 2, 3) = -1, (4, 1, 3, 2) = 1, (4, 2, 1, 3) = 1, (4, 2, 3, 1) = -1, (4, 3, 1, 2) = -1, (4, 3, 2, 1) = 1}

(2)

Here is the key to the answer to your question: Set a new tensor with these values. For visual purposes, I will use ε that I take from the palettes (Greek symbols). To avoid having to use the palette all the time, you can use a macro

macro(ge = epsilon)

Among other ways, perhaps the simplest approach is to indicate the right-hand side of the definition as an Array

Define(ge[alpha, beta, mu, nu] = Array(`$`(1 .. 4, 4), rhs(Physics[LeviCivita][alpha, beta, mu, nu] = {(1, 2, 3, 4) = 1, (1, 2, 4, 3) = -1, (1, 3, 2, 4) = -1, (1, 3, 4, 2) = 1, (1, 4, 2, 3) = 1, (1, 4, 3, 2) = -1, (2, 1, 3, 4) = -1, (2, 1, 4, 3) = 1, (2, 3, 1, 4) = 1, (2, 3, 4, 1) = -1, (2, 4, 1, 3) = -1, (2, 4, 3, 1) = 1, (3, 1, 2, 4) = 1, (3, 1, 4, 2) = -1, (3, 2, 1, 4) = -1, (3, 2, 4, 1) = 1, (3, 4, 1, 2) = 1, (3, 4, 2, 1) = -1, (4, 1, 2, 3) = -1, (4, 1, 3, 2) = 1, (4, 2, 1, 3) = 1, (4, 2, 3, 1) = -1, (4, 3, 1, 2) = -1, (4, 3, 2, 1) = 1})))

`Defined objects with tensor properties`

 

{Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], varepsilon[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(3)

You see the new tensor at the right-end., and now you are free to set the default LeviCivita to be nongalilean while keeping epsilon to represent the galilean one.

Setup(levi = nongalilean)

`* Partial match of  'levi' against keyword 'levicivita'`

 

[levicivita = nongalilean]

(4)

Check the nonzero components of both tensors

LeviCivita[nonzero]

Physics:-LeviCivita[alpha, beta, mu, nu] = {(1, 2, 3, 4) = r^2*abs(sin(theta)), (1, 2, 4, 3) = -r^2*abs(sin(theta)), (1, 3, 2, 4) = -r^2*abs(sin(theta)), (1, 3, 4, 2) = r^2*abs(sin(theta)), (1, 4, 2, 3) = r^2*abs(sin(theta)), (1, 4, 3, 2) = -r^2*abs(sin(theta)), (2, 1, 3, 4) = -r^2*abs(sin(theta)), (2, 1, 4, 3) = r^2*abs(sin(theta)), (2, 3, 1, 4) = r^2*abs(sin(theta)), (2, 3, 4, 1) = -r^2*abs(sin(theta)), (2, 4, 1, 3) = -r^2*abs(sin(theta)), (2, 4, 3, 1) = r^2*abs(sin(theta)), (3, 1, 2, 4) = r^2*abs(sin(theta)), (3, 1, 4, 2) = -r^2*abs(sin(theta)), (3, 2, 1, 4) = -r^2*abs(sin(theta)), (3, 2, 4, 1) = r^2*abs(sin(theta)), (3, 4, 1, 2) = r^2*abs(sin(theta)), (3, 4, 2, 1) = -r^2*abs(sin(theta)), (4, 1, 2, 3) = -r^2*abs(sin(theta)), (4, 1, 3, 2) = r^2*abs(sin(theta)), (4, 2, 1, 3) = r^2*abs(sin(theta)), (4, 2, 3, 1) = -r^2*abs(sin(theta)), (4, 3, 1, 2) = -r^2*abs(sin(theta)), (4, 3, 2, 1) = r^2*abs(sin(theta))}

(5)

ge[nonzero]

varepsilon[mu, nu, alpha, beta] = {(1, 2, 3, 4) = 1, (1, 2, 4, 3) = -1, (1, 3, 2, 4) = -1, (1, 3, 4, 2) = 1, (1, 4, 2, 3) = 1, (1, 4, 3, 2) = -1, (2, 1, 3, 4) = -1, (2, 1, 4, 3) = 1, (2, 3, 1, 4) = 1, (2, 3, 4, 1) = -1, (2, 4, 1, 3) = -1, (2, 4, 3, 1) = 1, (3, 1, 2, 4) = 1, (3, 1, 4, 2) = -1, (3, 2, 1, 4) = -1, (3, 2, 4, 1) = 1, (3, 4, 1, 2) = 1, (3, 4, 2, 1) = -1, (4, 1, 2, 3) = -1, (4, 1, 3, 2) = 1, (4, 2, 1, 3) = 1, (4, 2, 3, 1) = -1, (4, 3, 1, 2) = -1, (4, 3, 2, 1) = 1}

(6)

Of course, you can, as well, do it the other way around: define one tensor with the components of the nongalilean, then set LeviCivita to be the galilean one.


 

Download Galilean_and_non_Galilean_LeviCivita.mw

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


 

restart

with(Physics); with(Tetrads)

`Setting lowercaselatin_ah letters to represent tetrad indices `

 

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

 

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

(1)

Load (diff(Schwarzschild(x), x))*s solution (the simpler way)

g_[sc]

`Systems of spacetime Coordinates are: `*{X = (r, theta, phi, t)}

 

`Default differentiation variables for d_, D_ and dAlembertian are: `*{X = (r, theta, phi, t)}

 

`The Schwarzschild metric in coordinates `[r, theta, phi, t]

 

`Parameters: `[m]

 

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

(2)

First on

%e_[mu, a] = e_[a, mu]

%e_[mu, a] = Physics:-Tetrads:-e_[a, mu]

(3)

for which you say it is "according to Maple" and  "a notational choice I do not find reassuring"

 

It is not according to Maple and it is not a notational choice, but an identity.

 

To see that, consider the product of the spacetime metric with a tetrad with tetradic index in position 1

"g[mu,nu] `𝔢`[a]^(nu)"

Physics:-g_[mu, nu]*Physics:-Tetrads:-e_[a, `~nu`]

(4)

Both g[mu, nu] and "`𝔢`[a]^(nu)" act by replacing contracted indices. So on the one hand g[mu, nu] replaces the contravariant nu in "`𝔢`[a]^(nu)" resulting in `𝔢`[a, mu]. Then, on the other hand, "`𝔢`[a]^(nu)" replaces the covariant nu in g[mu, nu] by a, resulting in `𝔢`[mu, a].

So

 `𝔢`[mu, a] = `𝔢`[a, mu]

 

This looks clear to me but, if not for you, then depart from expressing `𝔢`[mu, a] as the product of three tetrads all of which have the 1st index tetradic

%e_[mu, a] = e_[b, mu]*e_[a, nu]*e_[b, nu]

%e_[mu, a] = Physics:-Tetrads:-e_[b, mu]*Physics:-Tetrads:-e_[a, nu]*Physics:-Tetrads:-e_[`~b`, `~nu`]

(5)

This equation (5) is correct: on the right-hand side, the first tetrad acting on the third tetrad produces "`𝔢`[mu]^(nu)" , then the second tetrad acting on  "`𝔢`[mu]^(nu)" products `𝔢`[mu, a].

On the other hand, the third tetrad acting on the first tetrad produces "`𝔢`[mu]^(nu)", then the second tetrad acting "`𝔢`[mu]^(nu)" produces`𝔢`[a, mu].

 

So again  `𝔢`[mu, a] = `𝔢`[a, mu]

 

lhs(%e_[mu, a] = Physics:-Tetrads:-e_[b, mu]*Physics:-Tetrads:-e_[a, nu]*Physics:-Tetrads:-e_[`~b`, `~nu`]) = Simplify(rhs(%e_[mu, a] = Physics:-Tetrads:-e_[b, mu]*Physics:-Tetrads:-e_[a, nu]*Physics:-Tetrads:-e_[`~b`, `~nu`]))

%e_[mu, a] = Physics:-Tetrads:-e_[a, mu]

(6)

In summary, no, this is not just "for Maple" and this is not a notational issue.

 

Then as usual in computer algebra, when you have two things that are the same but can be written differently, it is important to normalize them rewriting them automatically into one single way so that the system is able to perform zero recognition. Indeed, the tetradic index is always automatically (re)located in position 1:

e_[mu, a]

Physics:-Tetrads:-e_[a, mu]

(7)

Now on the real problem of your post: when you execute

expr := D_[`~mu`](e_[mu, a])

Physics:-D_[`~mu`](Physics:-Tetrads:-e_[a, mu], [X])

(8)

You see that your input contains mu, the spacetime index, in position 1 but the output has mu in position 2 - the output is normalized with the tetradic index always in position 1. All correct and as designed. And so, this is also correct

seq(simplify(SumOverRepeatedIndices(expr)), a = 1 .. 4)

-I*(3*m-2*r)/((-r+2*m)^(1/2)*r^(3/2)), -cos(theta)/(r*sin(theta)), 0, 0

(9)

The problem (for the Physics code you have) with the next input you got:

NULL

0, 0, 0, 0

(10)

is that, if you look closer:

    a) your input has mu in position 1, and

    b) due to the special evaluation rules of seq , the sequence is built before any function is evaluated (that is very useful in some cases, but can easily become a problem in other cases, as for instance the well known situations where results obtained with sum and add are not equal (due to the same different evaluation rule of add, which is the same rule of seq)

 

But the example is good, since the computational flow hit a place in an internal subroutine that assumed that the tetrad had its indices normalized (tetradic in position 1, spacetime in position 2), but that was not the case (due to the tricky evaluation rules of seq that first performs the sequence, then evaluates the functions present before evaluating their arguments).

 

The solution is to add a couple of checks in key points to assure that unnormalized tetrad indces are normalized before proceeding with operations. With the fix in place, for your second sequence you get of course the same you get for the first sequence:

seq(simplify(SumOverRepeatedIndices(D_[`~mu`](e_[mu, a]))), a = 1 .. 4)

-I*(3*m-2*r)/((-r+2*m)^(1/2)*r^(3/2)), -cos(theta)/(r*sin(theta)), 0, 0

(11)

This adjustment to guard against a spactime index in position one combined with evaluation rules that doesn't allow normalization of the order of the indices in the tetrads  is a usual available for download to everybody from the Maplesoft R&D Physics webpage.

``


 

Download e_[mu_a]_=_e_[a_mu].mw

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


 

with(Physics); with(Tetrads)

So regarding your first question, Physics and Tetrads are loaded and you have a 2x2 matrix, E, representing some tetrad in some locally inertial system of references, for example

E := Matrix(4, 4, {(1, 1) = -I*sqrt(r)/sqrt(-r+2*m), (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = r, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = r*sin(theta), (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = -I*sqrt(-r+2*m)/sqrt(r)})

 and you want the metric. You know that

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

Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[`~a`, nu]

(1)

Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[`~a`, nu] = Simplify(Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[`~a`, nu])

Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[`~a`, nu] = Physics:-g_[mu, nu]

(2)

So define a mixed tensor - say e - representing your tetrad using your matrix E

Define(e[a, mu] = E, quiet)

 

Hence from (2) this is your metric

G := TensorArray(e[a, mu]*e[`~a`, nu])

Matrix(%id = 18446744078328341798)

(3)

 (that you recognize it is (diff(Schwarzschild(x), x))*s*metric, according to my choice of E the starting point).

 

If you now want everything set on background using this metric derived from your tetrad E (so the Christoffel symbols and everything else that is derived from them) just set this metric

Setup(g_[mu, nu] = G)

[metric = {(1, 1) = r/(-r+2*m), (2, 2) = -r^2, (3, 3) = -r^2*sin(theta)^2, (4, 4) = (r-2*m)/r}]

(4)

And that is all.

 

Regarding your second question, the notation is standard and I don't know what you mean by "cannot move the vierbein through a partial derivative". What I see is this: you can either work with Christoffel using this notation, or may prefer to work with the Ricci rotation coefficients (true tensors in the local system of references)

 

The Ricci rotation coefficients are represented by Tetrads:-gamma_ , so from their definition (see (98.9) in Landau's book)

gamma_[definition]

Physics:-Tetrads:-gamma_[a, b, c] = Physics:-D_[nu](Physics:-Tetrads:-e_[a, mu])*Physics:-Tetrads:-e_[b, `~mu`]*Physics:-Tetrads:-e_[c, `~nu`]

(5)

expand(Physics:-Tetrads:-gamma_[a, b, c] = Physics[D_][nu](Physics:-Tetrads:-e_[a, mu])*Physics:-Tetrads:-e_[b, `~mu`]*Physics:-Tetrads:-e_[c, `~nu`])

Physics:-Tetrads:-gamma_[a, b, c] = Physics:-Tetrads:-e_[b, `~mu`]*Physics:-Tetrads:-e_[c, `~nu`]*Physics:-d_[nu](Physics:-Tetrads:-e_[a, mu], [X])-Physics:-Tetrads:-e_[b, `~mu`]*Physics:-Tetrads:-e_[c, `~nu`]*Physics:-Christoffel[`~alpha`, mu, nu]*Physics:-Tetrads:-e_[a, alpha]

(6)

Simplify(Physics:-Tetrads:-gamma_[a, b, c] = Physics:-Tetrads:-e_[b, `~mu`]*Physics:-Tetrads:-e_[c, `~nu`]*Physics[d_][nu](Physics:-Tetrads:-e_[a, mu], [X])-Physics:-Tetrads:-e_[b, `~mu`]*Physics:-Tetrads:-e_[c, `~nu`]*Physics[Christoffel][`~alpha`, mu, nu]*Physics:-Tetrads:-e_[a, alpha])

Physics:-Tetrads:-gamma_[a, b, c] = Physics:-d_[c](Physics:-Tetrads:-e_[a, mu], [X])*Physics:-Tetrads:-e_[b, `~mu`]-Physics:-Christoffel[a, b, c]

(7)

isolate(Physics:-Tetrads:-gamma_[a, b, c] = Physics[d_][c](Physics:-Tetrads:-e_[a, mu], [X])*Physics:-Tetrads:-e_[b, `~mu`]-Physics[Christoffel][a, b, c], Christoffel[a, b, c])

Physics:-Christoffel[a, b, c] = -Physics:-Tetrads:-gamma_[a, b, c]+Physics:-d_[c](Physics:-Tetrads:-e_[a, mu], [X])*Physics:-Tetrads:-e_[b, `~mu`]

(8)

And that gives you the relationship between the GAMMA[a, b, c] and the tensor "gamma[a,b,c]." So if you prefer to work with the Ricci rotation coefficients gamma[a, b, c], from (7) and using SubstituteTensor  you can replace, in tensorial expressions, all occurrences of GAMMA[a, b, c] or  GAMMA[`~a`, b, c] by the corresponding tensorial Ricci coefficients "gamma[a,b,c]."

 

As for this identity (7) between the tensor gamma[a, b, c] and the non-covariant `∂`[c] and  GAMMA[a, b, c] you can always check it, as well as any other tensorial identity by taking lhs-rhs and computing components

TensorArray((lhs-rhs)(Physics:-Tetrads:-gamma_[a, b, c] = Physics[d_][c](Physics:-Tetrads:-e_[a, mu], [X])*Physics:-Tetrads:-e_[b, `~mu`]-Physics[Christoffel][a, b, c]), simplifier = simplify)

Array(%id = 18446744078434281822)

(9)

If this is an array of zeros, then its ArrayElems  is empty

"ArrayElems(?)"

{}

(10)

Alternatively, if you don't want Simplify to act on Christoffel, you can always replace it by the inert form

subs(Christoffel = %Christoffel, Physics:-Tetrads:-gamma_[a, b, c] = Physics:-Tetrads:-e_[b, `~mu`]*Physics:-Tetrads:-e_[c, `~nu`]*Physics[d_][nu](Physics:-Tetrads:-e_[a, mu], [X])-Physics:-Tetrads:-e_[b, `~mu`]*Physics:-Tetrads:-e_[c, `~nu`]*Physics[Christoffel][`~alpha`, mu, nu]*Physics:-Tetrads:-e_[a, alpha])

Physics:-Tetrads:-gamma_[a, b, c] = Physics:-Tetrads:-e_[b, `~mu`]*Physics:-Tetrads:-e_[c, `~nu`]*Physics:-d_[nu](Physics:-Tetrads:-e_[a, mu], [X])-Physics:-Tetrads:-e_[b, `~mu`]*Physics:-Tetrads:-e_[c, `~nu`]*%Christoffel[`~alpha`, mu, nu]*Physics:-Tetrads:-e_[a, alpha]

(11)

Simplify(Physics:-Tetrads:-gamma_[a, b, c] = Physics:-Tetrads:-e_[b, `~mu`]*Physics:-Tetrads:-e_[c, `~nu`]*Physics[d_][nu](Physics:-Tetrads:-e_[a, mu], [X])-Physics:-Tetrads:-e_[b, `~mu`]*Physics:-Tetrads:-e_[c, `~nu`]*%Christoffel[`~alpha`, mu, nu]*Physics:-Tetrads:-e_[a, alpha])

Physics:-Tetrads:-gamma_[a, b, c] = -Physics:-Tetrads:-e_[b, `~mu`]*Physics:-Tetrads:-e_[c, `~nu`]*%Christoffel[`~alpha`, mu, nu]*Physics:-Tetrads:-e_[a, alpha]+Physics:-d_[c](Physics:-Tetrads:-e_[a, mu], [X])*Physics:-Tetrads:-e_[b, `~mu`]

(12)

where you see the tetrad indices are not present in "`%Christoffel`[mu,nu]^(alpha)". Replacing back %Christoffel = Christoffel, isolating whatever part you want in (12) and using SubstituteTensor , generally speaking you can work with whatever object you prefer.

``


 

Download TetradsAndRicciRotationCoefficients.mw

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


 

Your ODE and ics

 

ode := diff(y(x), x) = sqrt((2*32.2)*y(x))
ics := y(0) = 0

 

dsolve's output, as you noticed

dsolve({ics, ode})

y(x) = 0

(1)

But this output is correct, it cancels the ODE and satisfies your initial conditions

eval(ode, y(x) = 0)

0 = 0.

(2)

eval(y(x) = 0, x = 0)

y(0) = 0

(3)

To obtain this correct solution, dsolve takes as much of shortcuts as possible.

 

Now, it so happens that your problem (and this frequently happens when there is a sqrt of the dependent variable) admits more than one solution. (Note that, generally speaking, when the ODE differential order is equal to the number of initial/boundary conditions, a well defined problem has a unique solution.)

 

In ic/bv problems like this one, to obtain one of the different correct solutions you can use dsolve's option usesolutions to indicate which solution should be used to match the given initial/boundary conditions; to skip all the easy cases that dsolve detects at no cost (in the above that resulted in (1)), ask dsolve to use the general solution as departure point, i.e. skip the detection of easy cases.

dsolve({ics, ode}, usesolutions = "general")

y(x) = (64399999998466401481/4000000000000000000)*x^2

(4)


 

Download nothing_wrong_with_dsolve.mw

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

First 31 32 33 34 35 36 37 Last Page 33 of 59