ecterrab

14727 Reputation

24 Badges

20 years, 330 days

MaplePrimes Activity


These are replies submitted by ecterrab

@deniscr 
 

restart

with(Physics)

This is your line element / metric

`#msup(mi("ds"),mn("2"))` := -exp(2*v)*dt^2+exp(2*psi)*(-dt*omega-dx__2*q__2-dx__3*q__3+dphi)^2+exp(2*`μ__2`)*dx__2^2+exp(2*`μ__3`)*dx__3^2

-exp(2*v)*dt^2+exp(2*psi)*(-dt*omega-dx__2*q__2-dx__3*q__3+dphi)^2+exp(2*mu__2)*dx__2^2+exp(2*mu__3)*dx__3^2

(1)

I am "guessing" that the ordering for the coordinates is ["t,phi,`x__2`,`x__3`]" and this ordering is irrelevant when you indicate the line element but it is relevant when you indicate the tetrad as a matrix. So set the signature as you indicated, the coordinates using this ordering mentioned and the metric (I use the shortcut g_ instead of 'metric', it is all the same)

Setup(signature = -` + + +`, coordinates = (X = [t, phi, x__2, x__3]), g_ = `#msup(mi("ds"),mn("2"))`)

`* Partial match of  'coordinates' against keyword 'coordinatesystems'`

 

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

 

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

 

[coordinatesystems = {X}, metric = {(1, 1) = -exp(2*v)+exp(2*psi)*omega^2, (1, 2) = -exp(2*psi)*omega, (1, 3) = exp(2*psi)*omega*q__2, (1, 4) = exp(2*psi)*omega*q__3, (2, 2) = exp(2*psi), (2, 3) = -exp(2*psi)*q__2, (2, 4) = -exp(2*psi)*q__3, (3, 3) = exp(2*psi)*q__2^2+exp(2*mu__2), (3, 4) = exp(2*psi)*q__2*q__3, (4, 4) = exp(2*psi)*q__3^2+exp(2*mu__3)}, signature = `- + + +`]

(2)

Check the metric

g_[]

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

(3)

Is this the metric of your problem? Otherwise you need to revise the line element you showed.

 

Now on the tetrad

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

(4)

You know, the tetrad is defined up to a Lorenze rotation, so it can be written in infinitely many ways.

 

The defaults used by the Physics package are: an orthonormal tetrad system, so

eta_[]

Physics:-Tetrads:-eta_[a, b] = Matrix(%id = 18446744078139391742)

(5)

and this is according to what you show, and the definition of the tetrad is also as you mention in your post

e_[definition]

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

(6)

The value computed automatically by the package is just one possible value

e_[]

Physics:-Tetrads:-e_[a, mu] = Matrix(%id = 18446744078348784334)

(7)

You can verify that this is indeed a tetrad using the IsTetrad  command, that also indicates the type of tetrad

"IsTetrad(?)"

`Type of tetrad: orthonormal `

 

true

(8)

Alternatively you can directly verify the definition (6)

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

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

(9)

TensorArray(Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[b, `~mu`] = Physics:-Tetrads:-eta_[a, b], simplifier = simplify)

Matrix(%id = 18446744078348022838)

(10)

So indeed this is a tetrad.

 

Let's introduce now the tetrad you say "you need to get" and check first whether it is or not a tetrad:

Matrix(4, 4, [[-exp(v), 0, 0, 0], [-omega*exp(psi), exp(psi), -q__2*exp(psi), -q__3*exp(psi)], [0, 0, exp(`μ__2`), 0], [0, 0, 0, exp(`μ__3`)]])

Matrix(%id = 18446744078139386686)

(11)

According to the computer, your suggested tetrad is indeed a tetrad (so far so good)

"IsTetrad(?)"

`Type of tetrad: orthonormal `

 

true

(12)

Just for illustration / fun, one can verify this same thing in steps for instance defining a tensor with your suggested tetrad (11) (note that in the definition I indicate the mix of indices, spacetime and tetradic, in situations like this one this indication is relevant)

"T[a,mu] = ?"

T[a, mu] = Matrix(%id = 18446744078139386686)

(13)

"Define(?)"

`Defined objects with tensor properties`

 

{Physics:-Dgamma[mu], Physics:-Psigma[mu], T[a, mu], Physics:-d_[mu], Physics:-Tetrads:-e_[a, mu], Physics:-Tetrads:-eta_[a, b], Physics:-g_[mu, nu], Physics:-Tetrads:-gamma_[a, b, c], Physics:-Tetrads:-l_[mu], Physics:-Tetrads:-lambda_[a, b, c], Physics:-Tetrads:-m_[mu], Physics:-Tetrads:-mb_[mu], Physics:-Tetrads:-n_[mu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(14)

Check the components and definition

T[definition]

T[a, mu] = Matrix(%id = 18446744078348787334)

(15)

Verify now whether this satisfies the definition of a tetrad

subs(e_ = T, Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[b, `~mu`] = Physics:-Tetrads:-eta_[a, b])

T[a, mu]*T[b, `~mu`] = Physics:-Tetrads:-eta_[a, b]

(16)

TensorArray(T[a, mu]*T[b, `~mu`] = Physics:-Tetrads:-eta_[a, b], simplifier = simplify)

Matrix(%id = 18446744078142948526)

(17)

So this is all about finding a transformation that transforms the default tetrad into your tetrad (i.e. a reorientation of the axes of the tetrad (local) system of references). For that purpose you need to use the command TransformTetrad  (chek the help page); in view of the varied options of that command I understand finding this transformation should be not difficult. If however you have a problem with that please post again and we move from there (to move forward any computation it is useful to post it as a worksheet so that results can be reproduced and worked furthermore).


 

Download TetradComputation.mw

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

@John Fredsted 

I see you are using the Physics package and working with PDE systems involving anticommutative variables and functions, not quiet simple conserved currents ... To perform this kind of computation systematically and correctly (not just with a toy example) is the kind of thing I call non-trivial. As you may know, within Physics there is a rather ambitious command aiming at that kind of computation, called PerformOnAnticommutativeSystem. It is an experimental command, as explained in the help page. It works well by "either returns a correct result, or gives up explaining why is the problem out of its scope".

The Error message you show, however, points to "input restrictions that are too stringent". I fixed this now (already uploaded the fix to the Maplesoft R&D Physics webpage, this is the 8th update after Maple 2017 got released), but the problem still appears out of reach. I'm rather busy right now with further developments in the new in Maple 2017 Physics:-ThreePlusOne package but will return to this problem in a couple of days. Your example, and further ones you may end up bringing, are always helpful to tune this advanced code (tackling PDE systems that involve anticommutative variables and functions).

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

@John Fredsted 
In order to tell you something about the message you show or what happened in your calculation I'd need to see the input that produces that message.

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

@John Fredsted 


 

We are talking about the same thing.

restart; with(PDEtools)

declare((f, g)(x, y))

f(x, y)*`will now be displayed as`*f

 

g(x, y)*`will now be displayed as`*g

(1)

pde := (diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x))

(diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x))

(2)

Your pde is already a divergence: it satisfies Euler's equations

Euler(pde)

{0}

(3)

It also admits a rather general integrating factor, an arbitrary function of y, f*g:

IntegratingFactors(pde)

[_mu[1](x, y, f(x, y), g(x, y)) = _F1(y, g(x, y)*f(x, y))]

(4)

Check it out:

PDE := rhs(%[1])*pde

_F1(y, g(x, y)*f(x, y))*((diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x)))

