ecterrab

14540 Reputation

24 Badges

20 years, 21 days

MaplePrimes Activity


These are answers submitted by ecterrab

restart

with(Physics)

Setup(spacetime)

[spacetimeindices = greek]

(1)

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1142 and is the same as the version installed in this computer, created 2022, February 12, 11:16 hours Pacific Time.`

(2)

Define(t[mu])

{Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], t[mu], Physics:-LeviCivita[alpha, beta, mu, nu]}

(3)

NULL

SumOverRepeatedIndices(t[mu]*t[`~mu`])

t[1]*t[`~1`]+t[2]*t[`~2`]+t[3]*t[`~3`]+t[4]*t[`~4`]

(4)

NULL

SumOverRepeatedIndices(t[mu]*t[`~mu`])

t[1]*t[`~1`]+t[2]*t[`~2`]+t[3]*t[`~3`]+t[4]*t[`~4`]

(5)

NULL

SumOverRepeatedIndices(t[mu]*t[`~μ`])

t[mu]*t[`~μ`]

(6)

When you see things like this, try lprint

lprint(%)

t[mu]*t[`~μ`]

 

The following works, because, if the covariant index is A, the contravariant index is ~A (here, A = `μ`)

t[`μ`]*t[`~μ`]

t[`μ`]*t[`~μ`]

(7)

SumOverRepeatedIndices(%)

t[1]*t[`~1`]+t[2]*t[`~2`]+t[3]*t[`~3`]+t[4]*t[`~4`]

(8)

For the same reason, this works

t[`mu`]*t[`~mu`]

t[mu]*t[`~mu`]

(9)

SumOverRepeatedIndices(%)

t[1]*t[`~1`]+t[2]*t[`~2`]+t[3]*t[`~3`]+t[4]*t[`~4`]

(10)

And yet for the same reason this does not work

t[`μ`]*t[`~mu`]

t[`μ`]*t[`~mu`]

(11)

SumOverRepeatedIndices(%)

t[`μ`]*t[`~mu`]

(12)

Likewise neither t[mu] * t[`~μ`], your example, could work. You need to be aware: that shortcut to enter indices that you are using, depending on how you use it for contravariant indices, it results in a different thing, displayed the same way (~mu and `~μ`)

NULL

 

Download greek-index_(reviewed).mw

Edgardo S. Cheb-Terrab

 

Physics, Differential Equations and Mathematical Functions, Maplesoft

I think FunctionAdvisor(plot, Zeta) is the simplest and most comprehensive way of plotting the Zeta function. The plots you will see are not random but follow the NIST (Digital Library of Mathematical Functions), a somehow modern version of the Abramowitz and Stegun book.

Another very convenient way to visualize specific cases of the Zeta function is using plots:-plotcompare with the expression_plot optional argument, e.g. plotcompare(Zeta(z^2/3), expression_plot).

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

Hi
The command that works in general to compute equations of motion (or field equations in the case of field theory, quantum or not) is Physics:-Fundiff, to perform functional differentiation. Take a look, please, at its help page (?Fundiff).

Beyond Fundiff's help page, more examples of computing motion/field equations using Fundiff are found in the help page ?Physics,Examples.

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

with(PDEtools) 

PDEtools:-declare(y(x), prime = x)

`derivatives with respect to`*x*`of functions of one variable will now be displayed with '`

(1)

Now set a label, Y, to represent y(x) and its derivatives using indexed notation, using PDEtools:-diff_table

Y := diff_table(y(x))


Example:

Y[x, x]+Y[] = f(x)

diff(diff(y(x), x), x)+y(x) = f(x)

(2)

show

diff(diff(y(x), x), x)+y(x) = f(x)

(3)

NULL

To also input using prime notation, there is the Typesetting package, as indicated by acer. If, in addition, you have installed the lasted Maplesoft Physics Updates for Maple 2021.2, you can in addition use dot notation for time derivatives together with all the above.

Download Input_using_indexed_notation_for_derivatives.mw

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

 

This problem has a rather simple solution using PDEtools:-Solve , which has a whole set of routines to handle things like this.

r := x*(diff(theta(t), t))^2+y*(diff(`ϕ`(t), t))^2

