ecterrab

14540 Reputation

24 Badges

20 years, 22 days

MaplePrimes Activity


These are answers submitted by ecterrab

Hi
Your question sounds to me a bit subject to interpretation. A variable, say 'x', is "in memory" in that it is either assigned something, or it is in the remember tables.

If it is assigned, you 'clear' x by entering x := 'x', you know, just unuassigning. it

Clearing 'x' from all remember tables is trickier but implemented in recent Maples: From the help page of forget: "forget(..,x), which will clear all remembered entries in the system that reference x."

So in both cases you do not need to restart. If however you restart you clear the memory that the Maple system as as whole is taking, and for that, as people already said in this thread, using the gc (garbage collector) also allows you to do some of this "free the memory that the system is not using" without restarting; note that the memory freed via gc is mostly that from remember tables.

 

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

This design is intentional, aiming and not making everything psi be anticommutative. For the same reason psi1, psi2 but not psia, are anticommutative. So if you need to work with an unlimited number of anticommutative variables, the prefix approach is the way to go, with numbers. If you prefer to use everything letters, you can state the letters you prefer, for example using Setup(anticommutativeprefix = {psi, psi__a, psi__b, psi__c}). That will allow you to use psi__1, ... psi__n (with n integer) as well as psi__a, psi__b and psi__c.

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

 

 

Hi

Strictly speaking "differential geometry", the DifferentialGeometry package you see in Maple is the only one distributed with the system, and I agree that it is a bit difficult to use. For that reason is that we provided the Lessons and Tutorials, plus the solved examples you see in the help pages; all this material is provided to diminish the learning curve.

Having said that, depending on what you want to do, if you work is related to Lie symmetry methods for differential equations then the PDEtools symmetry routines - that beyond the standard things they also work with anticommutative variables and fucntions -are more thorough and much more intuitive / simpler to use. Or if your work has to do with the geometry of curved spaces and related things, or else it is a problem that can be formulated with tensors, possibly including noncommutative, anticommutative or your-defined algebra rules for them (Commutator and Anticommutatores), even differential operators (new option 'differentialoperators'), in all these cases the Physics package surpasses the functionality found in the DifferentialGeometry package and also are really simpler to use.

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

Hi,

One way is to compute the integral under assumptions specifying the problem more precisely. For example,

 

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

@ThU@John Fredsted 

Interesting observation ... that this is a Typesetting problem, not at all a "Dagger trouble". I just uploaded (check the Maplesoft R&D Physics webpage) a fix to Typesetting so that this hang problem you mentioned with typesetting = standard (which by the way is not Maple's default) doesn't happen anymore.

Now on typesetting = extended: first of all, it is not the case that the problem you pointed out in Error for the Vector constructor is there when you have the Physics update installed. This is so because the Physics update also fixes other issues, especially typesetting ones that interfere with the use of the package.

More important: all the Physics typesetting is based on typesetting = extended. Using the Physics package with typesetting = standard defeats one of the main design points of Physics, which is to have the output as readable as a textbook, instead of like a FORTRAN program - say.

I mentioned this in several other posts but would like to emphasize it: provided that, in a 2D input line, you can input everything in the same way you input it when you type in 1D Maple input mode, and provided that copy from the displayed output to paste in an input line works flawlessly, and nowadays both are true, I definitely prefer to have mathematical display, ie read the displayed output as when I read a textbook - and that only happens with typesetting = extended. If something doesn't work with typesetting = extended, then we just fix it.

Summaryzing: updating your Physics package with the one distributed by Maplesoft from the Maplesoft R&D Physics webpage fixes both typesetting problems: the one you reported today (hangs with the non-default typesetting = standard, that I do not recommend anyway) and the one you reported June 5 in Error for the Vector constructor, and I suggest you to give it a try to typesetting = extended. The advantages of extended typesetting are so many that using it is worth even a the cost of reporting a problem if any, that then is fixed basically right away.

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

Hi John
I noticed this post of yours only now, in connection with another one by you on Dagger. So about this post: If you have installed the Maplesoft Physics update distributed from the Maplesoft R&D Physics webpage, this problem you posted, regarding the typesetting of 'Vector' dissapears completely.

The fact is that the Physics update contains fixes and further developments not just in Physics.To mention but a couple of other things, fixes to: all of Differential Equations, Mathematical Functions, and Typesetting when that is possible and necessary for Physics functionality (as it is in this case), are also included.

I do have the Physics update installed and this is what I see:

So one way to resolve this issue, entirely, is to simply update your Physics package.

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

Hi

I don't know if you are familiar with the Physics package. GRTensor was for a long time the paradigm for general relativity and computer algebra around 20 years ago but I think Maple's Physics, the package that is developed by Maplesoft since 2006, that comes with Maple, really has more advanced functionality. It also appears to me simpler to use, and on top of that, the display and notation are as in textbooks.

Regarding your specific question, using Physics you do what you want via 

> Define(F[mu,nu] = Matrix(4, <the 16 components here>))

Alternatively, the right-hand side could be a tensorial equation with mu and nu as free indices (see the help page for Physics:-Define). After that, you can select a component entering F[1, 2], or say F[~1, 2] if the first index is contravariant, or F[nonzero] to see the nonzero components, or F[definition] to recover your definition, or F[] and F[~] to respectively see the all-covariant and all-contravariant components, or just work algebraically with F[mu,nu] using Simplify to simplify taking into account Einsten's sum rule for repeated indices, and a large etc. Among some other remarkable functionality in the Physics package, there is the TransformCoordinates and TensorArray commands, that act on generic tensorial expressions, not just on single tensors (see the corresponding help pages). Now in Maple 2017 there is the new Physics:-ThreePlusOne to work using the ADM formalism (3+1 decomposition of Einstein's equations, and related commands like the Lapse, Shift, etc.)