(5)

Euler(PDE)

{0}

(6)

Now on the conserved currents

ConservedCurrents(pde)

[_J[x](x, y, f(x, y), g(x, y)) = Int(-(diff(_F1(x, y), y)), x)+_F2(y, g(x, y)*f(x, y)), _J[y](x, y, f(x, y), g(x, y)) = _F1(x, y)]

(7)

The above is of the form: ["`J__1`= ..., `J__2`= ...]". In your reply you write this current as the right-hand sides only, it is the same:

J := map(rhs, %)

[Int(-(diff(_F1(x, y), y)), x)+_F2(y, g(x, y)*f(x, y)), _F1(x, y)]

(8)

This result is correct, check it out:

diff(J[1], x)+diff(J[2], y)

(D[2](_F2))(y, g(x, y)*f(x, y))*((diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x)))

(9)

You see that this is equal to 0: it is the product of two factors, one of which is proportional to pde itself.

 

So this current not "almost gibberish" but just more general than the one you mentioned: [f(x, y)*g(x, y), 0]. Maple's result is correct for any value of the arbitrary mappings _F1 and _F2. The solution you posted is the one you get for _F1 = 0, _F2(y, f*g) = f*g 

 

To mention but one, just another example could be

J_bis := value(eval(J, [_F1 = `*`, _F2 = `+`]))

