ecterrab

14255 Reputation

24 Badges

19 years, 262 days

MaplePrimes Activity


These are answers submitted by ecterrab

I am curious about this question. The operations where having a dimension set is relevant are: to sum over the repeated indices or to see the tensor's components (not a closed tensorial expression but the actual components), both of which require, of course, a dimension set. So, if you want to perform computations regardless of the dimension, it suffices to have it set AND do not perform those two operations, which anyway would have no meaning unless you set a dimension. In summary, I do not see what computation you want to do without having a dimension set that you cannot do with the dimension set.

Can you clarify that? Or even better, post a worksheet where you show what you are trying to do that you cannot do now due to having a dimension set.

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

Hi
I was out of town, seeing this today. If something is posted, related to the Maplesoft Physics Updates, and I am not responding here, I suggest you email me at physics@maplesoft.com.

The problem you mention happens only with the non-default value kernelopts('assertlevel'=2), and the non-default method=_RETURNVERBOSE. It shouldn't, of course. But it sometimes can happen. Fixes in other areas of the Maple library (and new developments in the Physics package) are the contents of the Maplesoft Physics Updates. As mentioned other times, although having fixes in places right away significantly enhances the Maple experience, the fixes themselves sometimes require further touches. Your post here is an example.

Details.
Integrating fixes of the Maple library into the Maplesoft Physics Updates package includes complete testing against the test suite at Maplesoft. Also, these fixes are the ones already installed in the Maple library being developed at Maplesoft. Still, as it happens with software, a fix may pass OK when tested and still have an issue, which, when noted, gets fixed, and another test is added to the test suite to avoid recurring into the same problem.

When you install the Maplesoft Physics Updates, all the fixes to different areas of the Maple library included are automatically active, regardless of whether you input with(Physics). For this reason, people install it, occasionally finding a new issue (as in this case of your post); others may prefer to wait till the next Maple release and not have the ongoing fixes installed right away.

I will include a resolution for this new issue in the next version of the Physics Updates to be uploaded today or tomorrow.

______________________________________________________________

UPDATE Jan/18: The issue mentioned is resolved within the Maplesoft Physics Updates v.1642 just uploaded, or any newer version of it. As usual, to install it, open Maple and input Physics:-Version(latest).

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

For a system like this one, you can solve for x as a function of y then solve the remaining equation that involves only y, or the other way around. When you pass [x, y] you are stating an ordering. Type [y, x] and you see the reverse. Try with {x, y} or not indicating the dependent variables at all, and dsolve's internals will decide the ordering for you.

Besides answering your question, Kitonum remarked that both solutions are correct; yes, that is the case. Generally speaking, you can think of the 'decoupling mechanism' as reducing a coupled system of equations into a subsystem that involves only one unknown and equations that involve the rest. Solve the system for that single unknown and remove it from the starting problem.

Generally speaking, which unknown you remove first is just a matter of choice. For linear systems, like the one you show, @nm , any choice is (generally speaking ...) as good and so to speak, equivalent. For nonlinear systems, depending on which dependent variable you eliminate first, the choice can be a good one or, on the other extreme, disastrous. For both linear and nonlinear systems, you can indicate your preferred choice passing the unknowns as a list; this is explained in dsolve,details, also in the help pages of pdsolve. And if you don't pass the unknowns as a list, dsolve (and pdsolve) will decide for you according to several considerations that I skip here.

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

The help page for Physics:-Vectors and related pages/examples are clear, though they are all related to 3D vectors. If you want to work with 4D "vectors", that is what people frequently call a tensor of one index in that you don't have the traditional vectorial operations (as those found in Physics:-Vectors in 3D) in 4 dimensions.

About using Tensors (see the help page ?Physics,Tensors) you can always set the metric to Euclidean and don't need to fool around with raising and lowering indices. It is simpler than what is implied in what you said.

Moreover, even if the metric is not Euclidean, you also don't need to use contravariant and covariant indices: input everything with covariant indices and the translation of repeated indices into one covariant and the other contravariant is done automatically by the system. So you can, but you do not need to input contravariant indices.

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

If you use the Physics Maple package, just input Setup(signature), and check ?Setup to change the signature as you may prefer (any integer dimension above 1 is fine). If your question is in general, you need to diagonalize the metric and check the sign of its trace. See details e.g. in Metric signature explanation - Physics Stackexchange.

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

From the equations you show, I see you are using the Maplesoft Physics package, not grtensor (which is not from Maplesoft).

So, input Setup(usecoordinatesastensorindices = true), and after that T1[r, r], T1[t,t] give you the rr, tt components of T1, or for the case, of any tensor you define using the Define command with a tensorial equation as the ones you show (for details about that, see Sec 2.c of the help page ?Physics,Tensors)..

Alternatively, say r is the first coordinate in the list of coordinates (you see the ordering of the coordinates entering Coordinates()), and say t is the second one; then T1[1, 1] and T1[2, 2] give you the rr and tt components too.

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