Physics has 70 commands, the Physics:-Tetrads has 14 commands, the Physics:-ThreePlusOne has 11 commands, the Physics:-StandardModel has 20 commands, and the Physics:-Library, with all the routines used to program the package available and with help sections explaining them, has other 153 commands; the Library:-PhysicsType package in turn has 87 types predefined that are relevant when working or programming for physics.

There is also the database of solutions to Einstein's equations. All the solutions collected in "Exact Solutions of Einstein's Field Equations" by Stephani, McCallum et al. are in this database that comes with Physics. This is about 1,000 metrics collected from among 4,000 papers in the literature. Every solution can be loaded, changed, worked on, etc.

I think there is nothing in computer algebra as thorough and comprehensive for general relativity, or quantum mechanics or field theory for the case, as it is the Maple Physics package.

Last but not least, Physics is updated every week taking into account the feedback of Maple users around, regarding fixes and new developments. The updates are available for download from the Maplesoft R&D Physics web page (for example, there have been 9 updates after the release of Maple 2017, and 167 updates during the Maple 2016 cycle). This constant update of the package is one of the nicest features of the Physics project at Maplesoft.

So I'd suggest you give it a try :)

If you have questions please post them here or you can also direct them to physics@maplesoft.com. 

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

Hi John

The expression you show is equal to a power series of f', therfore the differential order is equal to 1. Generally speaking, G(f') = 0 is just a differential equation of so-called "high degree" (even if not necessarily polynomial) in f', i.e. of differential order equal to 1. From you PS I can't tell exactly what is what you are trying to accomplish but it can mostly certainly be programmed using the commands of the PDEtools:-Library.

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

The Physics:-Fundiff performs functional differentiation, i.e. it is the command you can use to extremise a functional and in that way get the equations of movement (either discrete, mechanics, or in a field theory). The help page contains several examples of how to use it.

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

The Physics,TransformCoordinates does what you want, with several handy options.

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

Hi

Please give a look at the documentation. You can use the value 0 for the indices and, depending on the signature, it is the same as using the value 4 (if the sigmature is either (+ + + -) or (- - - +)) or it is the same as using the value 1 (if the signature is either (- + + +) or (+ - - -)). So indexing with 0 is the same as indexing with the position of the different sign in the signature. You can always query about the signature entering Setup(signature), and you can change the signature to any of the four possible ones, entering, for example, Setup(signature = `- + + +`); separating blank spaces help visualizing but for the Maple program behind this they are irrelevant, and you an enclose with `` or "". The default signature when you load Physics is "- - - +", as in Landau books, and in Maple 2017 there is a new command, Physics:-Redefine, to change the ordering or coordinates and the metric according to a change in signature.

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

This is the same question asked in http://www.mapleprimes.com/questions/222078-How-To-Compute-Ricci-Tensor-Of-A-Metric?reply=reply. The Maple results are correct, and as said there it is simple using the Physics package, why using the old 'tensor' package, good 30 years ago, but cumbersome today? 

