Maple 2020 Questions and Posts

These are Posts and Questions associated with the product, Maple 2020

Dear all, 

I have a time-fractional PDE as follows.  ( denotes Caputo fractional derivative with respect to t) 

for alpha=1, this is a classical PDE and the exact solution is given as follows (in a book)

 

Question: 

 

1) for alpha=1, I want to find the L2 errors and L∞ errors in a table. 

2) for alpha=0.5, Can Maple find a solution (numeric or exact)?

 

MY TRY: (MAPLE 2020.2)

download the code.mw

restart:
with(plots):
PDE:=diff(y(x,t),t)=y(x,t)*diff(y(x,t),x$3)+y(x,t)*diff(y(x,t),x)+3*diff(y(x,t),x)*diff(y(x,t),x$2) ;


#c is an arbitratry constant
c:=4:
exact_sol:=(x,t)->-8*c/3*(cos ((x-c*t)/4))^2;

# I selected initial and boundary conditions as follows
IBC := { y(x,0)=exact_sol(x,0),y(0,t)=exact_sol(0,t),D[1](y)(0,t)=D[1](exact_sol)(0,t),y(1,t)=exact_sol(1,t)};
 	
numeric_sol := pdsolve(PDE,IBC,numeric);

num3d:=numeric_sol:-plot3d(t=0..1,x=0..1,axes=boxed,
            color=[0,0,y]);
exact3d:=plot3d(exact_sol(x,t),t=0..1,x=0..1,axes=boxed);
display(exact3d,num3d);

pdetest(y(x,t)=exact_sol(x,t),PDE,IBC);


I am using solution given in How-To-Make-Sort-Work-With-Alias which works well.

But on more testing, I found that Latex drops the constant of integration after applying the above solution, when this constant shows at the front of the rhs of the expression.

I have no idea why this happens. I will post two examples. The first shows the problem with the Latex generated, showing the constant is missing from the Latex. The second example is where I moved the constant  to inside the expression keeping everything else the same, and now the Latex generated no longer drops it. 

This is serious problem, since now my solutions are losing constant of integration in Latex display depending on where it is located.

example 1

restart;
assign(seq(`print/_C`||k, k=0..10) = seq(c[k], k=0..10)):
S:=[seq(_C||k = _C||k(), k=0..10)]:

sol:= y(x) = _C1/cosh(x)+(cosh(x)^2+cosh(x)*sinh(x)+x)/cosh(x);
sol:=subs(S, sort(sol));

Now watch what happens to the Latex of the above

Latex(sol)

y \! \left(x \right) = 
\frac{1}{\cosh \! \left(x \right)}+\frac{\cosh^{2}x +\cosh \! \left(x \right) \sinh \! \left(x \right)+x}{\cosh \! \left(x \right)}

Which compiles to 

\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}
\[
y \! \left(x \right) = \frac{1}{\cosh \! \left(x \right)}+\frac{\cosh^{2}x +\cosh \! \left(x \right) \sinh \! \left(x \right)+x}{\cosh \! \left(x \right)}
\]
\end{document}

Now will do the same, but move the constant to the second term. Now it shows up

example 2

restart;
assign(seq(`print/_C`||k, k=0..10) = seq(c[k], k=0..10)):
S:=[seq(_C||k = _C||k(), k=0..10)]:

sol:= y(x) = 1/cosh(x)+ _C1*(cosh(x)^2+cosh(x)*sinh(x)+x)/cosh(x);
sol:=subs(S, sort(sol));

Now generate the latex

Latex(sol)

y \! \left(x \right) = 
\frac{\left(\cosh^{2}x +\cosh \! \left(x \right) \sinh \! \left(x \right)+x \right) c_{1}}{\cosh \! \left(x \right)}+\frac{1}{\cosh \! \left(x \right)}

Which compiles to 

\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}
\[
y \! \left(x \right) = 
\frac{\left(\cosh^{2}x +\cosh \! \left(x \right) \sinh \! \left(x \right)+x \right) c_{1}}{\cosh \! \left(x \right)}+\frac{1}{\cosh \! \left(x \right)}
\] 
\end{document}

I am using 2020.2 with Physics 893 on windows 10.

Any idea what is going on? And why this happens when constant is at front only?

ps. the Purpose of using the solution in the above link, is to be able to use c[1] instead of _C1 in the final latex, and also have these constants show at front (this is what sort does) which makes the final expression better looking).

Thank you

Edit

