ecterrab

14540 Reputation

24 Badges

20 years, 21 days

MaplePrimes Activity


These are replies submitted by ecterrab

@acer 
I understand that you're presenting what you believe is the correct way to participate in this forum. But where are these supposed 'right rules' actually written? What about others who may think differently? 

Edgardo

@nm 
I saw your other post. And the problem. It is not at all the one you posted here. And it is indeed a bug, not noticed before, I voted up your evaporated question. I really wonder what is happening here, why people's posts/questions are deleted so easily.

From what I heard, this seems to be a problem in Maple's evalc; apparently there is already a fix being tested.

@nm 
The new `assuming/restore_previous_state` is not there in the current Maple nor in any of its Updates. So, no, you have no way to test it until it is included in an Updates. I could have included it in the Physics Updates, but I prefer to stick to the plan: fixes not related to Physics go into the Customer Support Updates. I understand that soon, perhaps even today, this touch in assuming implementing the idea described in my answer, it does resolve the problem, will be included in the next Maplesoft Customer Support Updates.

@nm
The problem, not related to Physics, is "fixed", as I described above, first item. So as said, (after the implementation is made available through some Updates) you will be able to adjust the scripts that you run adding the line mentioned, as in "try timelimit(...) catch: `assuming/restore_previous_state` end try" Ditto if you interrupt with the red button: input `assuming/restore_previous_state`; And in all cases that will restore the original state that assuming was unable to restore itself due to your manual interruption. The implementation of this idea is already in Maplesoft's library under development (not yet in the kernel - see the second item), so I'd imagine (the implementation of the first item) will appear in the next version of the Maplesoft Support Updates.

Best

@Art Kalb 

From the example you posted I wouldn't arrive at the same conclusion you are arriving. Maybe if you post a worksheet showing concretely your solving block matrix equations problem, e.g. showing the input, and what you expect for output?

 @nm, part of the problem is the way you reported this issue (which exists, no doubt). Here is how I'd suggest you to report it (feel free to recast your post editing the below as you prefer and delete this comment)

 

restart;

ode:=y(x)*sqrt(1 + diff(y(x), x)^2) - a*y(x)*diff(y(x), x) - a*x = 0:
sol:=-_C4^2 + (-y(x)*sqrt(_C4^2/y(x)^2) + a*x)^2/a^2 + y(x)^2 = 0:
ode_to_test:=y(x)*(1+diff(y(x),x)^2)^(1/2)-a*y(x)*diff(y(x),x)-a*x = 0:

 

Instead of calling Physics:-Setup, skip all that and go directly to what matters for assume and assuming

_Env_Physics_assumingusesAssume := true

true

(1)

All this setting does is: "when assuming calls assume, add the keyword 'renamevariables = false' " (BTW you can check that entering debug(assume, statements = false) to just see what arrives there)

 

OK. Try solve now

solve(ode_to_test,diff(y(x),x))

(-a^2*x+(y(x)^2*a^2+a^2*x^2-y(x)^2)^(1/2))/((a^2-1)*y(x)), -(a^2*x+(y(x)^2*a^2+a^2*x^2-y(x)^2)^(1/2))/((a^2-1)*y(x))

(2)

