ecterrab

14370 Reputation

24 Badges

19 years, 289 days

MaplePrimes Activity


These are answers submitted by ecterrab

Hi
I am not sure I get the whole picture, but here is some feedback. 

with(Physics); Setup(mathematicalnotation = true)


In your image, a and i are Euclidean indices that run from 1 to 3, so you do not need to use spacetime indices that run from 1 to 4. Also no need for the Vectors package (more comments on this at the end).

 

The simplest is then to use su2indices, which run from 1 to 3, and for which KroneckerDelta  is a tensor (actually, the metric regarding those indices, it is explained in its help page). So,

Setup(su2indices = lowercaselatin, coordinates = cartesian)

[coordinatesystems = {X}, su2indices = lowercaselatin]

(1)

Define your unit-vector tensor. For visualization purposes, use this macro

macro(R = `#mover(mi("r"),mo("∧"))`)``


You can enter your position vector in this way

R[i] = [x, y, z]/sqrt(x^2+y^2+z^2)

`#mover(mi("r"),mo("∧"))`[i] = [x/(x^2+y^2+z^2)^(1/2), y/(x^2+y^2+z^2)^(1/2), z/(x^2+y^2+z^2)^(1/2)]

(2)

Define(`#mover(mi("r"),mo("∧"))`[i] = [x/(x^2+y^2+z^2)^(1/2), y/(x^2+y^2+z^2)^(1/2), z/(x^2+y^2+z^2)^(1/2)])

{Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], `#mover(mi("r"),mo("∧"))`[i], Physics:-SpaceTimeVector[mu](X)}

(3)

Now your tensor `V__i,a` as shown in your image (you can change it as you see appropriate). It improves the readability if you use CompactDisplay

CompactDisplay((fA, fB, fC)(r))

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

(4)

This is as the image you show

V[i, a] = (1-fA(r))*LeviCivita[a, i, j]*R[j]/(g*r)-fB(r)*(-R[a]*R[i]+KroneckerDelta[i, a])/(g*r)+fC(r)*R[i]*R[a]/(g*r)

V[i, a] = (1-fA(r))*Physics:-LeviCivita[a, i, j]*`#mover(mi("r"),mo("∧"))`[j]/(g*r)-fB(r)*(-`#mover(mi("r"),mo("∧"))`[a]*`#mover(mi("r"),mo("∧"))`[i]+Physics:-KroneckerDelta[a, i])/(g*r)+fC(r)*`#mover(mi("r"),mo("∧"))`[i]*`#mover(mi("r"),mo("∧"))`[a]/(g*r)

(5)

Define(V[i, a] = (1-fA(r))*Physics[LeviCivita][a, i, j]*`#mover(mi("r"),mo("∧"))`[j]/(g*r)-fB(r)*(-`#mover(mi("r"),mo("∧"))`[a]*`#mover(mi("r"),mo("∧"))`[i]+Physics[KroneckerDelta][a, i])/(g*r)+fC(r)*`#mover(mi("r"),mo("∧"))`[i]*`#mover(mi("r"),mo("∧"))`[a]/(g*r))

{Physics:-Dgamma[mu], Physics:-Psigma[mu], V[i, a], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], `#mover(mi("r"),mo("∧"))`[i], Physics:-SpaceTimeVector[mu](X)}

(6)

These are the components of `#mover(mi("r"),mo("∧"))`[i] and of V[i, a] and note there is no distinction between covariant and contravariant because the indices refer to an Euclidean SU2 space. So,  R[]

`#mover(mi("r"),mo("∧"))`[a] = Array(%id = 36893488158327921108)

(7)

V[]

V[a, b] = Matrix(%id = 36893488151942105436)

(8)

Alternatively, if you do not need to work with the square roots around, it might be simpler to redefine the `#mover(mi("r"),mo("∧"))`[i] as a function of the coordinates x, y, z as follows and only use the definition (2) in terms of square roots when necessary. So,

R[i] = R[i](x, y, z)

`#mover(mi("r"),mo("∧"))`[i] = `#mover(mi("r"),mo("∧"))`[i](x, y, z)

(9)

Define(redo, `#mover(mi("r"),mo("∧"))`[i] = `#mover(mi("r"),mo("∧"))`[i](x, y, z))

{Physics:-Dgamma[mu], Physics:-Psigma[mu], V[i, a], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], `#mover(mi("r"),mo("∧"))`[i], Physics:-SpaceTimeVector[mu](X)}

(10)

CompactDisplay(R(x, y, z))

`#mover(mi("r"),mo("∧"))`(x, y, z)*`will now be displayed as`*`#mover(mi("r"),mo("∧"))`

(11)

To use this new definition (9), you need to redo the definition of V[i, a] done in (5)

Define(redo, V[i, a] = (1-fA(r))*Physics[LeviCivita][a, i, j]*`#mover(mi("r"),mo("∧"))`[j]/(g*r)-fB(r)*(-`#mover(mi("r"),mo("∧"))`[a]*`#mover(mi("r"),mo("∧"))`[i]+Physics[KroneckerDelta][a, i])/(g*r)+fC(r)*`#mover(mi("r"),mo("∧"))`[i]*`#mover(mi("r"),mo("∧"))`[a]/(g*r))

