## 9729 Reputation

15 years, 280 days

## \usepackage{hyperref}...

The file you refer to as "my latex file" misses basically all the LaTeX CTAN-official packages that the maple.sty expects in place, in the latex file, to translate (say) everything you could see in a Maple sheet.

To see the packages missing in your latex file, go File > Export > LaTeX and look at the preamble, the usepackage{xxx} statements Maple put there. In the specific example that you posted, you cannot remove \usepackage{hyperref} before \usepackage{maple}. Put it there, and you won't see the interruption you show.

That said, there are one natural workaround and one issue, both not mentioned in your post.

The natural workaround: you know, when the latex compiler interrupts asking you as you show, just press 'r' to see what happens, and you see the compilation running to its end even if you do not put any of the usepackage{xxx} that are expected to be there, however, are missing in your latex file.

The issue: in the output by latex or File > Export > LaTeX for this example you posted, there is a non-ASCII and non UTF-8 character in the translation, appearing as \textrm{◦}, that needs to be translated properly. It is a minor thing but also generates a latex compilation interruption, that you also go over it pressing r. It is also easy to adjust; to appear resolved in an upcoming Maplesoft Physics Updates during the week.

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

Hi nm,

There are a couple of things going on, all worth giving this example a closer look, in a context where I will have time for dedicating a full day to this only after April/9.

The easy observations: 1) measuring the time taken when the computation succeeds, as in _t0_ := time(): timelimit(60*10,pdsolve(pde,w(x,y))); "time consumed" = time() - _t0_;  it takes approx 1500 seconds in my computer; that is more than 60*10. 2) The computation sometimes doesn't complete also without executing that latex:-Settings command, and I reproduced both things in Maple 2020 too.  Finally, why is it taking so much time? (I suspect int and the simplifications under evala, but have not verified that).

At this point, without time to investigate further, my understanding of "what could be" going on is that the latex:-Setting command you execute allocates some computer memory here and there such that, afterwards, some operations within some internal blocks of code that could go more than one way (because for that block of code both ways are equivalent and Maple chooses the way according to the allocation of memory in a session dependent manner),  compose, in the end, into a different computational path, one of which hangs. That would explain 2).

I added now a touch to latex to minimize furthermore the operations performed (and so the allocation of memory) when you latex:-Settings. With only that I got two runs in a row without hanging (still at approx 1500 sec each to complete the computation, so 1) and 3) are still there.

I added that tweak in a new Maplesoft Physics updates v.936 that anyone with Maple 2021 can download. But this is worth one or two days to understand and fix 1), 2) and 3). I will try to come back to this approx. mid-April, and please post again here if you see more of these problems; thanks.

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

## maple\toolbox\2021...

Hi Wolfgang,

I don't know what could be happening at your end and notified about your problem the people at the company who take care of the installation of MapleCloud packages. Anyway here are some things I would suggest you to check

1. Maple 2021, as all previous Maple releases, comes with Physics out of the box within its main library maple.mla located in the lib directory below the one shown by kernelopts(mapledir). Make sure you do not have any other Physics Updates library around. Remove the "Physics Updates.mla" you have under maple\toolbox (as per the message you posted). Check your libname variable (a sequence of directories) too, take a look there just in case.
2. Next, how did you install the Maplesoft Physics Updates? Either one of these two approaches should work fine:
1. Open Maple and input Physics:-Version(latest); then follow instructions (to close and reopen Maple).
2. Open Maple, click the MapleCloud icon (upper right corner), then click Packages, select the Physics Updates, and click that downside arrow at the right of the package's row.

The result of 1. or 2. should be the Updates installed in your computer as you see in this image taken from mine after following the steps above now:

If this is not the case, then we have a problem beyond what I could help (as said, the people are already notified that could be the case). In that case it is also important: what version of Windows are you using?

And if when you try 1. or 2. the package again installs under maple\toolbox instead of under maple\toolbox\2021, until people understand what happened at your end I'd suggest you create the directory 2021 and move the whole "Physics Updates" directory under it, manually.

Let's see then if 1. or 2. work for you?

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

## to share the kernel or not; tabs and win...

I don't know the difference between those two Maple 2020 icons - I suspect it is none. But your question reminds me of one of the most useful Maple's features that is somehow hidden: having one worksheet open, you can open another worksheet

•  either sharing the kernel with the open one, or with an entirely new kernel
• either as a tab or in a new window - even put the two windows side by side

So what is this 'kernel' business about? The word, unfortunately, means nothing to me, but translates to this: when you have two worksheets sharing the kernel, it means the computations you do in one of them are active in the other one; e.g. you assign A := 1, go to the other worksheet, input A, and the output is 1. Not sharing the kernel means, naturally, the opposite: computations done in each worksheet are entirely independent, not shared.

Sharing the computations done in two or more worksheets allows for quick drafting (on a second worksheet) without messing around with the text and formulas developed in the first worksheet (the main line of thoughts). It is advantageous.

Not sharing the computations among some worksheets is also extremely useful: It allows for experimentation without changing any results obtained in the first (main) worksheet.

Depending on the context, sometimes sharing, sometimes not sharing, is the way to go. Moreover, having one worksheet open, you can have several other ones sharing the computations, and at the same time several other ones not sharing computations with any other one. For each new worksheet, you can choose whether to share or not the computations with any other open worksheet.

And how do you have access to this (for me, fantastic) feature? Open the Maple preferences pane and, in General, where you see "How should Maple handle the creation of a new Math Engine?, choose "Ask each time a new document is created."