g := (4*(f+T))*(diff(theta(t), t))^2+u*(diff(`ϕ`(t), t))^2

All you need to do is to ask for a solution independent of certain variables, in you example: t

PDEtools:-Solve(r = g, {x, y}, independentof = t)

{x = 4*f+4*T, y = u}

(1)

This is the example you called more complicated. PDEtools:-Solve works fine as well, whether you load Physics or not

with(Physics)

r := x*(diff(theta(t), t))^2+y*(diff(`ϕ`(t), t))^2+z*(diff(theta(t), t, t))+w*(diff(`ϕ`(t), t, t))

g := (4*(f+T))*(diff(theta(t), t))^2+u*(diff(`ϕ`(t), t))^2+(f+9)*(diff(theta(t), t, t))+4*s*(diff(`ϕ`(t), t, t))

PDEtools:-Solve(r = g, {w, x, y, z}, independentof = t)

{w = 4*s, x = 4*f+4*T, y = u, z = f+9}

(2)

NULL


Download PDEtools_Solve_independentof.mw

Edgardo S. Cheb-Terrab

Physics, Differential Equations and Mathematical Functions, Maplesoft

Thanks @nm for reporting the problem; the fix is available to everybody by installing the Maplesoft Physics Updates v.1128 or newer.

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

This is fixed, and the fix is available for everybody using Maple 2021.2 by installing the Maplesoft Physics Updates v.1125.

Details: the solution proposed by @mmcdara is correct, but will convert to the commutative :-`*` operator, not to the generalized product operator of the Physics package, that also handles anticommutative and noncommutative variables. The fix introduced converts to the generalized `*` instead of  :-`*`. And if what you wanted when entering [a, b] is their commutator, the solution by @Pascal4QM is the way to go.

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

There is no way you can 'change' the display of these differential operators. Being able to change the display would be equivalent to being able to change the display of - basically - everything else too. Although that is possible, it requires internal programing of the Typesetting routines. Not something for everyone.

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

The following, attempted to transform the implicit solution in explicit, hangs:

> solve(1/tan(1/2*ln(y(x)/x))-ln(x)-_C1, y(x));

I am tracking this in the bugs' database.

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


restartode := diff(w(z), z, z)+f(z)*(diff(w(z), z))+g(z)*w(z) = 0

diff(diff(w(z), z), z)+f(z)*(diff(w(z), z))+g(z)*w(z) = 0

(1)

transformation := eta = int(exp(-(int(f(z), z))), z)

eta = int(exp(-(int(f(z), z))), z)

(2)

If the above is the new independent variable eta, then in the terminology used in the help page PDEtools:-dchange your inverse transformation is of the form

ITR := {transformation, v(eta) = w(z)}

{eta = int(exp(-(int(f(z), z))), z), v(eta) = w(z)}

(3)

The problem with tthe above is that you do not have a simple representation for the direct transformation; that is: you don't know how to express z = F(eta). The best algebraic representation you have for F(eta)is using RootOf, so that the complete transformation you need to use is

TR__complicated := PDEtools:-Solve(ITR, {z, w(z)})

{z = RootOf(eta-Intat(exp(-(Int(f(_b), _b))), _b = _Z)), w(z) = v(eta)}

(4)

You can us this one, but don't expect something simple right away

PDEtools:-dchange(TR__complicated, ode, [eta, v(eta)], known = all, simplify)

g(RootOf(eta-Intat(exp(-(Int(f(_b), _b))), _b = _Z)))*v(eta)+(diff(diff(v(eta), eta), eta))*exp(-2*Intat(f(_b), _b = RootOf(eta-Intat(exp(-(Int(f(_b), _b))), _b = _Z)))) = 0

(5)

In your post, however, you mix variables by expressing g as a function of z, not eta, and ditto for the exponential. To do that, select the first transformation equation in TR__complicated

TR__complicated[1]

z = RootOf(eta-Intat(exp(-(Int(f(_b), _b))), _b = _Z))

(6)

