ecterrab

14540 Reputation

24 Badges

20 years, 21 days

MaplePrimes Activity


These are replies submitted by ecterrab

@nm 

There are some things interrelated. One is the one you focused when you posted: timelimit is expected to interrupt in time, but it wasn't (this is addresed in the Physics Updates v.627 by dodging the problem). The timelimit problem is tracked. Then there is the problem in trig/reduce also dodged in v.627, but there is a problem in trig/reduce, also tracked. Next there is a problem in int also tracked. Finally, if all that works, there is the question of whether the Maple implementation of the character strip method (that includes several tweaks and twists enough for a large post) can solve this particular problem. It can certainly solve many of these problems. And before I forget about this again: many thanks for posting the example, the library grows with these posts.

On a separate note, I am on my way, with Katherina von Bulow, preparing a comparison of performances on tackling all the non-linear PDEs of Polyanin's textbook.

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

@Preben Alsholm 

Good insight; I am adding that information to the report of the problem, for the people who develop the integrator.

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

@nm 

As you may have noticed, there is still the issue of why it hangs in int. This is the integral: int((sin(lambda*x)*cos(mu)+cos(lambda*x)*sin(mu))^k*(x^n)^2, x). That has also been tracked; it shouldn't hang there either. From what I can see (by eye) I'd say, with high probability, that this integral is uncomputable; most integration methods don't apply in a case like this one, from where I would expect the code to give up quickly.

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

The Maple 2020 version of the Physics package is also one of the most exciting releases. Besides consolidation of previously existing functionality, based on feedback along the year, getting echo on those improvements by making them available around the clock through The Maplesoft Physics Updates, for Maple 2020 there are significant (breakthrough) developments in

The whole list is large. The details are in What is new in Physics for Maple 2020.

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

To the side, when teaching how to use computer algebra at university, the first programming exercise I passed was to write, using the Maple programming language (that is so close to plain English), a 'structure' program, that shows the structure of any thing you pass to it. For example:

structure(A + B)

                               [`+`, [A, B]]

structure((A + B)*C)

                      [`*`, [[`+`, [A, B]], C]]

The key command for this is op (for operand). None of this is necessary for representing Maxwell equations. Still, you or others may find this comment of value. I noticed that everybody who spent an afternoon tunning such a structure command developed some orders of magnitude of intuition about how computer algebra systems work, speeding up matters at the time of using them.

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

 

@Steve Roper 

Right before your eq.(4.4), instead of subs(Eq_1, %) use simplify((4.3), {Eq_1}, {E__field_(x, y, z, t)}). That will accomplish, in one go, the two things you are asking, that is to replace E by D and to expand the double curl.

If you want to achieve the same in two steps, then instead of subs(Eq_1, %), use subs(isolate(Eq_1, E__field_(x, y, z, t)), %), followed by expand(%).

Then if you want as you say to enforce Divergence(D) = 0, say the output of the previous line is eq.(4.5), enter simplify((4.5), {Nabla . D__flux_(x, y, z, t) = 0}).

I also see that in your worksheet you use % instead of equation labels. You are missing one of the best features of the Maple system :) Serious, give a look at ?equation,labels.

Three more comments.

In brief (you fill the dots or read the papiro help page ?simplify,siderels) a line of the form simplify(A, {B}, {C}) just means: simplify the expressions A (could also be a set or list of expressions) using the equations in the set {B} to eliminate the objects you indicate in the set {C}.

Regarding the previous answer, on why you need to first differentiate (or use isolate in the alternative above in two steps), always think operands of an operation, everything is of that form. When using substitutions, then, think substituting operands. When using subs, you always substitute the left-hand side by the right-hand side. In Maxwell_2, the left-hand side is  Curl of H. In eq.(4.2), the target, there is no Curl of H operand, but Curl of the derivative of H operand (it is the operand [2, 3]; try op([2, 3],...)). Altogether, you need a left-hand side substitution equation with the Curl of the derivative of H. Differentiate Maxwell_2, and you have it.

To the side: if you have eq := A = B, but you actually want to substitute B by A in some expression (so subtitute the rhs by the lhs), then remember that (rhs = lhs)(eq) returns B = A, that you can now use with subs.

The third comment is about your comparison with Mathematica. In Maple, we have inert objects, since the year 2000. Everything preceded with % is an inert object, and you activate inert objects using the value command. In Mathematica, since their version 10 (kinda recently) you have 'Inactive,' that you activate using 'Activate.' They got the idea, even the grey display introduced in Maple to represent inert objects. BUT there is a significant difference: in Maple, you can differentiate, simplify, compute series and operate in general over inactive objects (more and more flexible at each release), I don't think you can do that with Mathematica and Inactive[] structures. Less relevant, however important too, both input and output in Maple are more natural (the % prefix is delicate if compared with enclosing things in Inactive[], this is especially relevant when there are nested objects like functions with arguments). You didn't use inert forms to formulate these equations in your worksheet, but you can, if you wish.