I'd even say more: using Physics it not just simple but trivial, straightforward, as in "just say it" (Christoffel, Ricci). I copy here the worksheet/computation.


 

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)

These 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

I see you use the old tensor package. It is simple using the Physics package. Attached is your worksheet, revised by showing how to do it.


 

with(tensor):

coord:=[t,r,theta,phi]:

g_compts:=array(symmetric,sparse,1..4,1..4);

array( 1 .. 4, 1 .. 4, [ ] )

(1)

g_compts[1,1] := exp(2*phi(r)); g_compts[2,2] := -exp(2*nu(r));g_compts[3,3] := -r^2;g_compts[4,4] := -r^2*sin(th)^2;

exp(2*phi(r))

 

-exp(2*nu(r))

 

-r^2

 

-r^2*sin(th)^2

(2)

 

g := create( [-1,-1], eval(g_compts));

g := create([-1, -1], Matrix(4, 4, {(1, 1) = exp(2*phi(r)), (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = -exp(2*nu(r)), (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -r^2, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = -r^2*sin(th)^2}))

(3)

with(Physics)

Setup(coordinates = spherical, g_ = (Matrix(4, 4, {(1, 1) = exp(2*u(r)), (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = -exp(2*v(r)), (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -r^2, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = -r^2*sin(theta)^2})))

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

 

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

 

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

 

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

(4)

Use a compact display to avoid redundant display of the functionality of u(r) and v(r)

CompactDisplay(%)

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

 

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

(5)

Check the metric

g_[]

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

(6)

The covariant and contravariant components of the Ricci tensor

Ricci[]

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

(7)

"Ricci[~]"

Physics:-Ricci[`~mu`, `~nu`] = Matrix(%id = 18446744078202091870)

(8)

``


 

Download metric_(reviewed).mw

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

In ?dchange, you read

  • The dchange command has two different criteria for changing variables. The first one, applied by default to "known" functions (functions with a differentiation rule known to Maple), changes the functional dependence using the explicit relation between the old and new variables. For example, if the transformation is given by  {x = xi+eta, y = xi-eta},  then dchange will transform known functions as follows:

           cos(x*y) -> cos( (xi+eta)*(xi-eta) )

  • The second criterion, applied by default to "unknown" functions (functions whose differentiation rule is unknown to Maple), changes the functional dependence taking into account only the implicit relation between the old and new variables. For example, with the transformation above, the dchange command will transform any "unknown" function (say f) as in:  f(x, y) -> f(xi, eta)
  • It is possible to change these defaults and force dchange to apply a different criterion to a given function, by specifying it using the 'known' or 'unknown' options.
  • When a function depends on more variables than those which are being changed, the variables not entering the process are all put to the right. For example, the transformation above would take f(x, y, z, t) -> f(xi, eta, z, t).


So these three different input achieve the two other possible intepretations of this change of variables:

dchange(tr, x*(diff(f(x, y), y))+y*(diff(g(x, y), x)), [u, v], known = {f, g});  # (2)
dchange(tr, x*(diff(f(x, y), y))+y*(diff(g(x, y), x)), [u, v], known = all)        # same as (2)

tr := tr union {f(x, y) = F(u, v), g(x, y) = G(u, v)}:
dchange(tr, x*(diff(f(x, y), y))+y*(diff(g(x, y), x)), [u, v, F, G]);  # this is the one I find more correct for what I think you wanted

In summary: there is no bug here, the design permits you to work in one way or the other one. I would agree with a debate on what should be the default behaviour ('known = all', for instance, would avoid these surprises) but the current default is in the Maple library since 1997 and changing it today would have some potential backwards compatibility issues very difficult to predict (how many worksheets in the world would stop working as when they were written).

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

Hi
I'm not sure I understand your question precisely, but here is an answer: 

  • To see the list of metrics in the databse of solutions to Einstein's equations (I mean the indices that identify them, and also count how many are there) you use DifferentialGeometry:-Library:-Retrieve("Stephani", 1)
  • To see a list on the screen of the metrics where the description - when scanned for text recognition - presents a match to some combination of letters that you presente (e.g. kerr), you useSetup(metric = kerr) as you did. You can try for instance with 'pa' or 'dya' instead of 'kerr'

I recall as well that you can enter any metric you prefer in order to work with it, not just use the ones in the database of solutions - there are not restrictions to the form of the metric you enter but for the requirement that it is symmetric.

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

First 35 36 37 38 39 40 41 Last Page 37 of 59