Note that conjugate(a + b + c) does not automatically distribute over the sum. If that is what you want, in the Maple context, you need to use the expand command. It's been noted (see some of the replies) that being N* a vector, expand was required twice; you asked why: it was an oversight, and applying it only once should have sufficed. That is fixed within the Maplesoft Physics Updates v.1510 or newer. So now map(expand, N*) performs the expansion to the end. As usual, to install the Updates, open a worksheet and input Physics:-Version(latest);

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

One way to do that: substitute l_1 = l_1(k[1], k[2], k[3], a[1], a[2]),  l_2= l_2(.. same dependency as l_1 ...), etc., so indicate complete dependency on all the parameters. Then add the following differential equations: diff(l_1(k[1], k[2], k[3], a[1], a[2]), k[2]) = 0, diff(l_1(k[1], k[2], k[3], a[1], a[2]), k[2]) = 0, etc., the same for l__2(...), etc. where each "derivative = 0" indicates the "not dependency of each l_j on the parameters you say they don't depend". 

Now, you have augmented the system, formulating the problem correctly; now, call PDEtools:-Solve on that augmented system.

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

Hi,
This is now implemented and distributed within the Maplesoft Physics Updates v.1477 or newer. As usual, to install it, open the GUI and imput Physics:_Version(latest). The implementation is as follows:

  • The function being differentiated can have any number of variables.
  • The prime and dot display of derivatives is ON provided the derivative, which can be of any order (1st, 2nd, etc.), is not a mixed derivative. For mixed derivatives, e.g. diff(f(x, t), x, t), the display is as before this update.

