13331 Reputation

18 years, 154 days

way = 4;...

UPDATE MAY 1: The code in dsolve is now slightly adjusted according with the comment above, so that now dsolve(eqn) automatically produces the simpler general solution, including the singular solutions, as if you had entered dsolve(eqn, way = 4). So this issue is resolved, and the adjustment is included in the Maplesoft Physics Updates for Maple 2023, v.1437 or newer.

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

Tricky ......

Very nice challenge: your tensorial expression being defined as a tensor is of length > 50,000. One way to speed up matters is Setup(tensorsimplifier = normal), because normal is faster than the internal tensor simplifier (not so good as a simplifier though).

But in your example, something more radical is necessary. The underlying issue: when you define a tensor as a tensorial expression before proceeding, a test is performed to assure that the components can be computed. In your example, that goes a long way out of the road in the jungle of computer algebra normalizations, gcds and simplifications. One way to go is to allow for optionally "skipping" that step in Define. I'd need to see whether that has consequences (the verification of components is used in other places, what if it is not done).

I will write again in a few days, hopefully with a solution or workaround.

UPDATE May/1: in the Maplesoft Physics Updates v.1436 or newer, there is a new option for the Define command: computetensordependency = false (default value is true), which skips the most time-consuming verification step. Using this option, the Define(ition) of this tensorial expression of length > 50,000 is performed in ~100 seconds in a two-year-old Mac (M1 chip).

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

Recursive application, and Physics...

Hi
You didn't post a worksheet, so assuming "One_Form" is - say - a rank 1 contravariant tensor, see for instance the example show in ?RaiseLowerIndices with equation label (2.3), you have One_Form being "X := evalDG(D_x + 3*D_y)", the operation
RaiseLowerIndices(g, X, [1])
produces the covariant version, and the operation
RaiseLowerIndices(g, X, [1, 1])
applies recursively, as if the output was also a contravariant tensor. For example,
RaiseLowerIndices(g, X, [1, 1, 1, 1, 1, 1])
applies recursively six times resulting in
a^6 dx + 3 b^6 dy

By the way, what computations do you have in mind that would require this? Generally speaking, computations with tensors are easier using the Physics package. See the help page ?Physics,Tensors.

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

Yes, use the Physics package...

As soon as you set a prefix for entering noncommutative objects, eg. Setup(noncommutativeprefix = Z), you can work with symbolic/general/unknown matrices, e.g. Z1 * Z2 - Z2 * Z1 without receiving 0, including the possibility of setting commutator and anticommutator rules for them. See the help pages for Physics:-`*` (the multiplication operator that is at work after you input with(Physics)) and also for Physics:-Setup. Additionally, you have Physics:-Inverse to represent (or compute) the multiplicative inverse, Physics:-Gtaylor for computing series involving these non or anti-commutative objects, and Physics:-diff for differentiatiing expressions involving them and Physics:-Simplify to simplify these algebraic expressions. If at some point you prefer to actually compute products of matrices, use Physics:-`.`. The corresponding help pages have illustrative examples.

Alternatively, you can compute with tensors with two indices representing these matrices (use genericindices to represent matrices of unknown dimensions see ?Physics:-Setup), and if you use this approach, also, Physics:-KroneckerDelta indexed with the indices of generic type you set represents a generic identity matrix.

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

No and Yes....

No, you cannot have two Riemann tensors "set at the same time".

It is however easy to have as many "Riemann tensors" as you want for different metrics; not the way you suggest but as follows.

Start setting any non-flat metric, only to be able to work with formulas that do not automatically evaluate to zero when there is no curvature. E.g.

 (1)

So now, how is the Riemann tensor computed?

 (2)

Express everything in terms of the metric

 (3)

You see you have a sort of template here. Define a new tensor R and call g_ as G

 (4)

 (5)

And that is basically all. This approach is of use not only for the Riemann tensor but for everything that has a definition - pre-existing one or that you construct. To compute the components of this R tensor, indicate (define)  to represent whatever metric (4 x 4 symmetric matrix) you want, and the formula above represents the corresponding Riemann. For example,

 (6)

 (7)

These are the components of R

 (8)

If you want to ignore those with right-hand side equal to zero, go with

 (9)