Finally, the Physics:-Vectors package has a large number of computational properties and mathematical operations implemented - there is no equivalent to this package in Mathematica. This difference is not small. Because of Physics:-Vectors, you can formulate these equations also with non-inert objects as you are doing (in Mathematica, you cannot do it  without Inactive). Next, give a look at the input lines used in the Mathematica notebook you linked, things like Inactive[Curl][#, {x, y, z}] &/@ ampere /. j -> (0 &) and compare with the input lines you are using in a Maple worksheet and you see the issue. Because in Maple you have computational representations for the objects, their properties and related operations, you can first think, then input things almost as you do with paper and pencil (but for having in mind this operands of operators subtlety). Input lines like the one shown above and others seen in the Mathematica notebook linked are not of that sort.

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

For A and B 4x4 matrices where A . B = B . A = Identity matrix, you do not have A[2,2] * B[2,2] = 1. So your idea of verifying that f = e^(-1) by taking e[~2, 2] * f[~2, 2] and expecting the number 1 is not correct. For example, enter A := Matrix(4, symbol=a), then B := A^(-1), then try A[2,2] * B[2,2]: you do not get 1.

That said, I opened your worksheet: you define `e` indicating a Matrix 4x4 in equation (12). Then you define `f` also indicating a Matrix 4x4 in equation (13). But if you take the product of those two matrices you do not get the identity matrix. So it is not the case that f = e^(-1) as you say.

Besides that there is a wrong use of the Redefine command: from what you entered, it is not 'fromsignature' but 'tosignature'. You see that from the output of the command, with a -1 in position (3, 3) instead of (1, 1) as is clear from your line element ds2, that starts with -dt^2, and the coordinates you set that have t in position 1.

I suggest you to first assure you have the right definitions for e and f, that the matrices you are using to define them are indeed inverses of each other. For that purpose, just take the product of the two matrices (use the dot operator, . , not the start operator *) and if you don't get the identity matrix for the result then you know you don't have matrices such that f = e^(-1).

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

Your statement is missing substance. Literally, it is not true. I can type everything in the Maple GUI and it is not hard, at all. So you must be having something more specific in mind. Could you please explain what you are talking about?

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

@acer 

From wiki: "According to the Raspberry Pi Foundation, more than 5 million Raspberry Pis were sold by February 2015, making it the best-selling British computer.[10] By November 2016 they had sold 11 million units,[11][12] and 12.5m by March 2017, making it the third best-selling "general-purpose computer".[13] In July 2017, sales reached nearly 15 million.[14]In March 2018, sales reached 19 million.[15]". 

I don't know how many of them came with a copy of Mathematica, and of course, not everybody uses the software that comes with a computer, but looking at those numbers I'd say it is a significant way of reaching people.

Raspberry Pi 4 Model B was released in June 2019 with a 1.5 GHz 64-bit quad core processor, on-board ac Wi-Fi, Bluetooth 5, gigabit Ethernet, USB 2.0 and 3.0 ports, and dual monitor support (4K resolution). Wow.

These are small computers developed in the UK to promote the teaching of basic computer science in schools and in developing countries. That 2019 newest model runs versions of linux and windows 10, cost approx 35 dollars and is of the size of a credit card, albeit without peripherals like keyboard, mouse or screen. All in all, I like the project. It looks like a nice idea that is having more impact than what they have antecipated. All the info is from wikipedia.

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

@macrobbair 

Yes, that is what is written in the previous reply. Quoting from there: "Could you please upload a worksheet with the formulation and related text comments? For that purpose you can use the green arrow you see when you write a comment / question here in Mapleprimes."

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

@macrobbair 

All OK with you loading a metric or tetrad by hand, but It is not clear what you are doing or how to help you just from text (for example, I don't understand what you meant by something 'going wrong with the indices' or 'red comment'). Note as well that you can always edit a previous post, for example, to make it more clear, just click More -> Edit and proceed.)

Could you please upload a worksheet with the formulation and related text comments? For that purpose you can use the green arrow you see when you write a comment / question here in Mapleprimes.

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

@denitsastaicova

You say "For more complicated metrics, that procedure [calling Physics:-e_[]] may fail ". Sometimes (mostly radicals around) the simplifications may be difficult. The procedure, however, does not fail in that it is systematic and correct.

 

Consider for instance the more general situation, that of an arbitrary spacetime metric depending on 10 arbitrary functions of 4 variables:

with(Physics)

g_[arb]

_______________________________________________________

 

`Systems of spacetime coordinates are:`*{X = (x1, x2, x3, x4)}

 

`Default differentiation variables for d_, D_ and dAlembertian are:`*{X = (x1, x2, x3, x4)}

 

`The arbitrary metric in coordinates `*[x1, x2, x3, x4]

 

_______________________________________________________

 

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

(1)

"CompactDisplay(?)"

` _F1`(X)*`will now be displayed as`*_F1

 

` _F10`(X)*`will now be displayed as`*_F10

 

` _F2`(X)*`will now be displayed as`*_F2

 

` _F3`(X)*`will now be displayed as`*_F3

 

` _F4`(X)*`will now be displayed as`*_F4

 

` _F5`(X)*`will now be displayed as`*_F5

 

` _F6`(X)*`will now be displayed as`*_F6

 

` _F7`(X)*`will now be displayed as`*_F7

 

` _F8`(X)*`will now be displayed as`*_F8

 

` _F9`(X)*`will now be displayed as`*_F9

(2)

Load Tetrads

with(Tetrads)

_______________________________________________________

 

`Setting `*lowercaselatin_ah*` letters to represent `*tetrad*` indices`

 

((`Defined as tetrad tensors `(`see ?Physics,tetrads`)*`, `*`𝔢`[a, mu]*`, `)*eta[a, b]*`, `*gamma[a, b, c]*`, `)*lambda[a, b, c]

 

((`Defined as spacetime tensors representing the NP null vectors of the tetrad formalism `(`see ?Physics,tetrads`)*`, `*l[mu]*`, `)*n[mu]*`, `*m[mu]*`, `)*conjugate(m[mu])

 

_______________________________________________________

(3)

An orthonormal tetrad in this the most general case, is computed in 2 seconds

time(); e_[]

Physics:-Tetrads:-e_[a, mu] = Matrix(%id = 18446744078401956910)

(4)

(time()-`%%`)*seconds

1.989*seconds

(5)

Verify this result

"IsTetrad(?)"

`Type of tetrad: `*orthonormal

 

true

(6)

Also for a null tetrad

Setup(tetradmetric = null)

[tetradmetric = {(1, 4) = 1, (2, 3) = -1}]

(7)

time(); e_[]

Physics:-Tetrads:-e_[a, mu] = Matrix(%id = 18446744078621641654)

(8)

(time()-`%%`)*seconds

.598*seconds

(9)

Verify this result

"IsTetrad(?)"

`Type of tetrad: `*null

 

true

(10)

``

So even in the most general case the procedure within the Physics package to compute a tetrad works. Not the topic, but, given a metric there are infinitely many possible tetrads. So relevant in this context is also the TransformTetrad  command, that allows for reorienting a tetrad in rather general ways.


 

Download Tetrads_for_the_most_general_case.mw

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

 

@Carl Love 

Somehow I didn't get notified by Mapleprimes and only saw this one by chance now. Dmitry, the definition of normal form for an ODE depends largely on the person speaking - see also the help page ?convert/ODE. For hyper-normal forms I only found a paper with 40 pages.

Could you please upload a worksheet with what you expect and one single (simple) example?

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

@lastgunslinger 

I revised your worksheet. You say "The problem arises in the above computation, namely, the inner product taken between f[~mu,nu]*h[mu,beta,alpha],the inner product should be taken on the first index of each of the tensors, yet the results do not correspond to reults already computed. The antisymmetry is gone and the corresponding values do not coincide."

But neither you show what are these results "already computed" nor what antisymmetry are you talking about (none of the tensors you show is antisymmetric). From your worksheet, I have no way to understand these two statements.

I also see that you define tensors using TensorArray but without the freeindices keyword, and with some indices contravariant. The freeindices tells what is the ordering of the free indices - this is key when there are more than two indices, as in your case. Defining tensors with some indices contravariant, although possible, it is problem to problems since you don't know, from start, what are the components of the all covariant tensor (will depend on the metric, you understand).

Attached is a reviewed version of your worksheet, removing some lines that are not necessary and using some other tools to investigate the symmetries of the resulting tensors. I suggest you

  1. Use the keyword freeindices of TensorArray to see exactly what is the ordering of the indices in the rhs of your definition (I show how to do that in the reviewed worksheet below).
  2. Make your indices be all covariant by multiplying by the metric, then taking TensorArray to see, exactly, what are the covariant components of the tensors you are defining.
  3. Use Library:-GetTensorSymmetryProperties to see the symmetry properties of the resulting tensors, and/or do some verification in any other way regarding these symmetry properties, before constructing the inner product you expect to be antisymmetric.

Then it would be possible to understand whether the last result should or should not be antisymmetric.

Download Maple_inner_tensor_product_(reviewed).mw

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

 

@lastgunslinger 

I see a worksheet with a rather long computation, but not using current Maple Physics but the old tensor. That old code worked fine but it is very old, not as capable as Physics, and not what I was asking for. Sorry for that, I do not work using that code since too many years.

In order to help you further please attach a worksheet with your computation using the current Maple Physics. Please also have in mind: the idea is to help you, that requires you to rewrite the worksheet (expressing the computation using Physics). Where you have a doubt, just present please the worksheet up to what you understand and the question.

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

First 22 23 24 25 26 27 28 Last Page 24 of 64