ecterrab

14540 Reputation

24 Badges

20 years, 20 days

MaplePrimes Activity


These are answers submitted by ecterrab

This first part is your worksheet:
restart; with(Physics)

NULLg_[euclid]

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

(1)

Setup(mathematicalnotation = true)

[mathematicalnotation = true]

(2)

NULL
Define(A[mu] = [1, 2, 3, 4])

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

(3)

A[]

A[mu] = Array(%id = 36893488153354570796)

(4)

"A[~]"

A[`~mu`] = Array(%id = 36893488153354567540)

(5)

SumOverRepeatedIndices(A[`~mu`]*A[mu], mu)

30

(6)

NULL  Simplify(A[`~mu`]*A[mu])

A[mu]^2

(7)

Simplify(A[mu]^2)

A[mu]^2

(8)

NULL

Simplify(g_[nu, mu]^2)

4

(9)

"#  g Simplifies to a number, why doesn't A"?" thanks"

====================================================
Answer: that simplification only works for the metric. What you see in

g_[nu, mu]^2

Physics:-g_[mu, nu]^2

(10)

Simplify(%)

4

(11)

is the trace, as in

g_[trace]

4

(12)

For A[mu]^2  there is no trace, and if you want the sum over repeated indices, you already have that command, as you show in (6). This other example, of a tensor with two indices, may help see the difference

Define(B[mu, nu] = Matrix(4, proc (i, j) options operator, arrow; i+j end proc))

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

(13)

B[definition]

B[mu, nu] = Matrix(%id = 36893488153328980684)

(14)

B[trace]

20

(15)

Also

B[mu, mu]

B[mu, mu]

(16)

SumOverRepeatedIndices(B[mu, mu])

20

(17)

But not Simplify

Simplify(B[mu, mu])

B[mu, mu]``

(18)

The case of the metric is indeed special. In computations with paper and pencil in Physics, we (more often than otherwise) want the trace to be explicitly computed, but not for all other tensors. For them SumOverRepeatedIndices does the job and with several options (check its help page). And what if you want the trace of the metric to not be computed? Use the inert form

%g_[nu, mu]^2

%g_[nu, mu]^2

(19)

Simplify(%)

%g_[mu, nu]^2

(20)

NULL

 

Download simp_(reviewed).mw

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

 

Download Differentiate_the_solution_you_get_the_ODE.mw
 

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

Download SumOverRepeatedIndices_works_fine.mw
 

PS: Next time, please upload a worksheet with your input - see the green arrow in the post menu for that purpose; to copy and paste is not convenient.

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

Good catch, this weakness is fixed in v.1752 of the Maplesoft Physics Updates. As usual, to install, open Maple and input Physics:-Version(latest);

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

Hi

It is difficult to help without a worksheet where you show, e.g. what makes you say "I caught aome serious errors with Maple 22 calculating the Ricci tensor". Regarding "How do I tell Maple to contract thae alpha and beta indices in above expression", maybe you mean multiplying by the metric to contract? If so, you can use * or . that includes simplification - all these things are explained in detail and with examples on the help page ?Physics,Tensors.

Anyway, if you post your worksheet (see the green arrow to upload it), it becomes possible to understand what you are saying and, from there, provide more specific feedback.

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



Download Total_differential.mw

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

In short: what you are saying is not correct. The solution y(x) = 3 is a particular solution, you get it taking c__1 = infinity.

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

This is your ODE and dsolve's solution, all tests OK

ode := diff(y(x), x)-cot(x)*(y(x)^(1/2)-y(x)) = 0

sol := dsolve(ode)

y(x)^(1/2)-(Int((1/2)*sin(x)^(1/2)*cot(x), x)+c__1)/sin(x)^(1/2) = 0

(1)

odetest(sol, ode)

0

(2)

dsolve's solution computing the integral also tests OK

sol := dsolve(ode, useint)

y(x)^(1/2)-1-c__1/sin(x)^(1/2) = 0

(3)

odetest(sol, ode)

0

(4)

dsolve's solution in explicit form requires RootOf and also tests OK

sol := dsolve(ode, useint, explicit)

y(x) = RootOf(-_Z^(1/2)*sin(x)^(1/2)+sin(x)^(1/2)+c__1)

(5)

odetest(sol, ode)

0

(6)

Now, this is your solution, nm,

sol_NM := y(x) = (exp(RootOf(-sin(x)*tanh((1/2)*_Z+(1/2)*c__1)^2+sin(x)+exp(_Z)))+sin(x))/sin(x)

y(x) = (exp(RootOf(-sin(x)*tanh((1/2)*_Z+(1/2)*c__1)^2+sin(x)+exp(_Z)))+sin(x))/sin(x)

(7)