Excellent. Next your odetest call, having in mind that you are forcing a low-level interruption with timelimit (the problem with that is that caches - some of which are meant to be cleared before a command exits - don't get cleared at all, which may result in computational problems difficult to predict)

timelimit(30,(odetest(sol,ode,y(x)) assuming integer));

Error, (in getassumptions:-Do) time expired |lib/assume/src/getassumptions.mm:79|

 

 

OK, try now that solve line again, and you see it doesn't work anymore

solve(ode_to_test,diff(y(x),x))

Warning, solve may be ignoring assumptions on the input variables.

 

 

In summary: this is not related to the native Maple Physics package, the situation looks similar to another one you reported recently. I am not working for Maplesoft at this point, just looking, if I find some time later today or tomorrow I will suggest a fix to the Maplesoft team as the other time.

 

Independent of all the above, for me, the real question here is why odetest hangs (itself not a problem in odetest by in the library commands it calls, mainly the Maple simplifiers); I can't get it to terminate even with 240 seconds, and even commenting that _Env_Physics_assumingusesAssume input line; which seems to me clearly indicates a bug somewhere else.

 


Download How_to_reproduce.mw

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

Salim, you are more than welcome. Little things like that (pde versus pdes) happen all the time; it is one of the disadvantages of computers: they do not get the context "in mind", only the "literal-and-one-at-a-time" thing. It is changing though ... Let's see.

Best

Hi
I suggest you take a look at the help page "?Physics, Examples", go directly to the section on Quantum mechanics, which starts with "Mathematical tools and their representation in Dirac notation", the first subsection is on Bras and Kets. The help pages for Bra and Ket, as well as Bracket also present the use of these commands with good examples.

Best

Hi @nm

I saw your post the day you posted. There is no question that what you show is bogus behaviour, and I understand the people at Maplesoft are working on a fix. Although I am not working for Maplesoft anymore, but still helping when I can to maintain Physics, I thought to clarify that this problem you noticed has nothing to do with the Physics package. The problem can be reproduced directly, without calling Physics:-Setup or any other Physics command. I'd guess such a fix by Maplesoft's team may be posted more or less soon.

Best!

@C_R 
You can always post the observations (not necessarily bugs) here, or write an email about them to physics (at) maplesoft.com, or write a message to me directly (click my userID here in Mapleprimes and you will see a button to contact me). As you are aware, I am not working for Maplesoft anymore, but intend to keep the Physics project alive - just not at the speed it was being developed till Dec/2024.

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

@Scot Gould 
For Maple 2025, the irst version of the Physics Udpates needs to be installed using the Maplecoud icon > packages > Physics Updates. Or else input PackageTools:-Install(5137472255164416). This is so due to an oversight by myself regarding the mechanism in the released Maple 2025.0. After you installed the first time, in all subsequent, Physics:-Version(latest) suffices.

That the Support package fails insalling in three machines ... Hopefully @aroche discovers what is going on - apparently no other user has reported experiencing the same problem.

@Scot Gould 

As @nm says, most probably there is something interferring in your computer. First: do you have a second computer where this also happens? Also I understand you also have the Physics Updates installed. Does this problem also happens when you input Physics:-Version(latest)?

Trying to understand what could be happening, if you could please also post the output of libname and whether any of these Updates packages are found also outside the toolbox/2025 directory?

@C_R 

I've been thinking about your reply — some parts aren't entirely clear to me, like your question "Why is the input...".

That said, it got me thinking: tensor calculus is more general than matrix calculus — we can work fluidly with tensors of any number of indices (rank), not just 1 (vectors) or 2 (matrices). But still, a lot of real tensor calculations, even beyond undergrad, often involve just rank-1 and rank-2 tensors, and those map neatly to fluid matrix operations.

OK. First note there exist Physics:-Library:-RewriteInMatrixForm and Physics:-Library:-PerformMatrixOperations which basically map from a symbolic abstract representation of matrix calculations (that involve matrix and vector commands, they do not show their components) into an explicit component matrix calculatiion (using Matrix and Vector commands, only work showing the components). 

But none of these Library commands switch from tensor to matrix representations when that is possible (tensors of 1 and 2 indices). And it is natural to consider the ability to switch representations — something that may be relevant in different contexts.

As said in the first reply, from matrices to tensors is easy. But we do not have something for from tensors to matrices, and those two Physics:-Library commands can incorporate this missing functionality to switch representations. I will take a closer look at this.

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

@Scot Gould@C_R, @nm
Not sure it adds to your comments, or preferences, but recall that Maple nowadays can translate to LaTeX a whole worksheet, keeping the excellent readability, automatically wrapping output, including equation labels, and equation label links, also optionally not showing the input lines, resulting int something very close to a paper presentable almost without changes to a journal.

Attached are two PDFs, generated via File > Export > LaTeX of my worksheet below, followed by Open the tex file in LaTeX and compile. Directly. Without touching a single character in the worksheet or in the .tex file generated by Maple. The first PDF is hidding the input lines. As some of you know (@nm, who helped enormously debugging this new latex command), I wrote this new Maple latex command and convert to LaTeX functionality a few years ago, replacing entirely the previous code, in connection with having to translate to LaTeX a complicated worksheet to be presented as a paper.

(By the way, I don't think Mathematica can do a translation to LaTeX of this quality.)

Besides having .mw > .tex > .pdf, there are also conversors from LaTeX to Word (several, apparently Pandoc and LaTeX2RTF are the best ones), so going with File > Export > LaTeX followed by converting the file.tex produced by Maple into a Word document you may get something better than converting PDF to Word, and without having to use other software.

Without input lines: Matrices_as_tensors-1.pdf  
With input lines: Matrices_as_tensors-2.pdf

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

1 2 3 4 5 6 7 Last Page 1 of 64