{Physics:-Dgamma[mu], Physics:-Psigma[mu], V[i, a], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], `#mover(mi("r"),mo("∧"))`[i], Physics:-SpaceTimeVector[mu](X)}

(12)

Now you have

R[]

`#mover(mi("r"),mo("∧"))`[a] = Array(%id = 36893488158265443860)

(13)

where all of them are functions of x, y, z. To see that, use show

show

`#mover(mi("r"),mo("∧"))`[a] = Array(%id = 36893488158265443860)

(14)

And for V[a, b]

V[]

V[a, b] = Matrix(%id = 36893488158296509364)

(15)

A comment on the use of Vectors: currently, you can define a unit vector that is also a tensor. For example: after loading Vectors, everything that starts and ends with an underscore is a unit vector

with(Vectors)

_u_

_u_

(16)

Use the `.` multiplication operator instead of `*` to mean scalar product of vectors

%.%

1

(17)

Then you can define a unit vector as a tensor; I here use 1D input here to make it clear what is what I am entering

_u_[j] = [_u__1_, _u__2_, _u__3_]

_u_[j] = [_u__1_, _u__2_, _u__3_]

(18)

Define(_u_[j] = [_u__1_, _u__2_, _u__3_])

{Physics:-Dgamma[mu], Physics:-Psigma[mu], V[i, a], _u_[j], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], `#mover(mi("r"),mo("∧"))`[i], Physics:-SpaceTimeVector[mu](X)}

(19)

Now you have

_u_[]

_u_[a] = Array(%id = 36893488158327943524)

(20)

_u_[1]._u_[1]

1

(21)

_u_[1]._u_[2]

Physics:-Vectors:-`.`(_u__1_, _u__2_)

(22)

NULL

_u_[a] = Array(%id = 36893488158327943524)

(23)

_u_[a]._u_[b]

Physics:-Vectors:-`.`(_u_[a], _u_[b])

(24)

eval(Physics[Vectors][`.`](_u_[a], _u_[b]), [a = 1, b = 1])

1

(25)

eval(Physics[Vectors][`.`](_u_[a], _u_[b]), [a = 1, b = 2])

Physics:-Vectors:-`.`(_u__1_, _u__2_)

(26)

But then we have a problem with your expression: the first term,

(1 - fA(r))*1/g*1/r*LeviCivita[a, i, j]*_r_[j]

(1-fA(r))*Physics:-LeviCivita[a, i, j]*_r_[j]/(g*r)

(27)

The above is a vector (see Identify )

Identify((1-fA(r))*Physics[LeviCivita][a, i, j]*_r_[j]/(g*r))

5

(28)

But neither the second nor the third term is a vector, they are scalars:

fB(r)*1/g*1/r*(KroneckerDelta[i, a] - (_r_[i] . _r_[a]))

fB(r)*(Physics:-KroneckerDelta[a, i]-Physics:-Vectors:-`.`(_r_[i], _r_[a]))/(g*r)

(29)

Identify(fB(r)*(Physics[KroneckerDelta][a, i]-Physics[Vectors][`.`](_r_[i], _r_[a]))/(g*r))

0

(30)

fC(r)*1/g*1/r*(_r_[i] . _r_[a])

fC(r)*Physics:-Vectors:-`.`(_r_[i], _r_[a])/(g*r)

(31)

Identify(fC(r)*Physics[Vectors][`.`](_r_[i], _r_[a])/(g*r))

0

(32)

So, this expression is invalid because you are adding a vector with a scalar,

V[i, a] = (1 - fA(r))*1/g*1/r*LeviCivita[a, i, j]*_r_[j] - fB(r)*1/g*1/r*(KroneckerDelta[i, a] - (_r_[i] . _r_[a])) + fC(r)*1/g*1/r*(_r_[i] . _r_[a])

Error, (in Physics:-Vectors:-+) wrong sum of a vector with the scalar -fB(r)/g/r*(Physics:-KroneckerDelta[a,i]-(_r_[i] . _r_[a])) |lib/Physics/Vectors/src/operations.mm:87|

 

``


 

Download V_Tensor_(reviewed).mw

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


Download FeynmanIntegral.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions
Research and Education, passionate about all that

Hi @nm
First, your expectation is not correct: determining the general form of a symmetry for a first-order ODE is as difficult as solving the ODE itself. I almost had my first paper in the area rejected because of that truth, which however can be a prejudice in practice ... So what is all this hype about symgen, then? It scans for simpler forms, something that can be done systematically. For this problem, the internal heuristic algorithm searching for a polynomial symmetry estimates degree = 2, not enough.

Unfortunately, the help page ?symgen says 'dgun' instead of '`ODEtools/dgun`', or else _Env_symgen_dgun. Both set the upper bound for the polynomial or rational forms of a symmetry, useful when the internal algorithm doesn't help.

