## Physics Packages for Maple 2022.2...

Hello Edgardo and everyone,

I have a big problem.

I just reinstall from scratch Maple 2022.2 (i Don't have 2023)

and try to install The Physics Package, it failed.

Where can I get the latest Physics Package for 2022.2 ?

I need it.

Egdardo I think you are too "fast" to users who have not yet  upgrade to the

Take care and thank you for this Package.

Kind regards,

Jean-Michel

## How to compute definite integral...

> int((1 - x)^r*(-2*x + (-2 + x)*log(1 - x))/(2*x*log(1 - x)^2), x = 0 .. 1) assuming 0 <= r

Expected result is:

1 + r - r * ln(1 + r) - 1/2 * ln(2 * Pi * (1 + r)) + lnGAMMA(1 + r)

## (Bug) Units package gives different output...

Hi,

Can anybody explain why

with(Units):
A := 1, 2, 3:
B := 4, 5, 6:
AB := B - A;

outputs 11, but the output is 3, 3, 3 without the Units package?

Best regards,

Mikkel

## Why is zip slower than ~?...

For two nonempty lists (of the same length),

F~(list1,  $, list2); # space-dollarsign is (almost) equivalent to zip(F, list1, list2); However, it appears that in practice, using ~ can be faster than its equivalent zip version. Here is a typical test:  > restart;  > x := combinat:-randperm(10^7): y := combinat:-randperm(10^7):  > undefine(f);  >  memory used=0.62GiB, alloc change=1.21GiB, cpu time=51.35s, real time=14.77s, gc time=42.55s  >  memory used=0.52GiB, alloc change=-4.00MiB, cpu time=53.88s, real time=16.25s, gc time=44.51s  >  (1)  > Download ~_and_zip.mw But I cannot find any explanations in the documentation (as well as What is Maple's equivalent to Mathematica's MapThread?). Does anyone know why? ## How does the range option affect the way dsolve/nu... Asked by: I recently got stuck on a strange behavior of odeplot which did not return any result (only the axes were drawn). Convinced that the solution of the differential system was correctly constructed, I noticed that drawing it, without using odeplot, gave me the correct result. I then discovered that the range option (which I mistakenly defined) was the cause. But this led me to the following question: what does this option really do? Here is a notional example. The two questions are at the end of the worksheet.  > restart:  > interface(version)  (1) EXAMPLE 1  > sol := dsolve({diff(x(t), t) = t, x(0)=0},numeric, events=[[x(t)=2, halt]], range=0..1)  (2)  > # As range is defined up to t=1 and x(t) = t^2/2 = 2 for t=2 it seems "normal" # for the event not to be fired: Tend := sol(eventfired=[1])[]  (3)  > # But the limitation induced by range seems ignored by odeplot: plots:-odeplot(sol, [t, x(t)], t=0..4); EXAMPLE 2  > sol := dsolve({diff(x(t), t) = t, x(1.1)=0},numeric, events=[[x(t)=2, halt]], range=0..1)  (4)  > # For the same reason the event is still not fired here Tend := sol(eventfired=[1])[];  (5)  > # odeplot doesn't return any plot. # # This seems logical given that range=0..1 is not consistent with the initial # condition set at t=1.1 # Nevertheless the warning message looks contradictory with the fact that the event is not fired plots:-odeplot(sol, [t, x(t)], t=1.1 .. 4);  > # Remark: using refine seems to fix this problem plots:-odeplot(sol, [t, x(t)], t=1.1 .. 4, refine=1);  > # Let's try to plot the solution differently. X := proc(s) eval([t, x(t)], sol(s)) end proc: plot([seq(X(s), s=[seq](1.1 ..4, 0.1))])  > # Why is the solution calculable? # Why can't odeplot calculate it?  > Download The_role_of_range.mw Please note that the last couple of commands strangely overpasses the < Warning, cannot evaluate the solution further right of 2.2825424, event #1 triggered a halt > limitation. ## A request for the implementation of the inverse... by: Maple 2023 The inverse problem of a mathematical question is often very interesting. I'm glad to see that Maple 2023 has added several new graph operations. The GraphTheory[ConormalProduct], GraphTheory[LexicographicProduct], GraphTheory[ModularProduct] and GraphTheory[StrongProduct] commands were introduced in Maple 2023. In fact, we often encounter their inverse problems in graph theory as well. Fortunately, most of them can find corresponding algorithms, but the implementation of these algorithms is almost nonexistent. I once asked a question involving the inverse operation of the lexicographic product. Today, I will introduce the inverse operation of line graph operations. (In fact, I am trying to approach these problems with a unified perspective.) To obtain the line graph of a graph is easy, but what about the reverse? That is to say, to test whether the graph is a line graph. Moreover, if a graph g is the line graph of some other graph h, can we find h? (Maybe not unique. **Whitney isomorphism theorem tells us that if the line graphs of two connected graphs are isomorphic, then the underlying graphs are isomorphic, except in the case of the triangle graph K_3 and the claw K_{1,3}, which have isomorphic line graphs but are not themselves isomorphic.) Wikipedia tells us that there are two approaches, one of which is to check if the graph contains any of the nine forbidden induced subgraphs. Beineke's forbidden-subgraph characterization: A graph is a line graph if and only if it does not contain one of these nine graphs as an induced subgraph. This approach can always be implemented, but it may not be very fast. Another approach is to use the linear time algorithms mentioned in the following article. • Roussopoulos, N. D. (1973), "A max {m,n} algorithm for determining the graph H from its line graph G", Information Processing Letters, 2 (4): 108–112, doi:10.1016/0020-0190(73)90029-X, MR 0424435 Or: • Lehot, Philippe G. H. (1974), "An optimal algorithm to detect a line graph and output its root graph", Journal of the ACM, 21 (4): 569–575, doi:10.1145/321850.321853, MR 0347690, S2CID 15036484. SageMath can do that:  root_graph() Return the root graph corresponding to the given graph.  is_line_graph() Check whether a graph is a line graph. For example, K_{2,2,2,2} is not the line graph of any graph. K2222 = graphs.CompleteMultipartiteGraph([2, 2, 2, 2]) C=K2222.is_line_graph(certificate=True)[1] C.show() # Containing the ninth forbidden induced subgraph.  Another Sage example for showing that the complement of the Petersen graph is the line graph of K_5. P = graphs.PetersenGraph() C = P.complement() sage.graphs.line_graph.root_graph(C, verbose=False)  (Graph on 5 vertices, {0: (0, 1), 1: (2, 3), 2: (0, 4), 3: (1, 3), 4: (2, 4), 5: (3, 4), 6: (1, 4), 7: (1, 2), 8: (0, 2), 9: (0, 3)})  Following this line of thought, can Maple gradually implement the inverse operations of some standard graph operations? Here are some examples: • CartesianProduct • TensorProduct • ConormalProduct • LexicographicProduct • ModularProduct • StrongProduct • LineGraph • GraphPower ## Why is map slower than ~?... Asked by: For a list containing at least one element, F~(list0); # element-wise is (almost) equivalent to map(F, list0); However, it seems that in practice, using ~ can be faster than its equivalent map version. Here is a typical test:  > restart;  > w := [$](0 .. 1e4): x := [$](0 .. 2e3): y := [$](0 .. 3e2): z := [\$](0 .. 4e1):
 >

# Compute a generalized outer product of  and  without using the inefficient ArrayTools:-GeneralOuterProduct.

 >

memory used=282.53MiB, alloc change=0.59GiB, cpu time=21.67s, real time=7.41s, gc time=17.33s

 >

memory used=230.48MiB, alloc change=-4.00MiB, cpu time=23.26s, real time=8.67s, gc time=17.71s

 > evalb(p2 = p4);

 >

Download ~_and_map.mw

But I cannot find any explanations in Comparison of element-wise operators and map function or Difference between 'map' and '~' (element-wise operation). Does anyone know why?

## Showing steps in solving a system of nonlinear equ...

I used ‘solve’ command in Maple to solve the following system of two variables with two nonlinear equations:

where

The denominators are nonzero and positive, and all parameters , , , ,  and  are positive real numbers. The solution was easily obtained, that is

Is there any way that I can follow the steps? The issue is that I need to verify whether there is not an alternate solution.

## problem translating string to latex. Using standar...

The standard way of writing quotes and double quotes in LaTeX is with  and ''

So a string should be translated to Latex using the_string' '  and not the_string"  which is what Maple does.

see for example this

For example, Maple translates  "regular" to

"\text{regular\"}"

It should be

"\text{regular' '}"

i.e. instead of closing it on the RIGHT with string quote  \"  it should close it with two upticks, like this ' '

Hard to see the differene here, so here is screen shot

s:="regular";
latex(s,output=string);
lprint(%)

The difference will show up depending on what font one is using. Here is an example below where when using different font, the effect is now visible.

\documentclass[12pt]{book}
\usepackage{amsmath}

\usepackage[T1]{fontenc}
\usepackage{mlmodern}

\begin{document}

\text{regular"}

\text{regular''}

\end{document}

The first one above is what Maple generates, the second one is what it should have been. Compiling with luatex gives this pdf, You can see clearly the difference now

It is important to note that this behavior shows depending on font used. For example, this code

\documentclass[12pt]{book}
\usepackage{amsmath}
\begin{document}

\text{regular"}

\text{regular''}

\end{document}


When compiled gives

So to be safe, it is better to always use the standard   ....' '   and not  .... \" because it then works the same for different fonts being used.

So, would it be possible to make Maple generate quoted string using the standard latex by closing it with ' ' instead of \"  ?

## how to make singular use same letter Z for integer...

the command singular can return results with _Z or _N as it says in help

The singular function may return expressions prefixed by _Z or _N, representing the integers and positive integers, respectively.

But it changes these letters by adding different number at the end for each call., Yet they all mean the same thing, which is an integer:

singular(1/sin(x),x)
{x = Pi*_Z1}

singular(x/sin(x),x)
{x = Pi*_Z2}

singular(x^2/sin(x),x)
{x = Pi*_Z3}


This makes it little hard when I try to make union of these results to only keep the unique singular points, since they are different symbols, yet they are really the same: integer times Pi.

Is there an option to tell Maple to use _Z for everything? And not keep adding new numbers each time it is called?

May be clear some internal memory table after each call?  Otherwise, I have to add more code to parse all these results and convert all _Znnn to just _Z  if it is there in each result, after each call is made.

Same issue for _N

Update

expr:=1/(sin(x)*cos(x)*tan(x));
s := singular(expr, x);

expr:=1/((x-1)*sin(x));
s := singular(expr, x);

expr:=1/(sin(x)*cos(x-Pi/3)*tan(x));
s := singular(expr, x);


In all the outputs above, I'd like to have same _Z show up. This will make it easier for postprocessing later on. Best solution will be to tell Maple itself not to change _Z if possible, otherwise one will need to add code to do this afterwords for all possible cases.

## Mapping Neutral Operator Over List...

Is there a way to map a neutral operator "&^" over a list L := [a,b,c,d], so that the output is a &^ b &^ c &^ d.

I can do this with a loop, but I'm wondering if there is already a built-in function for this.

## Why does LinearAlgebra:-Eigenvectors(A) give a rel...

Consider the task of finding the eigenvalues and eigenvectors of a simple 2x2 matrix.

Usually I can insert the contents of a Maple worksheet here, but for some reason the following worksheet cannot be inserted: Eigenvectors.mw

In that worksheet I try to use LinearAlgebra:-Eigenvectors(A). The eigenvalues contain a complex term, even though they are real for the given matrix. It's not clear what criteria are used in selecting a specific eigenvector for each eigenvalue.

I then show a more manual calculation.

I was expecting to obtain a simpler solution to this problem using LinearAlgebra:-Eigenvectors(A). Is this expectation unjustified? I am asking primarily from the perspective of a user of the software.

It would be interesting to know the answer from the perspective of someone who knows the ins and outs of the implementation of the software as well, but as a user my initial expectation is a more digestible result that doesn't rely on knowing such implementation details.

## guide on solving and graphing?...

hi,

What command can I use to solve the attached equation and draw its graph?

 (1)

## Why can't the commands in these document blocks be...

ODE for electrical circuit (right click on Documentblock, unselect show command does not work. Command still visble)

 (1)

ODE for motor (toggle Documentblock, unselect show command is only effective on equations  3 and 4)

 (2)

Isolate  and taking the derivative

 (3)

 (4)