ecterrab

14757 Reputation

24 Badges

20 years, 355 days

MaplePrimes Activity


These are replies submitted by ecterrab

Dear Alan,

Just to say that your post is not only very well written, but also inspiring. I really enjoyed reading it. Indeed computer algebra can substantialy change the dynamics of our work, engiineering in your case, theoretical physics in mine. Few people realize this in full though, to the point of verbalizing it so clearly. Not only the algebraic computations involved in our work can become rather tedious when done with paper and pencil, but also sometimes they are almost impossible in practice. Using computers for these purposes one moves from that situation to one where the algebraic computations involved actually become great fun, spiced up with the ability to perform all sorts of explorations to the sides - not to mention playing with the formulation at will, without the penality of having to redo by hand all the computations. This is a real game changer. And yes, it is not just computer algebra: Maple is indeed a great system, and particularly so at the time of computing symbolic solutions to differential equations.

All the best

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

@Carl Love 

Just a note on your post: there is one solution for theta(y), and two solutions for u(y) depending on theta(y). In these cases the design is to return the way you see, without composing the solutions automatically, so that one can understand how the two really explicit solutions to this problem could be constructed. And after you have the whole picture, to have really explicit solutins returned you can use the option 'explicit'  (say as in dsolve([...], explicit)) and you will see the equivalent of having inserted the value of theta(y) into the two posible solutions for u(y).

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

@Michael_Watson 

Great to know that you also found that the computation by Maple is correct. But your original post focused again on a design dllema for the covariant derivative ... Recalling, you tried to check your result computing one term at a time summing over repeated indices, resulting in the computation of things like D_[2](e_[3,4]), thinking that

     D_[2](e_[3,4])  =  eval( D_[mu](e_[a, nu]), [mu=2, a=3, nu=4] ).

It is a natural to do what you did, we compute with paper and pencil in that way. For the computer, however, these two were different: the computation on the right-hand side has one Christoffel symbol term, related to the tensorial character of e_[a, nu] with one spacetime index, while the computation on the left-hand side missed that term. Why? Because in a computer algebra worksheet things are evaluated from inside to outside, and because e_[3,4] has a scalar value, say f(x), (i.e the component [3,4] of e_[a,b], itself, is not a tensor) then D_[2](f(x)) = d_(f(x)) (because there is no distinction between covariant and non-covariant derivatives when the derivand is not a tensor), and hence the Christoffel term related to the tensorial character of e_[a, nu] (the object behind the component e_[3,4]), don't show up.

This is one of those things that are tricky when using computer algebra ... Anyway, the fact is that the programming language is flexible enough to accomodate this situation, so it is now implemented: things like D_[2](e_[3,4])  are now interpreted as eval( D_[mu](e_[a, nu]), [mu=2, a=3, nu=4] ), and hence your approach for verifying your result now works as you (and I would have) expected, without missing the Christoffel terms, despite that computers normally evaluate things the other way around.

This development as well as several adjustments of different kinds are available for download as usual in the Maplesoft R&D Physics webpage.

 

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

@fre 

Yes, by all means you can do this computation using the DifferentialGeometry package too, and yes you can convert the Christoffel symbol to a tensor in the context of the DifferentialGeometry package as well, as Torre is showing above.

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

@krw2015 

I use GUI all the time, windows and Mac platforms, and since I started using Maple so many years ago. And no error whatsoever. I am using Maple 2015. What version of Maple are you using? From what you show, my guess is also that you may be using a mixture of libraries from different versions of Maple ... or perhaps you have an initialization file that is not compatible with the version of Maple that you are using. You can alwyas try entering > interface(typesetting = standard); then change 'standard' by 'extended' and see if the problem still happens. Anyway, until the problem is not reproducible there is no way to help, and if the problem is not reproducible then - somehow - some piece of information  is missing.

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

Hi

Could you please post a worksheet with the actual input lines that reproduce the problem you see? Independent of that, depending on what you want to do on general relativity, the Physics package may be more direct.

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

Michael

As said in the "Answer" above, Maple's output looks correct to me. So, what is then wrong in your worksheet? You seem to have verified things adding the components one by one .. and yet there is one mistake, easy to do when computing within a worksheet. You added the components for instance e_[4,2],

e_[4, 2]

Y(X)

(1)

You then compute

Physics:-D_[2](e_[4, 2])

diff(Y(X), zetabar)

(2)

The computational mistake is that since e_[4, 2] is a scalar, not a tensor, the Christoffel symbol is missing, i.e. D_ = d_, as you can see here:

'Physics:-D_[2](e_[4, 2]) = Physics:-d_[2](e_[4, 2])'

Physics:-D_[2](Physics:-Tetrads:-e_[4, 2]) = Physics:-d_[2](Physics:-Tetrads:-e_[4, 2])

(3)

%

diff(Y(X), zetabar) = diff(Y(X), zetabar)

(4)

In other words, what you computed adding the components one by one is not the definition of gamma_[4,2,3] but, actually that object after replacing the covariant derivative D_ by the non-covariant one d_, as in

subs(Physics:-D_ = Physics:-d_, 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)

Let's see:

Physics:-SumOverRepeatedIndices(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:-diff(Physics:-Tetrads:-e_[a, 1], zeta)*Physics:-Tetrads:-e_[b, `~1`]*Physics:-Tetrads:-e_[c, `~1`]+Physics:-diff(Physics:-Tetrads:-e_[a, 2], zeta)*Physics:-Tetrads:-e_[b, `~2`]*Physics:-Tetrads:-e_[c, `~1`]+Physics:-diff(Physics:-Tetrads:-e_[a, 3], zeta)*Physics:-Tetrads:-e_[b, `~3`]*Physics:-Tetrads:-e_[c, `~1`]+Physics:-diff(Physics:-Tetrads:-e_[a, 4], zeta)*Physics:-Tetrads:-e_[b, `~4`]*Physics:-Tetrads:-e_[c, `~1`]+Physics:-diff(Physics:-Tetrads:-e_[a, 1], zetabar)*Physics:-Tetrads:-e_[b, `~1`]*Physics:-Tetrads:-e_[c, `~2`]+Physics:-diff(Physics:-Tetrads:-e_[a, 2], zetabar)*Physics:-Tetrads:-e_[b, `~2`]*Physics:-Tetrads:-e_[c, `~2`]+Physics:-diff(Physics:-Tetrads:-e_[a, 3], zetabar)*Physics:-Tetrads:-e_[b, `~3`]*Physics:-Tetrads:-e_[c, `~2`]+Physics:-diff(Physics:-Tetrads:-e_[a, 4], zetabar)*Physics:-Tetrads:-e_[b, `~4`]*Physics:-Tetrads:-e_[c, `~2`]+Physics:-diff(Physics:-Tetrads:-e_[a, 1], u)*Physics:-Tetrads:-e_[b, `~1`]*Physics:-Tetrads:-e_[c, `~3`]+Physics:-diff(Physics:-Tetrads:-e_[a, 2], u)*Physics:-Tetrads:-e_[b, `~2`]*Physics:-Tetrads:-e_[c, `~3`]+Physics:-diff(Physics:-Tetrads:-e_[a, 3], u)*Physics:-Tetrads:-e_[b, `~3`]*Physics:-Tetrads:-e_[c, `~3`]+Physics:-diff(Physics:-Tetrads:-e_[a, 4], u)*Physics:-Tetrads:-e_[b, `~4`]*Physics:-Tetrads:-e_[c, `~3`]+Physics:-diff(Physics:-Tetrads:-e_[a, 1], v)*Physics:-Tetrads:-e_[b, `~1`]*Physics:-Tetrads:-e_[c, `~4`]+Physics:-diff(Physics:-Tetrads:-e_[a, 2], v)*Physics:-Tetrads:-e_[b, `~2`]*Physics:-Tetrads:-e_[c, `~4`]+Physics:-diff(Physics:-Tetrads:-e_[a, 3], v)*Physics:-Tetrads:-e_[b, `~3`]*Physics:-Tetrads:-e_[c, `~4`]+Physics:-diff(Physics:-Tetrads:-e_[a, 4], v)*Physics:-Tetrads:-e_[b, `~4`]*Physics:-Tetrads:-e_[c, `~4`]

(6)

Physics:-SubstituteTensorIndices([a = 4, b = 2, c = 3], Physics:-Tetrads:-gamma_[a, b, c] = Physics:-diff(Physics:-Tetrads:-e_[a, 1], zeta)*Physics:-Tetrads:-e_[b, `~1`]*Physics:-Tetrads:-e_[c, `~1`]+Physics:-diff(Physics:-Tetrads:-e_[a, 2], zeta)*Physics:-Tetrads:-e_[b, `~2`]*Physics:-Tetrads:-e_[c, `~1`]+Physics:-diff(Physics:-Tetrads:-e_[a, 3], zeta)*Physics:-Tetrads:-e_[b, `~3`]*Physics:-Tetrads:-e_[c, `~1`]+Physics:-diff(Physics:-Tetrads:-e_[a, 4], zeta)*Physics:-Tetrads:-e_[b, `~4`]*Physics:-Tetrads:-e_[c, `~1`]+Physics:-diff(Physics:-Tetrads:-e_[a, 1], zetabar)*Physics:-Tetrads:-e_[b, `~1`]*Physics:-Tetrads:-e_[c, `~2`]+Physics:-diff(Physics:-Tetrads:-e_[a, 2], zetabar)*Physics:-Tetrads:-e_[b, `~2`]*Physics:-Tetrads:-e_[c, `~2`]+Physics:-diff(Physics:-Tetrads:-e_[a, 3], zetabar)*Physics:-Tetrads:-e_[b, `~3`]*Physics:-Tetrads:-e_[c, `~2`]+Physics:-diff(Physics:-Tetrads:-e_[a, 4], zetabar)*Physics:-Tetrads:-e_[b, `~4`]*Physics:-Tetrads:-e_[c, `~2`]+Physics:-diff(Physics:-Tetrads:-e_[a, 1], u)*Physics:-Tetrads:-e_[b, `~1`]*Physics:-Tetrads:-e_[c, `~3`]+Physics:-diff(Physics:-Tetrads:-e_[a, 2], u)*Physics:-Tetrads:-e_[b, `~2`]*Physics:-Tetrads:-e_[c, `~3`]+Physics:-diff(Physics:-Tetrads:-e_[a, 3], u)*Physics:-Tetrads:-e_[b, `~3`]*Physics:-Tetrads:-e_[c, `~3`]+Physics:-diff(Physics:-Tetrads:-e_[a, 4], u)*Physics:-Tetrads:-e_[b, `~4`]*Physics:-Tetrads:-e_[c, `~3`]+Physics:-diff(Physics:-Tetrads:-e_[a, 1], v)*Physics:-Tetrads:-e_[b, `~1`]*Physics:-Tetrads:-e_[c, `~4`]+Physics:-diff(Physics:-Tetrads:-e_[a, 2], v)*Physics:-Tetrads:-e_[b, `~2`]*Physics:-Tetrads:-e_[c, `~4`]+Physics:-diff(Physics:-Tetrads:-e_[a, 3], v)*Physics:-Tetrads:-e_[b, `~3`]*Physics:-Tetrads:-e_[c, `~4`]+Physics:-diff(Physics:-Tetrads:-e_[a, 4], v)*Physics:-Tetrads:-e_[b, `~4`]*Physics:-Tetrads:-e_[c, `~4`])

diff(Y(X), u) = -H(X)*Y(X)*(diff(Y(X), zeta))-H(X)*(diff(Y(X), zetabar))*Ybar(X)+(diff(Y(X), u))*(H(X)*Y(X)*Ybar(X)+1)-H(X)*(diff(Y(X), v))

(7)

Of course the right-hand side is not correct, because it is constructed using d_, instead of D_. Hope this makes the answer to your question more complete. It is also convenient to first sum over the repeated indices, then take components, proceed in that order, not the opposite one.

Also relevant: when verifying tensorial expressions that involve covariant derivatives it is convenient to first rewrite everything in terms of non-covariant ones so that the Christoffe symbols get placed before the tensors being differentiated become "compoents" (scalars ).

For example:

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`]

(8)

convert(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:-d_)

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

(9)

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

simplify(Physics:-SubstituteTensorIndices([a = 4, b = 2, c = 3], long_expression))

diff(Y(X), u) = diff(Y(X), u)

(10)

In summary: the result computed by Maple is correct and, in your worksheet, the result you computed as "correct" is actually incorrect in that it entirely misses the term with the Christoffel symbols.

Download Question_about_Ricci_Rotation_Coefficients-2_(additional).mw

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

@trace 

Indeed there was a premature evaluation issue, it is fixed now (actually, fixed on Saturday), please update your Physics library downloading from the usual place, the Maplesoft R&D Physics webpage. Could you please let me know/confirm here that everything runs as expected? Thanks.

By the way, when you found an issue like this one it is faster if you could please send me an email to physics@maplesoft.com. This website has not automatic notifications per topic and I only see your posts if I open a browser and start scanning, as it happened now.

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

Preben is right, without further details all I can say is that this works correctly, as shown in this image

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

@Markiyan Hirnyk 

Indeed, when writing the answer I copied and pasted from trace's worksheet and didn't notice his typo, sin^2*theta instead of sin(theta)^2.. I included this correction now in the answer.

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

@Inacio 

Your first question is: "Is there a way to remove the test function Phi in a different way?"

Yes, you can use coeff, as shown in this image:

 

Your second question: "Can Maple rewrite the expression above like F[mu nu]Phi? Because I have define F[mu, nu] like d_[rho](A[nu]) - d_[nu](A[rho])."

Yes, you can use simplify taking equations into account (check the help page ?simplify/siderels), as shown in this other image; note I first match the indices, and alternatively you could also use SubstituteTensor (check its help page):

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

 

Hi Inacio,

 

This functionality required a bit more of time. What you were expecting is actually a full implementation of "operatorial algebraic expressions", that is, algebraic expressions where you multiply differential operators with the meaning of applying them to what come to their right.

 

In Computer Algebra Systems, however, there is a strong distinction between multiplication of algebraic objects and application of differential operators: the latter are implemented as function application, (a function name applied to arguments) not multiplication. Also, when computing by hand, we multiply from the right of a differential operator with the meaning of "it gets applied to all what comes to its right", while with computer algebra "function application" there is no way you can do that. To implement such a thing in computer algebra, it is necessary to do a careful mimicry of the paper and pencil computation, i.e. one where you tell when is that the product becomes application of the differential operator.

 

In brief, implementing the whole thing required changes in various places, starting with the produt operator, making all differential operators non-commutative objects under multiplication, etc. The result was worth: a very nice full implementation of operatorial expressions, something really interesting to have in place, mainly for computations of Physics - we compute that way all the time.

 

Going to your example, good for illustration purposes

restart

with(Physics):

 

Note the Physics version, from today, you need to update your Physics library from the Maplesoft R&D Physics webpage to have everything working as shown below:

Physics:-Version()

"/Users/ecterrab/Maple/lib/Physics2015.mla", `2015, April 16, 10:40 hours`

(1)

So, what follows is your worksheet with few changes to show how to use the new functionality (arriving at the results you were expecting for a Commutator involving sums of differential operators and functions of the coordinates)

 

Physics:-Setup(math = true, coord = X, diff = X, quiet):

Physics:-Define(A, quiet):

 

First, note that d_[mu] operators commute between themselves, but not with functions of the coordinates

 

Library:-Commute(Physics:-d_[mu], Physics:-d_[nu])

true

(2)

Library:-Commute(Physics:-d_[mu], A(X))

false

(3)

Library:-Commute(Physics:-d_[mu], A)

true

(4)

Now the commutator of a d_ operator with a function of the coordinates

Physics:-Commutator(Physics:-d_[mu], A[nu](X))

Physics:-Commutator(Physics:-d_[mu], A[nu](X))

(5)

Regarding the expansion of this commutator, I revised the experimental design of the previous reply for consistency: the product of an operator times a function is now expressed as a product (i.e. multiplication) instead of function application. 

expand(Physics:-Commutator(Physics:-d_[mu], A[nu](X)))

 

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

(6)

So in the above, you see `∂`[mu]*A[nu], not `∂`[mu](A[nu]), which would be the operator `∂`[mu] applied to A[nu]. This permits multiplying from the right and allowing to have the operator applied (a posteriori) to the product that gets formed to its right:

Physics:-`*`(Physics:-`*`(Physics:-d_[mu], A[nu](X))-Physics:-`*`(A[nu](X), Physics:-d_[mu]), Phi(X))

Physics:-`*`(Physics:-`*`(Physics:-d_[mu], A[nu](X))-Physics:-`*`(A[nu](X), Physics:-d_[mu]), Phi(X))

(7)

expand(Physics:-`*`(Physics:-`*`(Physics:-d_[mu], A[nu](X))-Physics:-`*`(A[nu](X), Physics:-d_[mu]), Phi(X)))

Physics:-`*`(Physics:-d_[mu], A[nu](X), Phi(X))-Physics:-`*`(A[nu](X), Physics:-d_[mu], Phi(X))

(8)

That is, in the above, you see `∂`[mu]*A[nu]*Phi, not `∂`[mu](A[nu])*Phi, which would be wrong (with `∂`[mu] applied only to A[nu])

 

Now we still want the function application of differential operators, not just their multiplication. This function aplication is now implemented using a new Physics:-Library command, called ApplyProductsOfDifferentialOperators. In this example, the multiplications of differential operators  you see in `∂`[mu]*A[nu]*Phi-`∂`[mu]*A[nu]*Phi get transformed into their application `∂`[mu](A[nu]*Phi)-A[nu]*`∂`[mu](Phi) that is, with the differential operators applied to all what comes to their right:

Library:-ApplyProductsOfDifferentialOperators(Physics:-`*`(Physics:-d_[mu], A[nu](X), Phi(X))-Physics:-`*`(A[nu](X), Physics:-d_[mu], Phi(X)))

Physics:-d_[mu](A[nu](X), [X])*Phi(X)

(9)

Likewise,

Library:-ApplyProductsOfDifferentialOperators(Physics:-`*`(Physics:-`*`(Physics:-d_[mu], A[nu](X))-Physics:-`*`(A[nu](X), Physics:-d_[mu]), Phi(X)))

Physics:-d_[mu](A[nu](X), [X])*Phi(X)

(10)

The dot operator also knows about these operatorial equations

Physics:-Commutator(Physics:-d_[mu], A[nu](X)).Phi(X)

Physics:-`*`(Physics:-Commutator(Physics:-d_[mu], A[nu](X)), Phi(X))

(11)

 

Commutator already knows about operatorial equations, this is your example

%Commutator(Physics:-d_[mu]+A[mu](X), Physics:-d_[nu]+A[nu](X))

%Commutator(Physics:-d_[mu]+A[mu](X), Physics:-d_[nu]+A[nu](X))

(12)

Note first that the commutator of differential operators is now handled

value(%Commutator(Physics:-d_[mu]+A[mu](X), Physics:-d_[nu]+A[nu](X)))

Physics:-Commutator(Physics:-d_[mu], A[nu](X))+Physics:-Commutator(A[mu](X), Physics:-d_[nu])

(13)

Their multiplication and application too:

Physics:-`*`(%Commutator(Physics:-d_[mu]+A[mu](X), Physics:-d_[nu]+A[nu](X)), Phi(X))

Physics:-`*`(%Commutator(Physics:-d_[mu]+A[mu](X), Physics:-d_[nu]+A[nu](X)), Phi(X))

(14)

expand(Physics:-`*`(%Commutator(Physics:-d_[mu]+A[mu](X), Physics:-d_[nu]+A[nu](X)), Phi(X)))

Physics:-`*`(Physics:-d_[mu], A[nu](X), Phi(X))+Physics:-`*`(A[mu](X), Physics:-d_[nu], Phi(X))-Physics:-`*`(Physics:-d_[nu], A[mu](X), Phi(X))-Physics:-`*`(A[nu](X), Physics:-d_[mu], Phi(X))

(15)

Library:-ApplyProductsOfDifferentialOperators(Physics:-`*`(Physics:-d_[mu], A[nu](X), Phi(X))+Physics:-`*`(A[mu](X), Physics:-d_[nu], Phi(X))-Physics:-`*`(Physics:-d_[nu], A[mu](X), Phi(X))-Physics:-`*`(A[nu](X), Physics:-d_[mu], Phi(X)))

Physics:-d_[mu](A[nu](X), [X])*Phi(X)-Physics:-d_[nu](A[mu](X), [X])*Phi(X)

(16)

factor(Physics:-d_[mu](A[nu](X), [X])*Phi(X)-Physics:-d_[nu](A[mu](X), [X])*Phi(X))

Phi(X)*(Physics:-d_[mu](A[nu](X), [X])-Physics:-d_[nu](A[mu](X), [X]))

(17)

The above is the result you were expecting. Likewise,

Physics:-`*`(Physics:-Commutator(Physics:-d_[mu], A[nu](X))+Physics:-Commutator(A[mu](X), Physics:-d_[nu]), Phi(X))

Physics:-`*`(Physics:-Commutator(Physics:-d_[mu], A[nu](X))+Physics:-Commutator(A[mu](X), Physics:-d_[nu]), Phi(X))

(18)

But a commutator where there are non-differential operands, cannot be "applied", so it remains as a product

Library:-ApplyProductsOfDifferentialOperators(expand(Physics:-`*`(Physics:-Commutator(Physics:-d_[mu], A[nu](X))+Physics:-Commutator(A[mu](X), Physics:-d_[nu]), Phi(X))))

Physics:-d_[mu](A[nu](X), [X])*Phi(X)-Physics:-d_[nu](A[mu](X), [X])*Phi(X)

(19)

expand(Physics:-`*`(Physics:-Commutator(Physics:-d_[mu], A[nu](X))+Physics:-Commutator(A[mu](X), Physics:-d_[nu]), Phi(X)))

Physics:-`*`(Physics:-d_[mu], A[nu](X), Phi(X))+Physics:-`*`(A[mu](X), Physics:-d_[nu], Phi(X))-Physics:-`*`(Physics:-d_[nu], A[mu](X), Phi(X))-Physics:-`*`(A[nu](X), Physics:-d_[mu], Phi(X))

(20)

Physics:-`*`(Physics:-`*`(Physics:-d_[mu], A[nu](X), Phi(X))+Physics:-`*`(A[mu](X), Physics:-d_[nu], Phi(X))-Physics:-`*`(Physics:-d_[nu], A[mu](X), Phi(X))-Physics:-`*`(A[nu](X), Physics:-d_[mu], Phi(X)), Phi(X))

Physics:-`*`(Physics:-`*`(Physics:-d_[mu], A[nu](X), Phi(X))+Physics:-`*`(A[mu](X), Physics:-d_[nu], Phi(X))-Physics:-`*`(Physics:-d_[nu], A[mu](X), Phi(X))-Physics:-`*`(A[nu](X), Physics:-d_[mu], Phi(X)), Phi(X))

(21)

Library:-ApplyProductsOfDifferentialOperators(Physics:-`*`(Physics:-`*`(Physics:-d_[mu], A[nu](X), Phi(X))+Physics:-`*`(A[mu](X), Physics:-d_[nu], Phi(X))-Physics:-`*`(Physics:-d_[nu], A[mu](X), Phi(X))-Physics:-`*`(A[nu](X), Physics:-d_[mu], Phi(X)), Phi(X)))

Physics:-d_[mu](A[nu](X), [X])*Phi(X)^2-Physics:-d_[nu](A[mu](X), [X])*Phi(X)^2

(22)

So regarding the expected result you mentioned:

 

"[(∂)[mu]+ A[mu], ( (∂)[nu])+ A[nu]]" Φ

 

= "[(∂)[mu],  (∂)[nu]]" Φ + "[(∂)[mu],  A[nu]]" Φ + "[A[mu],  (∂)[nu]]" Φ + [A[mu], A[nu]] Φ

 

= "(∂)[mu]" "(A[nu]Phi)-""A[nu] (∂)[mu]"Φ + "A[mu](∂)[nu]Phi - ""(∂)[nu]" A[mu]*Phi

 

= "((∂)[mu]""A[nu]-"" (∂)[nu]""A[mu])Phi"

 

 

You are correct and that is indeed what the code returns now (see above, equation (17)) and in this way this most general concept of operatorial expressions that involve products of differential operators and functions that can then be transformed into function application at any desired moment is now available, which is really great, and thanks for bringing the subject to focus.

``


Download Identidades_de_Bianchi_(reviewed_II).mw

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

@Carl Love 

I don't know to what several bugs you are referring but just to clarify: there was one bug in the numerical evaluation of HeunC fixed in Maple 18 or Maple 17 (can't remember now) and another in the numerical evaluation of HeunG fixed in Maple 16. In addition to that, for Maple 2015, a new algorithm for the numerical evaluation of the same function is available. So no I'd not blame the numerical evaluation of Heun functions, unless you have some information of wrong results that I am missing, of course.

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

@EugeneKalentev 

The Mapleprimes site manager answered me saying that the worksheet and reply "Easier using Physics", that you are asking, is lost in unrecoverable way. Fortunately, however, I've found an old TimeMachine backup of my older laptop actually containing this worksheet! I am amazed at how well this simple Macintosh TimeMachine backup system works. So I restored the worksheet and the answer, including a link to the worksheet, all in "Easier using Phyiscs".

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

Regarding commutators involving the differential operators of the Physics package (both d_[mu] and D_[mu]), the Commutator and AntiCommutator commands now work with them, including the case of vectorial operators. You need to update your Physics library from the Maplesoft R&D Physics webpage.

restart; with(Physics); with(Vectors)

The version of Physics is from today:

Physics:-Version()[2]

`2015, April 15, 8:34 hours`

(1)

Commutator of Nabla with a scalar function

Commutator(Nabla, A(x, y, z))

Physics:-Commutator(Physics:-Vectors:-Nabla, A(x, y, z))

(2)

expand(Physics[Commutator](Physics[Vectors][Nabla], A(x, y, z)))

Physics:-`*`(Physics:-Vectors:-Nabla, A(x, y, z))-Physics:-`*`(A(x, y, z), Physics:-Vectors:-Nabla)

(3)

Library:-ApplyProductsOfDifferentialOperators(Physics[`*`](Physics[Vectors][Nabla], A(x, y, z))-Physics[`*`](A(x, y, z), Physics[Vectors][Nabla]))

(diff(A(x, y, z), x))*_i+(diff(A(x, y, z), y))*_j+(diff(A(x, y, z), z))*_k-Physics:-`*`(A(x, y, z), Physics:-Vectors:-Nabla)

(4)

Commutator of Nabla with a vector function

Commutator(Nabla, A_(x, y, z))

Physics:-Commutator(Physics:-Vectors:-Nabla, A_(x, y, z))

(5)

expand(Physics[Commutator](Physics[Vectors][Nabla], A_(x, y, z)))

Physics:-Vectors:-Divergence(A_(x, y, z))-Physics:-Vectors:-`.`(A_(x, y, z), Physics:-Vectors:-Nabla)

(6)

Define A as a tensor

Define(A)

`Defined objects with tensor properties`

 

{A, Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu]}

(7)

Coordinates(X)

`Default differentiation variables for d_, D_ and dAlembertian are: `*{X = (x1, x2, x3, x4)}

 

`Systems of spacetime Coordinates are: `*{X = (x1, x2, x3, x4)}

 

{X}

(8)

Compact display for A

PDEtools:-declare(A(X))

A(x1, x2, x3, x4)*`will now be displayed as`*A

(9)

This commutator is from your worksheet

Commutator(d_[mu], A[nu](X))

Physics:-Commutator(Physics:-d_[mu], A[nu](X))

(10)

expand(Physics[Commutator](Physics[d_][mu], A[nu](X)))

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

(11)

So the order of the operands is respected: d_[mu] is now considered a non-commutative object with regards to multiplication. As usual you can query:

Library:-Commute(d_[mu], A[nu](X))

false

(12)

Library:-Commute(d_[mu], d_[nu])

true

(13)

Now, the title of your worksheet is 'identidades de Bianchi, so I guess you are talking of a curved spacetime? Set the spacetime to something curved then, for instance,

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]

 

g[mu, nu] = (Matrix(4, 4, {(1, 1) = r/(-r+2*m), (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 2) = -r^2, (2, 3) = 0, (2, 4) = 0, (3, 3) = -r^2*sin(theta)^2, (3, 4) = 0, (4, 4) = (r-2*m)/r}, storage = triangular[upper], shape = [symmetric]))

(14)

Check the commutation of the covariant derivatives

Library:-Commute(D_[mu], D_[nu])

false

(15)

Hence,

Commutator(D_[mu], D_[nu])

Physics:-Commutator(Physics:-D_[mu], Physics:-D_[nu])

(16)

expand(Physics[Commutator](Physics[D_][mu], Physics[D_][nu]))

Physics:-`*`(Physics:-D_[mu], Physics:-D_[nu])-Physics:-`*`(Physics:-D_[nu], Physics:-D_[mu])

(17)

Apply this expanded commutator to A[rho]

PDEtools:-declare(A(X))

A(r, theta, phi, t)*`will now be displayed as`*A

(18)

(Physics[`*`](Physics[D_][mu], Physics[D_][nu])-Physics[`*`](Physics[D_][nu], Physics[D_][mu]))*A[rho](X)

Physics:-`*`(Physics:-`*`(Physics:-D_[mu], Physics:-D_[nu])-Physics:-`*`(Physics:-D_[nu], Physics:-D_[mu]), A[rho](X))

(19)

Library:-ApplyProductsOfDifferentialOperators(Physics[`*`](Physics[`*`](Physics[D_][mu], Physics[D_][nu])-Physics[`*`](Physics[D_][nu], Physics[D_][mu]), A[rho](X)))

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

(20)

Likewise,

Library:-ApplyProductsOfDifferentialOperators(`𝒟`[mu]*`𝒟`[nu])

`@`(Physics:-D_[mu], Physics:-D_[nu])

(21)

Library:-ApplyProductsOfDifferentialOperators(Physics[`*`](Physics[D_][mu], Physics[D_][nu])-Physics[`*`](Physics[D_][nu], Physics[D_][mu]))

`@`(Physics:-D_[mu], Physics:-D_[nu])-`@`(Physics:-D_[nu], Physics:-D_[mu])

(22)

So now it is applying that you get the result

(`@`(Physics[D_][mu], Physics[D_][nu])-`@`(Physics[D_][nu], Physics[D_][mu]))(A[rho](X))

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

(23)

although you could have also multiplied, then applied

(`@`(Physics[D_][mu], Physics[D_][nu])-`@`(Physics[D_][nu], Physics[D_][mu]))*A[rho](X)

Physics:-`*`(`@`(Physics:-D_[mu], Physics:-D_[nu])-`@`(Physics:-D_[nu], Physics:-D_[mu]), A[rho](X))

(24)

Library:-ApplyProductsOfDifferentialOperators(Physics[`*`](`@`(Physics[D_][mu], Physics[D_][nu])-`@`(Physics[D_][nu], Physics[D_][mu]), A[rho](X)))

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

(25)

Get for instance the component 1,2,2 of this tensorial expression

T := TensorArray(Physics[D_][mu](Physics[D_][nu](A[rho](X), [X]), [X])-Physics[D_][nu](Physics[D_][mu](A[rho](X), [X]), [X]), simplifier = simplify)

T := Array(1..4, 1..4, 1..4, {(1, 1, 1) = 0, (1, 1, 2) = 0, (1, 1, 3) = 0, (1, 1, 4) = 0, (1, 2, 1) = A[2](r, theta, phi, t)*m/(r^2*(-r+2*m)), (1, 2, 2) = A[2](r, theta, phi, t)*m/(r^2*(-r+2*m)), (1, 2, 3) = A[2](r, theta, phi, t)*m/(r^2*(-r+2*m)), (1, 2, 4) = A[2](r, theta, phi, t)*m/(r^2*(-r+2*m)), (1, 3, 1) = A[3](r, theta, phi, t)*m/(r^2*(-r+2*m)), (1, 3, 2) = A[3](r, theta, phi, t)*m/(r^2*(-r+2*m)), (1, 3, 3) = A[3](r, theta, phi, t)*m/(r^2*(-r+2*m)), (1, 3, 4) = A[3](r, theta, phi, t)*m/(r^2*(-r+2*m)), (1, 4, 1) = -2*A[4](r, theta, phi, t)*m/(r^2*(-r+2*m)), (1, 4, 2) = -2*A[4](r, theta, phi, t)*m/(r^2*(-r+2*m)), (1, 4, 3) = -2*A[4](r, theta, phi, t)*m/(r^2*(-r+2*m)), (1, 4, 4) = -2*A[4](r, theta, phi, t)*m/(r^2*(-r+2*m)), (2, 1, 1) = -A[2](r, theta, phi, t)*m/(r^2*(-r+2*m)), (2, 1, 2) = -A[2](r, theta, phi, t)*m/(r^2*(-r+2*m)), (2, 1, 3) = -A[2](r, theta, phi, t)*m/(r^2*(-r+2*m)), (2, 1, 4) = -A[2](r, theta, phi, t)*m/(r^2*(-r+2*m)), (2, 2, 1) = 0, (2, 2, 2) = 0, (2, 2, 3) = 0, (2, 2, 4) = 0, (2, 3, 1) = 0, (2, 3, 2) = 0, (2, 3, 3) = 0, (2, 3, 4) = 0, (2, 4, 1) = 0, (2, 4, 2) = 0, (2, 4, 3) = 0, (2, 4, 4) = 0, (3, 1, 1) = -A[3](r, theta, phi, t)*m/(r^2*(-r+2*m)), (3, 1, 2) = -A[3](r, theta, phi, t)*m/(r^2*(-r+2*m)), (3, 1, 3) = -A[3](r, theta, phi, t)*m/(r^2*(-r+2*m)), (3, 1, 4) = -A[3](r, theta, phi, t)*m/(r^2*(-r+2*m)), (3, 2, 1) = 0, (3, 2, 2) = 0, (3, 2, 3) = 0, (3, 2, 4) = 0, (3, 3, 1) = 0, (3, 3, 2) = 0, (3, 3, 3) = 0, (3, 3, 4) = 0, (3, 4, 1) = 0, (3, 4, 2) = 0, (3, 4, 3) = 0, (3, 4, 4) = 0, (4, 1, 1) = 2*A[4](r, theta, phi, t)*m/(r^2*(-r+2*m)), (4, 1, 2) = 2*A[4](r, theta, phi, t)*m/(r^2*(-r+2*m)), (4, 1, 3) = 2*A[4](r, theta, phi, t)*m/(r^2*(-r+2*m)), (4, 1, 4) = 2*A[4](r, theta, phi, t)*m/(r^2*(-r+2*m)), (4, 2, 1) = 0, (4, 2, 2) = 0, (4, 2, 3) = 0, (4, 2, 4) = 0, (4, 3, 1) = 0, (4, 3, 2) = 0, (4, 3, 3) = 0, (4, 3, 4) = 0, (4, 4, 1) = 0, (4, 4, 2) = 0, (4, 4, 3) = 0, (4, 4, 4) = 0})

(26)

T[1, 2, 2]

A[1](X)*m/r

(27)

NULL


Download Commutator_and_d.mw

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

First 44 45 46 47 48 49 50 Last Page 46 of 65