In the debugger, going over Latex() function, I found where the problem happen.  There is a call near line 20 which does this

              Latex:-Print(e,':-executeprintroutines');

Where is the input. Which in this case is the sol expression passed to the Latex command.

Removing ':-executeprintroutines' from the above call, the constant remain there and is not lost.

It seems assign(seq(`print/_C`||k, k=0..10) = seq(c[k], k=0..10)): used before the call to Latex is confusing things.

Here is illustration:

restart;
assign(seq(`print/_C`||k, k=0..10) = seq(c[k], k=0..10)):
S:=[seq(_C||k = _C||k(), k=0..10)]:
sol:= y(x) = _C1/cosh(x)+(cosh(x)^2+cosh(x)*sinh(x)+x)/cosh(x);
sol:=subs(S, sort(sol));


Latex:-Print(sol,':-executeprintroutines');
Latex:-Print(sol);

And the output of the last 2 commands is

This shows when using ':-executeprintroutines' the constant is lost. I do not know what ':-executeprintroutines' does or where it is defined to try to modify it.

There is a problem here somewhere. Maple hangs on this ODE. Looking at trace, it hangs in trying homogeneous G

is this a known defect and could be resolved?

restart;
infolevel[dsolve]:=4;
dsolve(x^3*diff(y(x),x)^2+x*diff(y(x),x)-y(x) = 0,y(x))

... hangs

Adding different timelimits, it looks like the function gcd/LinZip is the culprit. Since it always seems to be there each time the timelimit expires (if it expires, sometimes it hangs even with timelimit).  But I noticed the above function many times in timelimit. So it seems the above functions is what causes many of the hangs I see.

Using `Lie` method, dsolved finishes almost instantly.

restart;
dsolve(x^3*diff(y(x),x)^2+x*diff(y(x),x)-y(x) = 0,y(x),'Lie')

This is on Maple 2020.2

It would be useful to know the cause of the hang, as fixing it could solve other problems.

I also notice that on Maple 2019.2 the first example above finished very fast also. So this is an issue that was introduced in Maple 2020.

All on windows 10.

I am having hard time controlling my Latex:-Settings now. The issue is that I do not know what each setting accepts as values, and what each value does.  The way I've been doing it is by collecting what useful ones posted in this forum, and what it does and save it in my cheat sheet. 

But now I see I need to change something, but not sure to what.

Is there a way to find what all the settings are, and description  of what each does and accepts as values? For example, 

            powersoftrigonometricfunctions

Accepts mixed and computernotation  But where are these described in terms of what they do? does it accept anything else?  Notice that ?leavespaceafterfunctionname does not show anything.

If I do 

restart;
Latex:-Settings()

it gives

[cacheresults = true, invisibletimes = " ", leavespaceafterfunctionname = false, 
powersoftrigonometricfunctions = mixed, spaceaftersqrt = true, usecolor = true, 
useimaginaryunit = I, useinputlineprompt = true, userestrictedtypesetting = false, 
usespecialfunctionrules = true, usetypesettingcurrentsettings = false]

But do not know how to obtain full description and possible value of each to see what they mean and do.

I think having Latex:-Settings() is a great idea, as it allows maximum flexibility for user to configure how they want the Latex output to be, but as more options are added, this type of information become more important to know and to keep track of.

I am using 2020.2 and Physics version 893

 

Maple seems to have difficulty computing this sum, which occurs in molecular physics of the H atom.

fd := j -> 2^8*j^5*(j-1)^(2*j-4)/(3*(j+1)^(2*j+4));

sum(fd(n)*ln(1-1/n^2), n=2..infinity);

Can anybody discover a solution, please?

I was trying to find if the type of module wide variable is considered local or global.

I have an exported variable in module. Maple then said it was local . OK

restart;
foo:=module()
   export n::integer;
   export boo:=proc()::integer;
     return n;
   end proc;       
end module;
                   

n:=foo:-boo():
type(n,`local`);

               # true

But when I did this

restart;
foo:=module()
   export n::integer;
end module;

n:=foo:-n;
type(n,`local`)

         #false

Now Maple says it no longer local.

What is the difference? The module wide variable is exported in both cases. So one can access it directly like in the second example above, or via call to a proc inside the module, which returns it.

Why in one case it is local and in the second case it is not?

Ok, I found the issue. It seems when doing return  n; in the first example above, it created and returned a local n to the proc itself (where n was not declared in the example). (even though maplemint did not complain. Strange).

