ecterrab

13431 Reputation

24 Badges

19 years, 356 days

MaplePrimes Activity


These are answers submitted by ecterrab

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.

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

Add to your initialization file:
 

`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.

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

Change your line

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

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 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

 

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

Take a lookt at the help page of the command PDEtools:-dpolyform - it does precisely what you ask, in the most general way, for multivariate expressions and nonlinear equations.

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

The title tells how. In general, it can be of help taking a quick look at the help page ?Physics,Tensors where mostly everything about Tensors is presented; or directly to the help page ?Christoffel; the nonzero keyword is mentioned there.

Besides Christoffel[nonzero], which will give you the all-covariant nonzero, with Christoffel[~, nonzero] you get the all-contravariant, and with - say - Christoffel[alpha, ~beta, gamma, nonzero] you get the corresponding ones.

Also fancy, you may want to try TensorArray(<..a tensorial expression here ...>, explore), where in your case the tensorial expression is Christoffel[... the covariant and/or contravariant indices ...]

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

Answering the question the way you put it, abs(F) always represents the absolute value of the complex variable F, regardless of whether Physics is loaded.

Now, about this Mechanics (Statics) section: in general, depending on the problem, you can choose to represent the objects with which you compute in one way or another. In this problem, the modulus of a vector - say A_ - which in Physics:-Vectors is represented by Norm(A_) - can also be represented as abs(A) (with A, not A_). Sometimes in textbooks, you see Norm(A_) represented by just the letter A, not |A| and not ||A_||.

And why using abs(A) (that displays |A|) instead of Norm(A_) (that displays ||A_||)? The technique used to solve this problem you are mentioning uses assignments. You see right at the beginning R_[B] := abs(R[B]) * _k. An assignment like this one would interrupt you with an "Error, recursive assignment" if on the right-hand side of that assignment, you use Norm(R_[B]). Using abs(R[b]) represents the object properly (within the context of this problem) avoids that recursive assignemnt, is short input, and places a visually open and close |...| which helps the readability of the output.

One could as well tackle this problem without using assignment, using equations instead, as in R_[B] = Norm(R_[B]) * _k, (note = instead of := ), then use substitutions to perform the computational steps. That is done in the majority of the other solved problems in this MaplePrimes presentation about Mechanics.

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

You can use PDEtools:-dchange, it has code for doing precisely that, among other things.

 

 

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

Download inert_matrix_products_(reviewed).mw

 

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

In retrospective, I think the most impactful decision I took when writing a new latex command  for Maple 2021 was to not rely on `latex/foo` for displaying anything. Instead, rely on the Typesetting of it, which is "what you see displayed".

At the user level of latex, this is non-obvious; at the implementation level, for me at least, it was the only natural thing: we already have, in the Typesetting code, "how things should look"; coding that a second time as `latex/foo` didn't sound right. I made the same "wipe out" of redundant code years ago when removing `D/foo` routines from the library: nowadays, D uses the differentiation rules coded as `diff/foo`.

In both cases, `D/foo` and `latex/foo`, the old mechanism is still in place, but basically used nowhere in the Maple library.

So, besides the examples shown in ?latex,functions, if you want to see something closer to the actual implementation to write your own routines, say for AnticommutatorI suggest you input the expression, have it displayed in front of you, as it comes, or construct the way you want it displayed e.g. using the palettes, and recall that since Maple 2021 latex is based on what you are a looking at (the displayed expression) , then input:

> Typesetting:-Typeset(%);

Copy the output, paste, and you can do the experiments you feel appropriate to write your `latex/foo` routine as explained in ?latex,functions.

A question related to yours is: "How do you code `print/foo`?" Nowadays, that also takes advantage of Typesetting. For instance, input with(Physics), then

> showstat(`print/AntiCommutator`)

and you will see it using Typesetting structures. From `print/AntiCommutator`  to a customized `latex/AntiCommutator` is two steps.

In fact, it suffices for you to write your `print/foo` to have that automatically taken into account by latex.

Now, the construction of Typesetting structures is not documented. But, you know, Maple is fantastic for its openness: for anything you find interestingly displayed, input lprint(Typesetting:-Typest(%)) followed by copy and paste on an input line for experimentation, and you will figure out rather quickly how Typesetting structures work. 

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

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