[-(1/2)*x^2+y+g(x, y)*f(x, y), x*y]

(10)

diff(J_bis[1], x)+diff(J_bis[2], y)

(diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x))

(11)

ReducedForm(%, pde)

`casesplit/ans`([0], [])

(12)

Instead of testing manually you can always test using ConservedCurrentTest

ConservedCurrentTest([-(1/2)*x^2+y+f(x, y)*g(x, y), x*y], pde)

{0}

(13)

On the weak side: ConservedCurrentTest doesn't return 0 for the general result, because reduced form gets confused with the D construction:

ConservedCurrentTest([_J[x](x, y, f(x, y), g(x, y)) = Int(-(diff(_F1(x, y), y)), x)+_F2(y, f(x, y)*g(x, y)), _J[y](x, y, f(x, y), g(x, y)) = _F1(x, y)], pde)

{(D[2](_F2))(y, g(x, y)*f(x, y))*((diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x)))}

(14)

But you see by eye that this is proportional to pde itself, therefore equal to zero.

 

About your more complicated examples you mention, I suggest you give them a try. Remember the format of the output of the form ["`J__1`= ..., `J__2`= ...]" and if you prefer to not display the functionality in the left-hand sides use

ConservedCurrents(pde, displayfunctionality = false)

[_J[x] = Int(-(diff(_F1(x, y), y)), x)+_F2(y, g(x, y)*f(x, y)), _J[y] = _F1(x, y)]

(15)

``


 

Download ConservedCurrentsIsOK.mw

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

@John Fredsted 

Given an expression - EE - as a differential expression (say of differential order k), compute a first integral, so another expression of differential order k-1 such that its total derivative is equal to the original expression EE. This is the general idea, also applicable to PDEs of course. In the case of ODEs, the command is DEtools[firint]. Complementary command: DEtools[intfactor]; related (say inverse) command: DEtools[redode];

In the PDE case, replace "total derivative" in the paragraph above by "divergence" and the command you need to give a look is PDEtools:-ConservedCurrents. Complementary commands are PDEtools:-ConservedCurrentTest, PDEtools:-IntegratingFactors and  PDEtools:-IntegratingFactorsTest. I never wrote the equivalent to redode for PDEs, but I explained the idea I used in sufficient details in the help page for redode ; it is not difficult to extend it to the PDE case.

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

@umar khan 

I only executed your worksheet: it works perfectly when indexing wiht 0 or ~0. I now intercalated some comments and attached it to this reply.

right_file_(reviewed).mw

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

@trace 

If what you want to do is to see the result of applying some transformation, then just pass that transformation to TransformCoordinates. Or, If what you want is to derive the transformation, see the help page of what's new in Physics in Maple 2017: I put an explicit example of that, ie resolving the equivalence bewteen two metrics.

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

@umar khan 

Maple results are correct. Your worksheet does not show a flow from top to bottom (if you execute it, you do not obtain what you show) so I do not know what you are doing, nor what of the many lines is supposed to be wrong.

So I produced a clean worksheet, attached to this reply (below) with only the computation you show in right_christoffel_symbol.pdf, showing that it suffices to enter the metric and the coordinates and you automatically get the right christoffel symbols and Ricci tensor.


 

restart

with(Physics)

Set the coordinates

Coordinates(spherical)

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

 

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

 

{X}

(1)

Input your metric

`#msup(mi("ds"),mn("2"))` := exp(2*v(r))*dt^2-exp(2*lambda(r))*dr^2-r^2*(dtheta^2+sin(theta)^2*dphi^2)

exp(2*v(r))*dt^2-exp(2*lambda(r))*dr^2-r^2*(dtheta^2+sin(theta)^2*dphi^2)

(2)

Setup(metric = exp(2*v(r))*dt^2-exp(2*lambda(r))*dr^2-r^2*(dtheta^2+sin(theta)^2*dphi^2))

[metric = {(1, 1) = -exp(2*lambda(r)), (2, 2) = -r^2, (3, 3) = -r^2*sin(theta)^2, (4, 4) = exp(2*v(r))}]

(3)

This is not necessary, but makes the display be as the one you show in your pdf 'right_christoffel_symbol.pdf

CompactDisplay(%)

lambda(r)*`will now be displayed as`*lambda

 

v(r)*`will now be displayed as`*v

(4)

CompactDisplay(prime = r)

`derivatives with respect to`*r*`of functions of one variable will now be displayed with '`

(5)

This are all the Christoffel symbols you show in the pdf, they are the same here and there:

"Christoffel[~1,alpha,beta,matrix]"

Physics:-Christoffel[`~1`, alpha, beta] = Matrix(%id = 18446744078302813470)

(6)

An these are the covariant components you show of the Ricci tensor

Ricci[]

Physics:-Ricci[mu, nu] = Matrix(%id = 18446744078389689390)

(7)

Finally, this is relationship you show in your pdf

Ricci[3, 3]-Ricci[2, 2]*sin(theta)^2

-sin(theta)^2*((diff(v(r), r))*exp(-2*lambda(r))*r-(diff(lambda(r), r))*exp(-2*lambda(r))*r+exp(-2*lambda(r))-1)-sin(theta)^2*(-(diff(v(r), r))*exp(-2*lambda(r))*r+(diff(lambda(r), r))*exp(-2*lambda(r))*r-exp(-2*lambda(r))+1)

(8)

simplify(%)

0

(9)

``


 

Download Maple_results_are_correct.mw

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

@umar khan 
To insert an equation label, you need to use the shortcut Ctrl + L (or Command + L on a Mac), followed by the equation number. For more details see the help page ?worksheet,expressions,equationlabels

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

@nm 

What you see in Maple 2017 is the correct result, in connection with an issue fixed after the help page was ready (unfortunately we forgot to update the help page - I will make sure the page gets updated regarding this fix for 2017.1).

About your other question, progress is made at every release, and with priority for what pops up in discussions or people use more. By the way: regarding this or other suggestions for improvements, easy or difficult, it is always useful to give a reference to any method you suggest to be implemented. Work will mostly always start there.

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

Hi
Thanks for pointing this out, this is indeed a bug, and it is now fixed. The fix is available for download for everyone at the Maplesoft R&D Differential Equations and Special Functions webpage (the special functions updates are bundled with the Physics updates).

By the way, I didn't try the Mathematica app you mention but if it evaluates this to 311/312, that result is wrong. The correct result is the one mentioned by Preben Alsholm: 71/72.

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

@John Fredsted 
Where is Physics:-`^` used in your question? What copy and paste are you referring to? Generally speaking: a) yes, Physics:-`^` is used when you enter powers, because there may be noncommutative operands at play, but as soon as the command detects they are not present, it returns the power expressed using :-`^`, that is the standard power operator that only handles commutative operands, so it is not expected to appear in the output of a GR computation (unless you use noncommutative operands ...) nor in the output of copy and paste, unless you are delaying the power surrounding  with quotes, as in 'A^B' or the like.

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

