ecterrab

8136 Reputation

20 Badges

14 years, 328 days

MaplePrimes Activity


These are answers submitted by ecterrab

IMPORTANT: note that using a product operator `*` with objects that do not commute, like, differential operators and corresponding differentiation variables, is not correct unless that product operator handles noncommutativity (as it is the case of Physics:-`*`, the product operator that gets loaded after you load the package - not the case of the standard default Maple `*` operator)

products_of_differential_operators.mw

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

What follows is your worksheet, with some comments intercalated in italics

 

with(Physics)

Setup(mathematicalnotation = true)

Coordinates(X = [t, x, y, z])

{X}

(1)

g_[minkowski]

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

(2)

KillingVectors(V)

[V[mu] = [x, -t, 0, 0], V[mu] = [0, 0, 0, 1], V[mu] = [y, 0, -t, 0], V[mu] = [z, 0, 0, -t], V[mu] = [1, 0, 0, 0], V[mu] = [0, y, -x, 0], V[mu] = [0, z, 0, -x], V[mu] = [0, 1, 0, 0], V[mu] = [0, 0, z, -y], V[mu] = [0, 0, 1, 0]]

(3)

Define(v[mu] = [0, y, -x, 0])

{Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], v[mu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(4)

v[mu, matrix]

v[mu] = Array(%id = 18446744078544093046)

(5)

NULL

tr := [x = r*sin(theta)*cos(phi), y = r*sin(theta)*sin(phi), z = r*cos(theta)]

[x = r*sin(theta)*cos(phi), y = r*sin(theta)*sin(phi), z = r*cos(theta)]

(6)

TransformCoordinates(tr, g[mu, nu], [t, r, theta, phi], [t, x, y, z], setcoordinates, setmetric)

Matrix(%id = 18446744078543765742)

(7)

Define(v[mu] = TransformCoordinates(tr, v[mu], [t, r, theta, phi], [t, x, y, z]))

{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:-gamma_[i, j], v[mu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(8)

v[mu, matrix]

v[mu] = Array(%id = 18446744078656762214)

(9)

Here there was an issue: the dependency of `v__μ` didn't get updated properly. Before the fix, the next input line was returning the previous tensor dependency of `v__μ`, that is",[x,y]". With the Maplesoft Physics Updates installed, it now returns correctly:

Library:-GetTensorDependency(v)

[r, theta]

(10)

And that is all. From herein, everything works as expected.
Define(dv[mu, nu] = `▿`[nu](v[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], dv[mu, nu], Physics:-g_[mu, nu], Physics:-gamma_[i, j], v[mu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(11)

dv[mu, nu, matrix]

dv[mu, nu] = Matrix(%id = 18446744078675460334)

(12)

Define(cdv[mu, nu] = `▿`[nu](v[mu])+`▿`[mu](v[nu]))

{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], cdv[mu, nu], Physics:-d_[mu], dv[mu, nu], Physics:-g_[mu, nu], Physics:-gamma_[i, j], v[mu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(13)

cdv[mu, nu, matrix]

cdv[mu, nu] = Matrix(%id = 18446744078669705814)

(14)

_____________________________________

 

A note on your worksheet cov_diff_bug_2: the problem there is different, not a bug, but a mistake you did inadvertently: in that worksheet, when in (7) you set the metric in terms of [t, r, theta, phi], you forgot to set the new coordinates to be [t, r, theta, phi]. Check the message on the screeen (I am pasting here an image from that worksheet):

You see the message, the coordinates are still [t, x, y, z], and with those previous coordiantes `∂`[mu](v[nu]) = 0 , because now v[mu] = (Vector[row](4, {(1) = 0, (2) = 0, (3) = 0, (4) = -sin(theta)^2*r^2})), and with that the first term in `▿`[mu](v[mu]) is also equal to 0 and everything from therein is not what you would receive if you had set the coordinates correctly to [t, r, theta, phi].

 

Summarizing: thanks for posting the problem (the Library:-GetTensorDependency mentioned above), it is fixed and the fix distributed to everybody within the Maplesoft Physics Updates v.685 or newer. By the way I am impressed with a) you using document mode (it is really elegant) and b) the way you work with 2D typesetting right in the input, making the work much more readable.


 

Download cov_diff_bug_1_(reviewed).mw

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

The topic of your question is a good one. I decided to write a post about, see "The equations of motion in curvilinear coordinates, tensor notation and Coriolis force". The three steps you mention appear in that post as equations (25), (26) and (30).

One other comment regarding the type of your question: computer algebra is an extremely powerful environment to formulate and explore, and with that to learn and discover. It may sound obvious, but the guidance is always given by the person behind the keyboard. You can only formulate things that you understand or know how to do with paper and pencil, completely or partially. And then, yes, even In the latter case, through exploration it very frequently takes you to a new and deeper understanding. I agree with you entirely in that it can revolutionize the teaching of Physics.

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

As tomleslie said, "Maple now has two "modes" (Worksheet and Document) and two "input methods" (1D input and 2D input) - so overall you have four choices of "user interface""

Unlike his and other's opinions, I think that worksheet mode + 2D-Math display of input is the best option, together with the (preferences) option: “How should Maple handle the creation of a new Math Engine?” definitely: “Ask each time a new document [or worksheet] is created”.

My rationale: 

Unlike document, in worksheet mode, it is clear where the text is and the math. Visually, right away, because of the prompts. And you can still have math within the text (press Shift+F5 within text to write math, or write it as text using Maple syntax, then mark with the mouse and convert to 2D Math). The fonts are also times new roman italics, which resembles LaTeX standard math concretely more than courier new and fonts like that one.

Then let me say that there is the Maple syntax. Not 1D Maple syntax and 2D Maple syntax. But then, unlike in "1D Math input", when you use "2D Math input" the single Maple syntax is displayed in a way that resembles the way we write formulas with paper and pencil. E.g. exponents are displayed as superscripts, fractions as fractions and, automatically, there is a space surrounding the +, *, =, :=, ->, etc. symbols. Altogether, my brain reads formulas faster and clearer. 

Note this my opinion has nothing to do with whether I write programs. As most people here know, I do write programs, since 1996 till today. In fact, I have this opinion after writing a significant amount of Maple programs when there was no 2D-math, and after realizing (in 2008) that on average I understood significantly faster (therefore code ideas also faster) when deriving knowledge using 2D-Math display of input. About the bugs mentioned by others in 2D-Math: post them, they are being fixed, nowadays faster than in the past.

About “Ask [whether to share an existing computational engine or start a new one] each time a new document is created”, with the (non-default) choice of “Ask each time a new document is created”, you have an implementation of the paper and pencil concept of draft computation. You can have a clean worksheet-computation, and in the middle, you may want to try something regarding the next step, using all the assignments and intermediate results you already have: just open a new worksheet sharing the kernel (computational engine) where you can (draft) experiment all you want. Then switch back to the main clean worksheet to continue. Other times the experiment needs to be done with a completely clean, new engine, so choose 'new engine' and again you can do experiments without messing your clean worksheet-computation.

Another good choice (doesn't work right in current Mac OS, the system I use) is to open new worksheets in new windows, which allows you to compare two computations side by side.

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

NOTE:  with matrix you can also use all the commands of the linalg package.

symbolic_matrices.mw

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

Steve

The three vectors _r, _theta and _phi are orthogonal. Their direction depends on the point of space you are considering, but not their orthogonality. So the results (1.3) and (2.3) are correct, not "Cartesian". What is what you were expecting?

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

If in the two hangs you use the optional argument 'useInt' you see the output appears right away. So we have an issue in int, or below it (may be solve or the is/assume/coulditbe set of commands), apparently introduced at the time of 2019.2. For the other two examples, not hanging but returning NULL right away, I'd need to give a further look, they are solved in Maple 2018 using Lie symmetry methods for higher degree equations, a tricky application of symmetries. But today and this week I'm rather busy preparing a presentation. I'll do my best to have a solution before the end of this week.

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

I gave a look at your worksheet, Deniscr. What I see: this is not a math issue but a typesetting one. I use 2D Math input, but type things as in 1D math input. Sometimes, in addition, I right-click and convert to 2D Math input to have nice typeset math already in the input. This is then a picture of what I see, the derivative is computed right away (first input) instead of the error message (second input, that I kept there for comparison).

 

Once the problem is understood, it remains to know what did you type to get this input that results in invalid derivative?

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

Hi

The practical dynamics is one where you post the formulation of the problem in a workshseet, up to what you think is the correct way to formulate it (do your best, taking advantage of the help pages) and use the green arrow to upload the worksheet here. From there, intercalating comments and input/output in that worksheet we take the question to a resolution - no doubt.

In advance to your worksheet: yes, you need to specify the functions vs and f(rs) explicitly in terms of the coordinates x, y, z, t. Otherwise, the symbols vs or rs are just some symbols not dependent on the coordinates, and therefore the metric is constant and so the Christoffel symbols are naturally equal to 0.

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

Addition_of_vectors_(reviewed).mw

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

Perpendicular_Vectors_(reviewed).mw

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

It is surprising how this problem went below the radar for so long. It is fixed. The fix, by people working with the simplifier, is available to everybody withing the Maplesoft Physics Updates v.643 or higher. Note that, as it's been the case for the last 5 years, these Updates only work with the current Maple release, Maple 2020, not retroactively with older releases.

Attached is your worksheet, reviewed, with the output after installing the Physics Updates v.643.

That said, I'd like to comment on the Title of this Question. Behind this software, there are people, proud of their work, happy to participate in this great forum and willing to help. But Titles like the one of this Question do not help, are not minimally polite and are not respectful. Please revise the communication style.

simplify_(reviewed).mw

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

Enter ?libname to understand what that is. Then please enter libname at the Maple prompt and reply here showing the output. What the message you show is telling is that

  • the package is installed, typically in Physics Updates below the Maple/toolbox directory, that exists below the directory shown by kernelopts(homedir);
  • that in you libname some other directory (D:\\Program Files\\Maple 2020\\lib\\maple.mla) contains the Physics package and appears in libname before the directory Physics Updates below Maple/toolbox.

Because D:\\Program Files\\Maple 2020\\lib\\maple.mla comes first in libname and contains Physics, that is the active version of Physics you are using, not the one that you installed with the Physics Updates.

That may happen for several reasons. For example if you manually set the value of libname or manually install the Physics Updates somewhere else (not that you have done any of that - just as examples).

In summary, what is the output when you input libname?

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

 

 

There is this command, PDEtools:-dcoeffs, give a look at its help page, I imagine this is what you want. You also have DifferentialAlgebra:-Tools:-Coeffs, but that is a more advanced command - not sure that is what you need.

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

@digerdiga 

Besides Pascal4QM worksheets, there is something new in Maple 2020 that you may want to take advantage: the SU(2) tensor space has dimension 3 and is Euclidean. So, in Maple 2020, instead of changing the dimension of spacetime using Setup(dimension = 3, metric = Euclidean, spacetimeindices = lowercaselatin) as you did, just use Setup(su2indices = lowercaselatin). Then set the algebra rule using KroneckerDelta, that in Maple 2020 works as a tensor for su2, su3, spinor and gauge indices (not for spacetime, space or tetrad indices for which you already have metric commands available, g_, gamma_ and Tetrads:-eta_).

Regarding your other question, on Why the sum of two terms that cancel each other are not cancelling when I called Simplify? The answer is: these expressions involve not just tensors but noncommutative objects subject to commutator rules, and in that case, when the two things are taken at the same time, up to what I know, there is no fully systematic algorithm to get all the cases. In those situations, the two commands that help are Library:-SortProducts and SubstituteTensor. You can see several examples of how that is done in the post The hidden SO(4) symmetry of the Hydrogen Atom.

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

1 2 3 4 5 6 7 Last Page 1 of 38