I have assumed when doing return n Maple will know this is the module wide variable n since that is the closest one around.  i.e. the proc is inside the module. And sits inside the module. So return n should referenced this variable. But it did not, because when I changed the code to this

restart;
foo:=module()
   export n::integer;
   export boo:=proc()::integer;
     return foo:-n;
   end proc;       
end module;

n:=foo:-boo():
type(n,`local`);

     #false

Now it returned false. The same as the second example.

But it also returned false when asking if it is global

n:=foo:-boo():
type(n,`global`);

    #false

So the module wide variable in this example is not local and is not global.

Is there another type to use to check if the variable/symbol returned is a module wide type?

Maple 2020.2

I assume the goal is to have the Latex output close to the screen output in Maple. In these examples this is the case.

Example 1

restart;
A:=Matrix([[1,-1,0,2],[1,2,2,-2],[0,2,3,-1]]):
LinearAlgebra:-NullSpace(A)

But the Latex generated for the above, using the Latex() command is

\{ \left[\begin{array}{c}0 \\2 \\-1 \\1 \end{array}\right] \} 

Which when compiled

\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}
\[
\{ \left[\begin{array}{c}0 \\2 \\-1 \\1 \end{array}\right] \} 
\]
\end{document}

gives

The latex should instead be 

\left\{ \left[\begin{array}{c}0 \\2 \\-1 \\1 \end{array}\right] \right\} 

Which compiles to

Example 2

restart;
A:=Matrix([[1,-1,0,2],[1,2,2,-2],[0,2,3,-1]]):
LinearAlgebra:-RowSpace(A)

The Latex of the above is 

[\left[\begin{array}{cccc}1 & 0 & 0 & 0 \end{array}\right], 
\left[\begin{array}{cccc}0 & 1 & 0 & -2 \end{array}\right], 
\left[\begin{array}{cccc}0 & 0 & 1 & 1 \end{array}\right]]

Which when compiled gives

\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}
\[
[\left[\begin{array}{cccc}1 & 0 & 0 & 0 \end{array}\right], 
\left[\begin{array}{cccc}0 & 1 & 0 & -2 \end{array}\right], 
\left[\begin{array}{cccc}0 & 0 & 1 & 1 \end{array}\right]]
\]  
\end{document}

gives

A better Latex would be

\left[\left[\begin{array}{cccc}1 & 0 & 0 & 0 \end{array}\right], 
\left[\begin{array}{cccc}0 & 1 & 0 & -2 \end{array}\right], 
\left[\begin{array}{cccc}0 & 0 & 1 & 1 \end{array}\right]\right]

Which compiles to