@deniscr 
I thought your question was about how to enter the parameter E: it is TransformTetrads who enters the parameter, it uses the letter E, and if E is already in use it uses E__1, if it is in use it uses E__2, and so on.
If your question is about "how to give E a value after it was entered in the worksheet by TransformTetrads", the answer is to use the subs or the eval commands, as in subs(E = 5, <here you refer to the output_of_TransformTetrads for instance using `%` or the equation number>), or eval with the same arguments swapped, or just assign E := 5 and use the output of TransformTetrads that automatically will take E = 5.

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

@illuminates 

Psigma[mu] is a tensor (4-vector), you can work with it as with any other tensor, and if uppercaselatin represents spacetime indices and you defined p as a tensor (Define(p)), then Psigma[A] p[A] is a valid tensorial expression with contracted indices. Try for instance SumOverRepeatedIndices(Psigma[A] p[A]) and you see the four Pauli matrices around

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

@illuminates 
In the help, search for 'labels' and you will see the third entry is about equation labels; scan the page with your eyes looking for enumerated items, the one with number 3 is the answer to your question: use Ctrl + L (or Command+L in the mac) to open a window where you write the number (not the opening and closing parenthesis - just the number), then press enter and in that way you insert an equation label. I find these equation labels one of the best features of the Maple GUI.

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

First 37 38 39 40 41 42 43 Last Page 39 of 65