subs((rhs = lhs)(z = RootOf(eta-Intat(exp(-(Int(f(_b), _b))), _b = _Z))), g(RootOf(eta-Intat(exp(-(Int(f(_b), _b))), _b = _Z)))*v(eta)+(diff(diff(v(eta), eta), eta))*exp(-2*Intat(f(_b), _b = RootOf(eta-Intat(exp(-(Int(f(_b), _b))), _b = _Z)))) = 0)

v(eta)*g(z)+(diff(diff(v(eta), eta), eta))*exp(-2*Intat(f(_b), _b = z)) = 0

(7)

And this is the result you show. You can still remove the intat

convert(v(eta)*g(z)+(diff(diff(v(eta), eta), eta))*exp(-2*Intat(f(_b), _b = z)) = 0, Int)

v(eta)*g(z)+(diff(diff(v(eta), eta), eta))*exp(-2*(Int(f(z), z))) = 0

(8)

 

NULL


 

Download given_inverse_transformation_of_the_independent_variable.mw

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

with(Physics); with(Vectors)

sys := {diff(x(t), t) = y(t), diff(y(t), t) = -x(t)}

{diff(x(t), t) = y(t), diff(y(t), t) = -x(t)}

(1)

This is perhaps what you are looking for when saying more automatic? The system knows about these things. Note however that, in thie context of this package, what you call polar coordinates is the 2D (x,y) part of a 3D cylindrical system of coordinates. So,

ChangeCoordinates(sys, cylindrical)

{(diff(rho(t), t))*cos(phi(t))-rho(t)*(diff(phi(t), t))*sin(phi(t)) = rho(t)*sin(phi(t)), (diff(rho(t), t))*sin(phi(t))+rho(t)*(diff(phi(t), t))*cos(phi(t)) = -rho(t)*cos(phi(t))}

(2)

solve({(diff(rho(t), t))*cos(phi(t))-rho(t)*(diff(phi(t), t))*sin(phi(t)) = rho(t)*sin(phi(t)), (diff(rho(t), t))*sin(phi(t))+rho(t)*(diff(phi(t), t))*cos(phi(t)) = -rho(t)*cos(phi(t))}, diff(({phi, rho})(t), t))

{diff(phi(t), t) = -1, diff(rho(t), t) = 0}

(3)

By the way, the documentation of the Physics:-Vectors package looks clear and complete ... if you feel it doesn't please post some suggestions (thanks) and I will take them a look.

Download ChangeCoordinates.mw

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

 

with(Physics)

g_[sc]

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

(1)

Riemann[alpha, beta, mu, nu]^2

Physics:-Riemann[alpha, beta, mu, nu]*Physics:-Riemann[`~alpha`, `~beta`, `~mu`, `~nu`]

(2)

SumOverRepeatedIndices(Physics[Riemann][alpha, beta, mu, nu]*Physics[Riemann][`~alpha`, `~beta`, `~mu`, `~nu`])

48*m^2/r^6

(3)

Weyl[alpha, beta, mu, nu]^2

Physics:-Weyl[alpha, beta, mu, nu]*Physics:-Weyl[`~alpha`, `~beta`, `~mu`, `~nu`]

(4)

SumOverRepeatedIndices(Physics[Weyl][alpha, beta, mu, nu]*Physics[Weyl][`~alpha`, `~beta`, `~mu`, `~nu`])

48*m^2/r^6

(5)

For things like this, or more details, or in general related to tensors, see the help page Physics,Tensors , it is a well organized help page with sections, subsections and examples.

NULL


 

Download Riemann_and_Weyl_SumOverRepeatedIndices.mw

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

This is a portion of your worksheet, showing the operation that I think resolves your problem.

restart

with(Physics)

Setup(mathematicalnotation = true)

[mathematicalnotation = true]

(1)

Setup(noncommutativeprefix = e)

[noncommutativeprefix = {e}]

(2)

p := Commutator(e[0], e[1])

Physics:-Commutator(e[0], e[1])

(3)

expand(p)

Physics:-`*`(e[0], e[1])-Physics:-`*`(e[1], e[0])

(4)

Suppose you want to eliminate portions of it in favor of something else. That includes, for instance, going back the operation. Here is one somewhat general way of accomplishing that. In steps, you want to use