Now the size of the [[ is the same on both ends.

example 3

restart;
A:=Matrix([[1,-1,0,2],[1,2,2,-2],[0,2,3,-1]]):
LinearAlgebra:-ColumnSpace(A)

The Latex given for the above is

[\left[\begin{array}{c}1 \\0 \\0 \end{array}\right], 
\left[\begin{array}{c}0 \\1 \\0 \end{array}\right], 
\left[\begin{array}{c}0 \\0 \\1 \end{array}\right]]

Which when compiled

\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}
\[
[\left[\begin{array}{c}1 \\0 \\0 \end{array}\right], 
\left[\begin{array}{c}0 \\1 \\0 \end{array}\right], 
\left[\begin{array}{c}0 \\0 \\1 \end{array}\right]]
\]  
\end{document}

gives

A better Latex is

\left[\left[\begin{array}{c}1 \\0 \\0 \end{array}\right], 
\left[\begin{array}{c}0 \\1 \\0 \end{array}\right], 
\left[\begin{array}{c}0 \\0 \\1 \end{array}\right]\right]

Which compiles to 

Maple 2020.2 with Physics  891 

Here is the problem. I am trying to use sort() to make solution to ode show up with constant of integrations _C1 at the front of the term, instead of how Maple shows it, which is after the term, which does not look good.

As recommened in  Why-Maple-Refuses-To-Change-Location

sort() works well. Except for this: I am also using alias for the constant of integrations, to get nicer Latex output, as recommended in earlier post (which I can't find now). 

But once I use alias, now sort no longer produce the result I want. Here is an example

restart;
sol:=dsolve(diff(y(x),x) = x+y(x),y(x));
sort(sol)

Here sort works. It moved the term with constant of integration to the front, and _C1 at front, which is what I want as it looks more clear.

But when I do 

restart;
alias(seq(c[k]=_C||k,k=0..10)):
sol:=dsolve(diff(y(x),x) = x+y(x),y(x));
sort(sol)

This is because, I am assuming, the order of _C1 is higher than c[1] and sort is using the alias of _C1 to sort on and not _C1 itself.

The only reason I am using alias, is to get nicer Latex output when converting the solution to Latex vs. when using _C1

Is there a way to tell sort to treat c[1] as _C1, and c[2] as _C2, etc...  in terms of lexicographical ordering?

I see an order option for the command sort() in help, but so far did not know how to use it for the above purpose. This only affects _C1,_C2,_C3,_C4,.. and nothing else and I only use sort() on the output of the solution of ode. May be I need to write an order function and in there tell it c[1] has same order as _C1? But _C1 has c[1] as alias? so I do not think this will not work.

Basically I want to use the alias, but also use sort() on the result as if these constants of integrations where _C1,_C2, etc..

in my code, I set the alias at the global level, before I call any function in my package.

Any ideas how to do this or workaround this?

Maple 2020.2 on windows

 

Consider the second order BVP:

diff(u(x), x, x) = u(x), u(0) = 2, u(1) = 1

I want dsolve numeric to calculate the second derivative, diff(u(x), x, x)

The actual problem I am working on is a more complex BVP that cannot be solved symbolically, but this simpler BVP will illustrate the problem.

Several Mapleprimes posts say to add a second equation diff(u(x), x, x) = v(x) and solve the system for u(x), v(x). This works for IVP's. However, when I implement it as shown below for the BVP:

dsolve({diff(u(x), x, x) = u(x), diff(u(x), x, x) = v(x), u(0) = 2, u(1) = 1, v(1) = 1}, {u(x), v(x)})

dsolve solves the problem fine symbolically, but when I try to solve the problem numerically:

dsolve({diff(u(x), x, x) = u(x), diff(u(x), x, x) = v(x), u(0) = 2, u(1) = 1, v(1) = 1}, numeric)

I get the following error message:

Error, (in dsolve/numeric/bvp/convertsys) the ODE system does not contain derivatives of the unknown function v

The above dsolve numeric command is a simplifcation -- e.g. I use an approximate solution etc. -- dsolve numeric solves the original BVP just fine, but will NOT calculate the second derivative.

I have tried any number of variations. I can convert the original problem to a system of first order equations -- but then, of course, dsolve calculates no first derivatives -- so I don't have diff (u(x),x) = diff (u(x),x,x)! 

I've killed a whole day on this. I need to estimate the location of the inflection point in my real problem (the solution is a sigmoidal function). I can apply a finite difference approximation to the dsolve numeric solution, but it's not accurate enough. Dsolve should be more accurate, since dsolve will  regulate the error of the added variable, v(x), to within abserr.

Oh, you would make everyone's life so much easier if you would just have dsolve numeric return all the derivatives in the IVP/BVP being solved! Or provide a data struction as solution that can be integrated/differentiated.

Robert


 

 

 

I have a large Maple 2020 worksheet which contains images and text.  I have been asked to publish a paper on the worksheet, in which I need to include LaTeX format. I have attempted to make the Maple => LaTeX conversion, but have the resulting file is very cluttered and takes much time to clean.  Can anyone offer advice on the best way to get clean LaTeX document from a worksheet?

Melvin Brown

sympl55@gmail.com

 

This puzzling to me. First will show the code, then explain the problem

restart;
ode:=diff(diff(y(x),x),x)+8*diff(y(x),x)+25*y(x) = 1;
sol:=dsolve(ode);
sol:= y(x)= _C2*exp(-4*x)*sin(3*x)+ _C1*exp(-4*x)*cos(3*x) + 1/25;
sol:= y(x)= _C2*exp(-4*x)*sin(3*x)+ _C1*exp(-4*x)*cos(3*x) + 1/25;
sol:= y(x)= _C2*exp(-4*x)*sin(3*x)+ _C1*exp(-4*x)*cos(3*x) + 1/25;

restart;

sol:= y(x)= _C2*exp(-4*x)*sin(3*x)+ _C1*exp(-4*x)*cos(3*x) + 1/25;

I was trying to changing the constant of integrations, to make them show at front, where it is better. But Maple refused to do so. Here is the output:


 

interface(version)

`Standard Worksheet Interface, Maple 2020.2, Windows 10, November 11 2020 Build ID 1502365`

restart;
ode:=diff(diff(y(x),x),x)+8*diff(y(x),x)+25*y(x) = 1;
sol:=dsolve(ode);
sol:= y(x)= _C2*exp(-4*x)*sin(3*x)+ _C1*exp(-4*x)*cos(3*x) + 1/25;
sol:= y(x)= _C2*exp(-4*x)*sin(3*x)+ _C1*exp(-4*x)*cos(3*x) + 1/25;
sol:= y(x)= _C2*exp(-4*x)*sin(3*x)+ _C1*exp(-4*x)*cos(3*x) + 1/25;

diff(diff(y(x), x), x)+8*(diff(y(x), x))+25*y(x) = 1

y(x) = exp(-4*x)*sin(3*x)*_C2+exp(-4*x)*cos(3*x)*_C1+1/25

y(x) = exp(-4*x)*sin(3*x)*_C2+exp(-4*x)*cos(3*x)*_C1+1/25

y(x) = exp(-4*x)*sin(3*x)*_C2+exp(-4*x)*cos(3*x)*_C1+1/25

y(x) = exp(-4*x)*sin(3*x)*_C2+exp(-4*x)*cos(3*x)*_C1+1/25

restart;

sol:= y(x)= _C2*exp(-4*x)*sin(3*x)+ _C1*exp(-4*x)*cos(3*x) + 1/25;

y(x) = _C2*exp(-4*x)*sin(3*x)+_C1*exp(-4*x)*cos(3*x)+1/25

 


Why restart is needed to make Maple keep the output same as input? is it possible to rewrite it without having to do restart?

Download why_restart_needed.mw

 

Has anybody tried Maple 2020.2 on a new Macbook with Apple silicon? I believe native support is in development, i was curious if anyone had experience running Maple via Rosetta 2?

Hello everyone,

I have a problem when searching in a document. Namelly is there a way to search in the whole worksheet including all code editing regions?

In order to show a point, there is a worksheet. I determine a variable

x11:= 12;

This variable is used in the document and code edit regions. Then I want to change a variable name from x11 to x11data. In order to do that, I use Ctrl+F to find all the times when the variable is used. I have a problem while  searching 'x11'. Namelly, the cases outside a code edit region are displayed, and the ones that are situated in the code edit regions are not seen.

Best regards

Hello 

I need a procedure that given two lists of sets A and returns a list of lists such that L[i] is the list of j such that A[i] subset B[j]. Here is an example:

ans6 := [{alpha[1, 8], alpha[2, 2], alpha[2, 5], alpha[2, 8], alpha[3, 6], alpha[3, 9]}, {alpha[1, 8], alpha[2, 2], alpha[2, 5], alpha[2, 8], alpha[3, 3], alpha[3, 6]}, {alpha[1, 8], alpha[2, 2], alpha[2, 5], alpha[2, 7], alpha[3, 6], alpha[3, 8]}, {alpha[1, 8], alpha[2, 2], alpha[2, 5], alpha[2, 7], alpha[3, 3], alpha[3, 8]}, {alpha[1, 8], alpha[2, 2], alpha[2, 5], alpha[2, 7], alpha[3, 3], alpha[3, 6]}, {alpha[1, 8], alpha[2, 2], alpha[2, 4], alpha[2, 5], alpha[3, 3], alpha[3, 6]}, {alpha[1, 8], alpha[2, 1], alpha[2, 2], alpha[2, 5], alpha[3, 3], alpha[3, 6]}, {alpha[1, 8], alpha[2, 0], alpha[2, 2], alpha[2, 5], alpha[3, 3], alpha[3, 6]}, {alpha[1, 5], alpha[2, 8], alpha[3, 6], alpha[3, 7], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 5], alpha[3, 7], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 5], alpha[3, 6], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 5], alpha[3, 6], alpha[3, 7], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 5], alpha[3, 6], alpha[3, 7], alpha[3, 8]}, {alpha[1, 5], alpha[2, 8], alpha[3, 4], alpha[3, 7], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 4], alpha[3, 6], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 4], alpha[3, 6], alpha[3, 7], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 4], alpha[3, 6], alpha[3, 7], alpha[3, 8]}, {alpha[1, 5], alpha[2, 8], alpha[3, 4], alpha[3, 5], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 4], alpha[3, 5], alpha[3, 7], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 4], alpha[3, 5], alpha[3, 7], alpha[3, 8]}]:

ans7 := [{alpha[1, 8], alpha[2, 2], alpha[2, 5], alpha[2, 7], alpha[3, 3], alpha[3, 6], alpha[3, 8]}, {alpha[1, 5], alpha[2, 8], alpha[3, 5], alpha[3, 6], alpha[3, 7], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 4], alpha[3, 6], alpha[3, 7], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 4], alpha[3, 5], alpha[3, 7], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 4], alpha[3, 5], alpha[3, 6], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 4], alpha[3, 5], alpha[3, 6], alpha[3, 7], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 4], alpha[3, 5], alpha[3, 6], alpha[3, 7], alpha[3, 8]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 6], alpha[3, 7], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 5], alpha[3, 7], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 5], alpha[3, 6], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 5], alpha[3, 6], alpha[3, 7], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 5], alpha[3, 6], alpha[3, 7], alpha[3, 8]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 4], alpha[3, 7], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 4], alpha[3, 6], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 4], alpha[3, 6], alpha[3, 7], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 4], alpha[3, 6], alpha[3, 7], alpha[3, 8]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 4], alpha[3, 5], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 4], alpha[3, 5], alpha[3, 7], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 4], alpha[3, 5], alpha[3, 7], alpha[3, 8]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 4], alpha[3, 5], alpha[3, 6], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 4], alpha[3, 5], alpha[3, 6], alpha[3, 8]}, {alpha[1, 5], alpha[2, 8], alpha[3, 3], alpha[3, 4], alpha[3, 5], alpha[3, 6], alpha[3, 7]}, {alpha[1, 5], alpha[2, 8], alpha[3, 2], alpha[3, 6], alpha[3, 7], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 2], alpha[3, 5], alpha[3, 7], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 2], alpha[3, 5], alpha[3, 6], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 2], alpha[3, 5], alpha[3, 6], alpha[3, 7], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 2], alpha[3, 5], alpha[3, 6], alpha[3, 7], alpha[3, 8]}, {alpha[1, 5], alpha[2, 8], alpha[3, 2], alpha[3, 4], alpha[3, 7], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 2], alpha[3, 4], alpha[3, 6], alpha[3, 8], alpha[3, 9]}, {alpha[1, 5], alpha[2, 8], alpha[3, 2], alpha[3, 4], alpha[3, 6], alpha[3, 7], alpha[3, 9]}]:

and my procedure

SubsetPairs:= (A::list(set), B::list(set))->
    map(z-> [ListTools:-SearchAll](true, map(w-> z subset w, B)), A)
:
SubsetPairs(ans6, ans7);

The result of applying SubsetPairs is:

[[], [], [1], [1], [1], [], [], [], [2, 3, 8, 23], [2, 4, 9, 24], [2, 5, 10, 25], [2, 6, 11, 26], [2, 7, 12, 27], [3, 4, 13, 28], [3, 5, 14, 29], [3, 6, 15, 30], [3, 7, 16], [4, 5, 17], [4, 6, 18], [4, 7, 19]]

When it is used for long lists, it takes a long time to return the results.  I wonder if a more time- and memory-efficient code can be implemented (perhaps Threads or Grid can be used).

In addition to that, how can a diagram (figure, plot, ...) be drawn to show which subset of the first list is linked to which subsets of the second list (including no link as well).  The length of the first list is always smaller than the length of the second list.  

Many thanks

 

I noticed that something changed with the output of translating abs() to latex. I am not sure when this happened.

Current version use \mid ...\mid  instead of the original \left| .... \right|

The problem with \mid is that the spacing no longer symmetric. It generate too much space on one side of | compared to the other side, and makes the output not pretty any more.

Is it possible to revert this back to the original way it was done? Please see example

restart;
Latex(ln(abs(1+x))=x)

                     \ln \! \left({\mid 1+x \mid}\right) = x

latex(ln(abs(1+x))=x)

                   \ln  \left(  \left| 1+x \right|  \right) =x

The second example gives better looking Latex where the space is symmetric. Here is the output

\documentclass{book}
\usepackage{amsmath}
\begin{document}          
\[
\ln \! \left({\mid 1+x \mid}\right) = x
\]

\[
\ln \! \left(  \left| 1+x \right|  \right) =x
\]
\end{document}

The second output is much better since \left|...\right| automatically sets the spacing the same between them and the math on each side.  (same if \lvert and \rvert were used)

I just noticed this first time looking at current output. I do not think this is how it used to be, else I would probably seen it before.

I am using Maple 2020.2 and Physics 890 (latest).

If not possible to change back to \left| ... right| . may be a new configuration parameter could be added to alow a user to choose which one?

Window 10.

 

First 24 25 26 27 28 29 30 Last Page 26 of 55