To get the components of Riemann for a different metric, naturally, you need to indicate the different metric. You get the idea. Define G and get the component of R using TensorArray.

You may prefer to explore these components, as in

 (10)

Or get all the non-zero ones in a sort of more compact form

 (11)

There are other ways of accomplishing the same, basically exploring that you can Define tensors represneting any tensorial equation you want. See ?Physics,Tensors, section 2.c amd 2.j.

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

Physics:-Redefine...

That command redefines the tetrad (either the one set, or any other one that you pass) according to the signature you want - check ?Physics,Redefine and the Examples section.

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

This is fixed, and the fix is distributed to everybody using Maple 2023 within the Maplesoft Physics Updates v.1430 or newer.

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

Two different things...

Entering

subs(-e - r = s*(e + r), s = -1, %)

You get - (e + r) * cos(alpha/2-90), which is one thing. Is it possible to address this systematically? Yes, and I would vote for it. How? It would require a change in the so-called kernel, maybe in a new version of Maple; or maybe I find a way to resolve this at the so-called library level and distribute this within the Maplesoft Physics Updates.

The second issue is, as mentioned by @acer : there is a normalization for all mathematical functions; in the case of cot, you have cot(90 - z) -> -cot(z - 90). This can also be changed to be the reverse of that, but why would one do that? Your expression is very particular; for a different expression, the current normalization may look more convenient; besides that, too many things were coded over the years that may or not work as in the past if you change the normalization of a function. I wouldn't vote for such a change in the normalization of cot.

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

One way you can do it...

`simplify/trig/from_sincos/do/22` := eval(`simplify/trig/from_sincos/do/2`):
`simplify/trig/from_sincos/do/2` := () -> eval(`simplify/trig/from_sincos/do/22`(args), [csc = 1/sin, sec = 1/cos])

That suffices to achieve what you are asking. Now, changes like this would require testing to be sure that there are no other things in Maple 2023 that rely on the new csc and sec output by simplify; I suppose through using this or equivalent approaches you will discover.

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

[x = rho*cos(phi(t)), y = rho*sin(phi(t)...

You forgot to tell the system that phi is not constant? You indicate that entering not phi but phi(t). Use the transformation equations in the title to get the result you expect for non-constant phi(t). Independent of that, in your worksheet, I see just cos, instead of cos(phi) or cos(phi(t)).

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

for ~i in [ ~1, ~2, ~3, ~4] do...

for i from 1 by 1 to 4 do

by

for ~i in [ ~1, ~2, ~3, ~4] do

This change may be sufficiently self-explanatory; if not, feel free to ask. To the side, these commands are related to your work, and you don't use them:

• CompactDisplay (you don't need PDEtools, nor PDEtools:-declare)
• SubstituteTensorIndices (as in SubstituteTensorIndices(i = Physics:-Library:-Contravariant(i), ...)
• TensorArray (this does visually what you are doing in a difficult-to-read double loop
• Setup(cosmologicalconstant = ...)
• Gtaylor (instead of convert(series(....), polynom)

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

Hi

A correction for this is distributed within the Maplesoft Physics Updates v.1423.

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

works fine in Maple 2023....

For historical reasons only, Maple preferred the form rational in sin and cos. That has changed in Maple 2023:

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

Hi Jean-Michel Indeed the web page for t...

Hi Jean-Michel
Indeed the web page for the Maplesoft Physics Updates, a webpage that gets updated at every release, was not up-to-date :). It is now, and tells, as @Pascal4QM says, that the last update for Maple 2022 is v.1409.

Best

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

Fixed within the Maplesoft Physics Updat...

Hi
A fix for this one is distributed to everybody using Maple 2023 within the Maplesoft Physics Updates v.1414 or newer.

To install the Physics Updates in Maple 2023, use the MapleCloud toolbar to install the package - you need to do this once; then use Physics:-Version(latest) from the GUI in order to get next updates.

Note that the Maplesoft Physics Updates webpage reports v.1414 as being for Maple 2022, but that is not the case. This webpage is waiting for an update, probably this week. The last version of the Physics Updates for Maple 2022.2 is v.1409 and to install it in Maple 2022 input Physics:-Version(1409);.

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

 1 2 3 4 5 6 7 Last Page 3 of 55
﻿