Independent of that, Hydon's book says, as you show, "... [this ode] is not easily solved by any standard method". So much for that ... Maple's dsolve solves it almost instantly, regardless of you setting the value of `ODEtools/dgun`. This is an Abel type equation with nonconstant invariant, belonging to the AIR class (try a higher value of infolevel for dsolve), so it can systematically be transformed into a 2nd order linear ODE admitting computable hypergeometric functions, and from there,

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft (Emeritus), Canada
Research & Education, passionate about all that

Originally, the Updates contained only changes to the Physics package, and, by chance, I tightened the update of the "date of a version" to saving the Physics package. The project, however, quickly evolved into Updates that could involve changes to any part of the Maple library, but the update of the version's date still only happened when Physics was saved. Since the recent versions of the Updates involved changes that didn't require saving Physics, the version date didn't change. In the latest one (from today) the version's date reappears correct.

Best wishes for 2025!

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

Change_of_variables_x_to_g(x).mw

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

As explained in a comment, this was a problem related to recent fixes in Typesetting, introduced in v.1835. This change now resolves that problem. To install the corrected version, as usual, input Physics:-Version(latest);

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

Thanks for the report; this one is fixed. To install the fix in Maple 2024, as usual, input Physics:-Version(latest);

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


Download Different_Hilbert_spaces.mw

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

I also don't like unnecessary brackets. I touched the Typesetting so that, at least for this example, we do not have unnecessary brackets anymore. To install, as usual, input Physics:-Version(latest). Now, the Typesetting code is tricky; could you please help posting here:

  • More cases of unnecessary brackets.
  • Any case you think the brackets are missing, so the opposite situation.

Thanks

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

To have the fix installed, open Maple and input Physics:-Version(latest);

Now, clearly, "no output at all", was a bug. I don't know what you actually meant by "Did Maple always behave this way for Laplace?"

On your comparison with Maple competitors, Mathematica or any other one, I'd like to make a point clearly: neither it produces shame nor urgency. Actually, when I read these strange comparisons (like a bug with a no-bug), I personally dislike the communication style. For me, it is just not constructive or purposeless, making me automatically lower the issue's priority. Fixing issues on the fly, as is the case of the Maplesoft Physics Updates project, has the underlying idea of collaboration and excitement, say, the opposite of such adversarial comparisons of inequivalent things.

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

Section 7 of ?Physics,Tensors is called Inert Tensors. Regarding a tensor definition, e.g. for Ricci or any other one, also the ones you define using defining equations, to see the definition even when the tensor has all of its components equal to zero, use the 'definition' keyword to index the tensor, e.g. input Ricci[definition].

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

With a signature where the timelike component is in position 4, e.g. (---+), both X[4] and X[0] return t, so yes you can count starting from 0. If the timelike component is in position 1, then no, you cannot start counting from 0.

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

I understand this command does what you want to do, i.e. sort by rank. An equivalent command may be in the Grobner or RegularChains packages.

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

This is your ODE

ODE := c1*(diff(f(x), x, x, x, x))+c2*(diff(f(x), x, x, x))/x+c3*(diff(f(x), x, x))/x^2+c4*(diff(f(x), x))/x^3+c5*f(x) = 0


Naturally, for any values of the c1, c2, c3, c4, c5 you have a different - yet perfectly valid - differential equation, so the ODE does not restrict the values of those five constants.
If I am understanding your question right, the question is which solutions can Maple find for the different cases where all these five constants are equal to 0 (then
f(x) is arbitrary) or taking them different from 0, one or more at a time, such that the resulting ODE is solvable by Maple.

To answer such a question use dsolve directly, just pass the ODE enclosed within [] or {}, and note the ranking I am using [f, {c1,c2,c3,c4,c5}] (for information on that, see the help page for PDEtools:-casesplit which is used by dsolve and pdsolve on background). To avoid cluttering, close with `:`, and here I just check a few

solutions := dsolve([ODE], [f, {c1, c2, c3, c4, c5}])

 

Consider the first case:

solutions[1]

{c1 = 0, c2 = 0, c3 = 0, c4 = 0, c5 = 0, f(x) = f(x)}

(1)

OK, that was easy. Next

solutions[2]

{c1 = 0, c2 = 0, c3 = 0, c4 = 0, c5 = c5, f(x) = 0}

(2)

Also easy. Move forward some few

solutions[4]

{c1 = 0, c2 = 0, c3 = c3, c4 = c4, c5 = c5, f(x) = c__1*x^((1/2)*(c3-c4)/c3)*BesselJ(-(1/4)*(c3-c4)/c3, (1/2)*(c5/c3)^(1/2)*x^2)+c__2*x^((1/2)*(c3-c4)/c3)*BesselY(-(1/4)*(c3-c4)/c3, (1/2)*(c5/c3)^(1/2)*x^2)}

(3)

Good, we are now in non-trivial territory, with three constants different from 0, J and Y are Bessel functions, and the solution depends on these three non-zero constants in a non-trivial way.

Etc.

And how many cases could Maple solve?

nops([solutions])

6``

(4)

NULL


 

Download solve_for_f_and_c1_to_c5.mw

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

Regardless of RootOf's caching approach, this error interruption should not happen in the first place. The problem is fixed, and the fix is distributed within the Maplesoft Physics Updates v.1808 or newer. To install, open Maple and input Physics:-Version(latest)

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

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