The other feature is about opening new worksheets in tabs or new windows. The default is tabs, but windows is also handy: you can put two worksheets side by side and compare the computational flow, sharing, or not, the kernel (computations). To have two worksheets open in two windows (sharing or not the computations), you can: a) in the preferences, Interface > Open worksheets in: choose "New Window" instead of "New Tab"; or b) keep the default of opening in tabs, then right-click a tab and choose "Open tab in a new window".

To summarize, given two worksheets open, you have four options: have them in tabs or separate windows, and share or not the computations. Somehow, few people are aware of that, a concretely useful feature.

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

## Yes and no....

First, use Physics; for computations with tensors is simpler. You cannot assign the Maple command Christoffel, it has a unique definition. What you can do, however, is to define another tensor, say you call it Gamma, and use that tensor in your computations; likewise, you can define everything: another Riemman and Ricci tensors, even another covariant derivative, etc. See the ?Physics,Tensors help page, the sections on how to define tensors.

It is useful if you post the problem, or an example that illustrates what you need.

Now, isn't it you who earlier today posted on how to computer the Ricci tensor in 2-D spacetime, saying you were new using Maple? I was on my way to answer that question when the question disappeared. If that is your case, bring the question back and I'll finish the answer and post it here.

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

Hi

Copy as LaTeX translates considering the expression given "as input". If you pass the option thisisinput, or File > Export > LaTeX, you see that input is translated with (), not \left( \right), while output is translated with \left( \right). That has to do with reproducing the differences you see in the Maple sheet and the different automatic line-breaking approaches used for input and output.

That said, I see your point, Copy As LaTeX translating as input is ok, but most of the time, we prefer to copy translating as output, with \left( \right), as we get when latex(expression). I added now a new option in latex:-Settings (see the help page ?latex), copyaslatexinput with default value = false, so that we get those \left and \right by default when you Copy As LaTeX, the same way it was/is when you latex(expression). When that new option is set to true we have the previous behaviour.

The new behaviour is in the version of latex within the Maplesoft Physics Updates for Maple 2021, v.931 and newer.

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

## Section I, subsection 2.b and 2.c of Phy...

What you show is not the way to achieve your input/output (4) as you want. Instead, please see the help page ?Physics,Tensor, Section I, subsection 2.b and 2.c. If you find something unclear in anyway please post here again and I will help with that.

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

## debug(int, statements = false)...

So the error interruption happens within int. This is not my area but it is tracked now, to be fixed.

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

## debug(int, statements = false)...

So the error interruption happens within int. This is not my area but it istracked now, to be fixed.

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

## Physics:-ExteriorDerivative...

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

## arbitrary dimension: you cannot...

In the context of the Maple Physics package, the dimension is always set to a positive integer, from 2 to any such number. To be clear, the metric yes can be set to arbitrary, but not its dimension.

Now, I'm curious about the context of your computation requiring not having the dimension set - what is it? I'm familiar with arbitrary dimension mainly in the context of computing Feynman Integrals, where to regularize the integrals they are computed not in dimension = 4 but in dimension 'd' (a continuous variable, not even integer). So maybe if you post the formulation of your problem we can see whether the problem is or not tractable on a Maple sheet?

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

## Physics...

Yes, using the Physics package, there is more than one way. The most natural is perhaps defining the Action and taking the functional derivative with respect to the field. To define the Action, you use the Lagrangian L you show as the density in a 4D integral (Physics:-Intc command), then take the functional derivative (command Physics:-Fundiff). You can see that and related examples, including how to input the Lagrangian density, on the help page ?Physics,Fundiff, and in ?Physics,Tensors, Section I subsection 8. Or open the help page ?Physics,Examples, and check the section on Classical Field Theory.

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

## Physics Updates for Maple 2021 v.928...

I looked. In Maple 2021, there are changes in int, assume/is/coulditbe, the simplifiers, ... and in Physics. Although these changes are, in principle, all good, the way they were composing with your example was not. I adjusted the code, and thanks for reporting the problem; with that the programs work better and better.

The adjustment is distributed for everybody using Maple 2021 within the Maplesoft Physics Updates v.928 or newer.

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

## Hi nmPhysics is part of the Maple system...

Hi nm

Physics is part of the Maple system (not an addition). Enter with(Physics) in Maple 2021 and you see it is there. Now more advanced than ever. But there is not yet a Maplesoft Physics Updates for Maple 2021. Maple 2021 just got released today. While there is some new material already, the Maplesoft R&D Physics webpage still needs to sync to the new release.

Yes, the (uppercase) Latex command distributed within the Maplesoft Physics Updates during Maple 2020 appears in Maple 2021 as the (lowercase) latex command, check What is new in LaTeX in Maple 2021. So you just need to change Latex by latex in your scripts; it is, bit by bit, one and the same program. Note also the maple.sty file distributed with Maple 2021 in the /etc/ directory of your Maple installation: it has the definitions for several LaTeX macros that you asked here in Mapleprimes, missing form the 2020 version of the sty files. And yes, the then upcoming renaming Latex -> latex for Maple 2021 was mentioned in advance here in Mapleprimes a month or two ago.

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

## subs versus eval...

Hi

In Maple, when you just substitute something, the evaluation of the result does not happen. Try for instance subs(x = 0, exp(x)). To substitute and evaluate you need to use the eval command instead of subs. Or, subs followed by something else that performs the evaluation, for example %. So for the second block of commands you show, you can:

> Z := X + Y + (1/2)*Commutator(X,Y);
Z := X + Y + 1/2 [X, Y][-]

> subs(X=Y,Z);
2 Y + 1/2 [Y, Y][-]

> %;   # This makes "the above" get fully evaluated

2 Y


Alternatively,

> Z := X + Y + (1/2)*Commutator(X,Y);
Z := X + Y + 1/2 [X, Y][-]

> eval(Z, X = Y);
2 Y

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

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