(%Commutator = `@`(expand, Commutator))(e[0], e[1])

%Commutator(e[0], e[1]) = Physics:-`*`(e[0], e[1])-Physics:-`*`(e[1], e[0])

(5)

to eliminate e[0]*e[1]. You can do this

Physics[`*`](e[0], e[1])-Physics[`*`](e[1], e[0])

Physics:-`*`(e[0], e[1])-Physics:-`*`(e[1], e[0])

(6)

simplify(Physics[`*`](e[0], e[1])-Physics[`*`](e[1], e[0]), {%Commutator(e[0], e[1]) = Physics[`*`](e[0], e[1])-Physics[`*`](e[1], e[0])}, {e[0]*e[1]})

%Commutator(e[0], e[1])

(7)

In that way, for example, your

H[2] := a^2*(e[0]*e[1]-e[0]*e[1])*zeta[2]

a^2*zeta[2]*(Physics:-`*`(e[0], e[1])-Physics:-`*`(e[1], e[0]))

(8)

becomes

simplify(H[2], {%Commutator(e[0], e[1]) = Physics[`*`](e[0], e[1])-Physics[`*`](e[1], e[0])}, {e[0]*e[1]})

a^2*zeta[2]*%Commutator(e[0], e[1])

(9)

``


NOTE AFTER ANSWERING: You can also use the command Physics:-SortProducts  with the optional argument usecommutator; see the related help page.

Download Drinfieldstuff_display_(reviewed).mw

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

___________________________________________________________________
NOTE AFTER WRITING THE REPLY BELOW
 

Taking a look, this appeared to be an issue in the flow of IntegrationTools:-Indefinite:-RationalFunction, as @acer hinted at; it is a case where the code could go into an infinite loop and was not taking preemptive action against that. It is fixed, and the fix is distributed to everybody in the Maplesoft Physics Updates v.1113 just uploaded.

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

@itsme, others

While in principle, the issue being reported in this thread is, naturally, an issue in int or subroutines called by int, fixing - say - a bug in a simplifier can trigger a change in behaviour when computing an integral, or for the case anything else.

That said, the Maplesoft Physics Updates have been around for ~ seven years or more and, systematically, improved the Maple experience: things get fixed right away in the same way they are fixed in the version under development. You just get the fixes today instead of having to wait for the new Maple release. Take A and B into account, and some will prefer not to have these fixes in advance. Others will prefer to have them (would be my case, for that reason is that I put them available).

I also recall that neither I am external to Maplesoft nor the Physics package is an add-on. Instead, I have been a Maplesoft employee since 1997, and the author not just of Physics but also the FunctionAdvisor, the symbolic-solution differential equation code, a large part of the simplifier, several parts of the integrator, symbolic and numerical code for mathematical functions, differential algebra/geometry, etc. etc. including latex and the MmaTranslator package. All code you use every day and that doesn't feel to you as an add-on. But for whatever reason, sometimes people ask me if Physics is an add-on or whether the Maplesoft Physics Updates are a Maplesoft product. No, Physics is not an add-on, and yes the Maplesoft Physics Updates is a Maplesoft product.

I will debug this int example and write again here - though I currently do not take care of the integrator, which may make it challenging to include the fix in the subsequent Physics Updates.

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

Besides @itsme answer, which is clearly the way to experiment, the issue you point at triggers more a question than an answer: when a line doesn't fit within the margins of a paper page (your comment about "fits within the margins of my screen" is not relevant, screen and paper don't have the same margins), so: what do you expect? If the line overflows, it is bad. Also not line breaking?

To my eyes, in the example you show, the line breaking performance is a fantastic "automatic" performance. However, from your post, it is clearly not satisfactory for you. For this purpose, I implemented \\ and {}, both to linebreak where you want (regardless of automatism) and avoid a line breaking where you do not want it. All this together with the setting mentioned by @itsme is explained on the help page.

In summary, @nm I don't see something to adjust further, but for a manual touch using \\ or {} plus the suggestion about tweaking the value of the linelength setting to see if you get something that you like it better.

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

First 12 13 14 15 16 17 18 Last Page 14 of 59