The following is your worksheet plus comments, showing the new functionality at work.
 

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1478 and is the same as the version installed in this computer, created 2023, July 15, 11:58 hours Pacific Time.`

(1)

General metric

Lecture 5 in Math Prediction

NULL

NULL

restart

with(Physics); Setup(mathematicalnotation = true); Setup(signature = `+---`)

[signature = `+ - - -`]

(2)

ds2 := exp(v(r, t))*c^2*dt^2-exp(lambda(r, t))*dr^2-r^2*(da^2+sin(a)^2*dp^2)

exp(v(r, t))*c^2*dt^2-exp(lambda(r, t))*dr^2-r^2*(da^2+sin(a)^2*dp^2)

(3)

Setup(coordinatesystems = (Z = [t, r, a, p]), metric = ds2)

[coordinatesystems = {Z}, metric = {(1, 1) = exp(v(r, t))*c^2, (2, 2) = -exp(lambda(r, t)), (3, 3) = -r^2, (4, 4) = -r^2*sin(a)^2}, spaceindices = lowercaselatin_is]

(4)

Set a compact display of the functions entering the metric

CompactDisplay([coordinatesystems = {Z}, metric = {(1, 1) = exp(v(r, t))*c^2, (2, 2) = -exp(lambda(r, t)), (3, 3) = -r^2, (4, 4) = -r^2*sin(a)^2}, spaceindices = lowercaselatin_is])

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

(5)

When you load Physics, the prime is used for working with primed variables, so to use the prime to represent differentiation: turn ON the display of derivatives with respect to r using a prime

Typesetting:-Settings(useprime = true, typesetprime = true, prime = r)

 

This shows the functionality of v(r, t) and lambda(r, t)suppressed, due to the call to CompactDisplay above

g_[]

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

(6)

This shows first order derivatives with respect to r displayed with a prime, and derivatives with respect to t displayed with a dot

Christoffel[`~alpha`, mu, nu, nonzero]

Physics:-Christoffel[`~alpha`, mu, nu] = {(1, 1, 1) = (1/2)*(diff(v(r, t), t)), (1, 1, 2) = (1/2)*(diff(v(r, t), r)), (1, 2, 1) = (1/2)*(diff(v(r, t), r)), (1, 2, 2) = (1/2)*exp(-v(r, t)+lambda(r, t))*(diff(lambda(r, t), t))/c^2, (2, 1, 1) = (1/2)*c^2*exp(v(r, t)-lambda(r, t))*(diff(v(r, t), r)), (2, 1, 2) = (1/2)*(diff(lambda(r, t), t)), (2, 2, 1) = (1/2)*(diff(lambda(r, t), t)), (2, 2, 2) = (1/2)*(diff(lambda(r, t), r)), (2, 3, 3) = -exp(-lambda(r, t))*r, (2, 4, 4) = -exp(-lambda(r, t))*r*sin(a)^2, (3, 2, 3) = 1/r, (3, 3, 2) = 1/r, (3, 4, 4) = -sin(a)*cos(a), (4, 2, 4) = 1/r, (4, 3, 4) = cot(a), (4, 4, 2) = 1/r, (4, 4, 3) = cot(a)}

(7)

Also for second order derivatives

Ricci[nonzero]

Physics:-Ricci[mu, nu] = {(1, 1) = (1/4)*(2*c^2*((diff(diff(v(r, t), r), r))*r+(1/2)*(diff(v(r, t), r))*((diff(v(r, t), r))*r-(diff(lambda(r, t), r))*r+4))*exp(v(r, t)-lambda(r, t))-2*(diff(diff(lambda(r, t), t), t)-(1/2)*(diff(lambda(r, t), t))*(diff(v(r, t), t)-(diff(lambda(r, t), t))))*r)/r, (1, 2) = (diff(lambda(r, t), t))/r, (2, 1) = (diff(lambda(r, t), t))/r, (2, 2) = (1/4)*(2*(diff(diff(lambda(r, t), t), t)-(1/2)*(diff(lambda(r, t), t))*(diff(v(r, t), t)-(diff(lambda(r, t), t))))*r*exp(-v(r, t)+lambda(r, t))-2*c^2*((1/2)*r*(diff(v(r, t), r))^2-(1/2)*r*(diff(v(r, t), r))*(diff(lambda(r, t), r))+(diff(diff(v(r, t), r), r))*r-2*(diff(lambda(r, t), r))))/(c^2*r), (3, 3) = 1+(1/2)*(-(diff(v(r, t), r))*r+(diff(lambda(r, t), r))*r-2)*exp(-lambda(r, t)), (4, 4) = -(1/2)*sin(a)^2*(-2+((diff(v(r, t), r))*r-(diff(lambda(r, t), r))*r+2)*exp(-lambda(r, t)))}

(8)

Ricci[scalar]

-(1/2)*(exp(-v(r, t)-lambda(r, t))*exp(v(r, t))*(diff(lambda(r, t), r))*(diff(v(r, t), r))*c^2*r^2-exp(-v(r, t)-lambda(r, t))*exp(v(r, t))*(diff(v(r, t), r))^2*c^2*r^2-2*exp(-v(r, t)-lambda(r, t))*exp(v(r, t))*(diff(diff(v(r, t), r), r))*c^2*r^2+2*exp(-v(r, t)-lambda(r, t))*exp(v(r, t))*(diff(lambda(r, t), r))*c^2*r-2*exp(-v(r, t)-lambda(r, t))*exp(v(r, t))*(diff(v(r, t), r))*c^2*r-exp(-v(r, t)-lambda(r, t))*exp(lambda(r, t))*(diff(v(r, t), t))*(diff(lambda(r, t), t))*r^2+exp(-v(r, t)-lambda(r, t))*exp(lambda(r, t))*(diff(lambda(r, t), t))^2*r^2+2*exp(-v(r, t)-lambda(r, t))*exp(lambda(r, t))*(diff(diff(lambda(r, t), t), t))*r^2+2*(diff(lambda(r, t), r))*exp(-lambda(r, t))*c^2*r-2*exp(-lambda(r, t))*(diff(v(r, t), r))*c^2*r-4*exp(-lambda(r, t))*c^2+4*c^2)/(c^2*r^2)

(9)

NULL

 

Download General_metric_(reviewed).mw

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

Hi

I imagine you know well about 4-velocity and comoving (or not) observers; by the way, have you seen the pages of the Physics:-ThreePlusOne package? (The line elements for Eulerian and Comoving observers are related by the metric.) Anyway, mainly because of the textbook references for formulating the problem, a good and easy presentation with good references at the end is the one in Wikipedia about Comoving and proper distances. Another good reference is the Physics Forums Insights about comoving coordinates and observers. ChatGPT also knows about these topics and corresponding formulas. You could use those references for formulating the problem in a worksheet/document, and point out what is precisely the formulation obstacle you see - something more specific that you wouldn't know how to do - and from there, we can recap the conversation here, after I see your worksheet and could understand where is that you need some clarification or help.

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

Hi
Not exactly, but what I use for this purpose: select the portion (for instance: Shift + Click the beginning; same for the end) Then, from the menu: Evaluate -> Selection, or use the corresponding shortcut (on a Mac is Command =)

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

No, not in the current Maple. Of course, it could be re-coded such that it works differently, e.g. as you say, without displaying the options, but I don't see the rationale. Say in the example you gave: try without AllSolutions, and you see a different output, so displaying the option is relevant to understand what you see on the right-hand side. Also, it is not possible to predict, a priori, whether the options you pass produce a result different than without options.

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

Where you write option trace, write instead: option trace = 0. If tracing an existing program, e.g. simplify, go with trace(simplify, statements = false). You may also be interested in the option depth = n. See ?trace.

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

Generally speaking: yes. Although a DiracConjugate command, relevant in connection with what you show in the worksheet you posted, is not there in Physics:-StandardModel at this moment (conjugate is used instead, but that misses the tensor representation of a spinor Psi  times Dgamma[0], and so there is no precise representation for the scalar DiracConjugate(Psi) * Psi. Incidentally, I am currently working on further developments for spinors. I will write again by the end of this week, showing the new functionality and answering your question accordingly.

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

Update: Good catch; a fix for this problem is distributed to everyone in the Maplesoft Physics Updates v.1461 or newer. As usual, to install, open a worksheet/document and input Physics:-Version(latest) to install.

Previous answer: This looks like bogus behaviour, and I share your expectation @nm. I will give it a look later today and write here again.

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

3 4 5 6 7 8 9 Last Page 5 of 59