I don't know from where you got this expression, but to my eyes it is not a solution to ODE. Remove the RootOf to test the actual expression behind

DEtools:-remove_RootOf(sol_NM)

-sin(x)*tanh((1/2)*ln(y(x)*sin(x)-sin(x))+(1/2)*c__1)^2+y(x)*sin(x) = 0

(8)

odetest(-sin(x)*tanh((1/2)*ln(y(x)*sin(x)-sin(x))+(1/2)*c__1)^2+y(x)*sin(x) = 0, ode)

`odetest/PIECEWISE`([0, -ln(y(x)*sin(x)-sin(x))+2*arctanh(y(x)^(1/2)) = c__1], [2*(sin(x)*exp(c__1)*(exp(-c__1)*(exp(c__1)-csc(x)+2*exp((1/2)*c__1)*(-sin(x))^(1/2)*csc(x)))^(1/2)-exp(c__1)*sin(x)-2*exp((1/2)*c__1)*(-sin(x))^(1/2)+1)*exp(-c__1)*cot(x)*csc(x)/((exp(-c__1)*(exp(c__1)-csc(x)+2*exp((1/2)*c__1)*(-sin(x))^(1/2)*csc(x)))^(1/2)-1), -ln(y(x)*sin(x)-sin(x))-2*arctanh(y(x)^(1/2)) = c__1])

(9)

Regarding testing your expression (not a solution) explicitly as if it were a solution, you hit a bug, but not in odetest; it is in radnormal, this is the expression, resulting from your not-a-solution, that goes into an infinite loop within radnormal

NULL

ee := (((2*I)*RootOf(_Z^3*_a^(2*c__1)+2*_Z^2*_a^c__1+((2*I)*_a^(c__1-I*x)-(2*I)*_a^(c__1+I*x)+1)*_Z)*_a^(I*x)+_a^((2*I)*x)-1)/(_a^((2*I)*x)-1))^(1/2)

radnormal(ee);radnormal(ee)

Error, (in anonymous procedure called from depends) too many levels of recursion |lib/depends/src/depends.mpl:80|

 

NULL


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

Download ode_solved_and_tested_OK.mw

This is resolved; the integration constants shown by ODESteps are now the new ones (nicer), as the ones returned by default by dsolve. For this change to be active, as usual, install the latest update by opening Maple 2024 and entering Physics:-Version(latest)

Regarding your question in the worksheet, as explained in ?dsolve,details, by default, dsolve and pdsolve return integration constants and functions as c__n and f__n(...), where n is an integer and is displayed as a subscript (and the `__` is not visible, it just produces the subscript), but you can set these commands to work as in the past (2 releases ago), i.e. using _Cn and _Fn.

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

Thanks for the report, @nm. This one is fixed in the Updates v.1724 or newer. As usual, to install, open Maple and input Physics:-Version(latest);

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

Hi @nm, good catch. It's was a subtle issue. It is fixed in the Udpates v.1723 for Maple 2024. As usual, to install, open Maple 2024 and input Physics:-Version(latest).

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

So maybe I do not understand your question.

You define R[a, b] = P, where P is a tensorial expression with a and b as free indices. OK.

Next, you compute the Taylor expansion of R[1, 1] and equate that to 0. But nowhere in your worksheet do I see why R[1,1] would be equal to 0. Anyway, that implies an ODE for f(r).

Next, you compute the Taylor expansion of R[~1, 1] and equate that to 0.  Naturally, R[1, 1] <> R[~1, 1] because R[~1, 1] = g_[~1, ~a]*R[a, 1] (including there the sum over the repeated index a) and g_[~1, ~a] <> 1. So, naturally, the ODE you get for f(r) from the Taylor expansion of R[~1, 1] is different from the one you got from the expansion of R[1, 1].

Why are you equating two different things to 0, and then expecting them to result in the same equation for f(r)? Or even why are you suggesting that R[1, 1] = R[~1, 1]?

Guessing a bit, if you want to determine the value of f(r) such that R[1, 1] = R[~1, 1], then do this:
dsolve(Gtaylor(R[~1, 1] - R[1, 1] = 0, b, 2), f(r));
                                    f(r) = -1


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

This is Maple TTY running with no initialization whatsoever, and with the latest Maplesoft Physics Updates: there is no crash. I suggest you try removing any initialization file.

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

The Physics Updates do work. What didn't work was the download mechanism. It looks fixed now in v.1714 - I just downloaded it (input Physics:-Version(latest), as usual)

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

Hi @nm
I removed all initialization files to be sure, and run it directly in TTY to be sure also that there was no GUI element interfering. Even so, I cannot reproduce your problem, and I do have, as you, the Maplesoft Physics Updates installed, as you see in this pic. The first line, anames(); shows there is no initialization file or previous assignment. I'd suggest you check that in your computer.

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

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