nm

11373 Reputation

20 Badges

13 years, 41 days

MaplePrimes Activity


These are questions asked by nm

I wanted to search for all files with some extention in directory tree. But when adding depth=infinity and also adding 'select'="*.log" (or whatever the extension I want is), then it returns an empty list even though there are files with this extension but deep in the tree.

If I remove select, then it does work, but it returns list of the files in the tree. Which I do not want. I want to filter these by select.

If I remove depth=infinity then select works but only finds such files at top level of the directory and does look down the tree where there are more such files.

It seems select and depth conflict with each others.  Adding 'all' option makes no difference.

I do not remember now if I reported this before or not.

Here is worksheet showing this problem

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

folder_name:="/home/me/maple2025"; #fails to find all such files
FileTools:-ListDirectory(folder_name,'select'="*.wav",depth=infinity);

"/home/me/maple2025"

[]

folder_name:="/home/me/maple2025"; #works but only top level
FileTools:-ListDirectory(folder_name,'select'="*.log");

"/home/me/maple2025"

["Maple_2025_Install_2025_04_03_12_34_10.log"]

folder_name:="/home/me/maple2025"; #works but this finds everything
FileTools:-ListDirectory(folder_name,depth=infinity);

"/home/me/maple2025"

`[Length of output exceeds limit of 10000]`

 


 

Download listdirectory_may_3_2025.mw

How can one get list of files with specific extension in the whole tree? And why is adding select makes it not work? Help does not say anything about select does not work when adding depth=infinity.

I suppose I can get list of all files in tree, then iterate over the list and remove all entries that do not end with the extension I wanted. But this is what select is supposed to do. For example

folder_name:="/home/me/maple2025/"; #works but this finds everything
L:=FileTools:-ListDirectory(folder_name,depth=infinity):
map(X->`if`(FileTools:-Extension(X)="wav",X,NULL),L);

Gives list of only files with extension "wav". So the above is workaround for now.

These are the same (i.e. mathematically equivalent for real x)

A:=-x*(x - 4*exp(x/2) + 2);
B:=x*sqrt((-8*x - 16)*exp(x/2) + x^2 + 4*x + 16*exp(x) + 4);

But can't see how to use Maple to show this, other than numerically and by plotting.

Any one knows of a trick? Below is worksheet. Using another software, it was able to show they are same:

Here are my attempts in Maple 2025
 

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

restart;

A:=-x*(x - 4*exp(x/2) + 2);
B:=x*sqrt((-8*x - 16)*exp(x/2) + x^2 + 4*x + 16*exp(x) + 4);

-x*(x-4*exp((1/2)*x)+2)

x*((-8*x-16)*exp((1/2)*x)+x^2+4*x+16*exp(x)+4)^(1/2)

plots:-display(Array([plot(A,x=-3..3),plot(B,x=-3..3)]))

 

 

Digits:=16;
seq(MmaTranslator:-Mma:-Chop(A-B),x=-2..2,.1)

16

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

simplify(A-B);

-x*(((-8*x-16)*exp((1/2)*x)+x^2+4*x+16*exp(x)+4)^(1/2)-4*exp((1/2)*x)+x+2)

simplify(A-B) assuming real;

-x*(((-8*x-16)*exp((1/2)*x)+x^2+4*x+16*exp(x)+4)^(1/2)-4*exp((1/2)*x)+x+2)

simplify(evala(A-B)) assuming real;

-x*(((-8*x-16)*exp((1/2)*x)+x^2+4*x+16*exp(x)+4)^(1/2)-4*exp((1/2)*x)+x+2)

simplify(normal(A-B)) assuming real;

-x*(((-8*x-16)*exp((1/2)*x)+x^2+4*x+16*exp(x)+4)^(1/2)-4*exp((1/2)*x)+x+2)

simplify(A-B,exp) assuming real;

-x*(((-8*x-16)*exp((1/2)*x)+x^2+4*x+16*exp(x)+4)^(1/2)-4*exp((1/2)*x)+x+2)

simplify(evalc(A-B)) assuming real;

-x*(((-8*x-16)*exp((1/2)*x)+x^2+4*x+16*exp(x)+4)^(1/2)-4*exp((1/2)*x)+x+2)

 

 

Download show_same_may_3_2025.mw

For compution this is not important, for latex, I find  n>0 little more clear to read than 0<n 

Is there a way to tell Maple not to reverse terms on each side of the > just for latex purposes?

It seems Maple does this only for   > and not for  <

I know the latex output follows what is displayed on the screen in Maple. And that is what happens also for display. Maple rewrites n>0 as   0<n.   

I tried changing display->Typesetting level from extended to maple standard but this had no effect. 

Is there a trick to make Maple not all the > to  <  ?

Again, I wanted to do this just for the latex output because for computation and for screen display in worksheet, it is not an the issue for me, as I only use Latex output.

It seems Maple like to make everything  based on "<" internally and that is why it reverses it?

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

restart;

latex(n>0,'output'='string'); #why this is reverse on output?

"0<n"

latex(n>m,'output'='string'); #why this is reverse on output?

"m <n"

latex(n<0,'output'='string'); #but this stays the same

"n <0"

latex(n<m,'output'='string'); #but this stays the same

"n <m"

n>0

0 < n

 

 

Download why_reverses_may_1_2025.mw

This happens in Maple 2025, but when I checked Maple 2024.2, same thing happen.

To reproduce, I typed ?coeff in the worksheet. Now the help page for coeff comes up OK. On the right, there are some links below "see also". 

Clicking on the one that says PolynomialTools[CoefficientVector] and now an EMPTY page opens up.

Also, typing ?PolynomialTools in worksheet, opens the help page for Overview of the PolynomialTools Package. Now clicking on CoefficientList link, opens an EMPTY page. Same when clicking on CoefficientVector, an EMPTY page !

Have not checked all the links in the help page, but why are some commands have empty help pages?

 

 

The series to ode using 'series' option (if it exists) should always be series(...), i.e. with big O at end. but sometimes Maple forgets to add this. Here is an example

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Linux, March 24 2025 Build ID 1909157`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1862 and is the same as the version installed in this computer, created 2025, April 25, 10:33 hours Pacific Time.`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 15 and is the same as the version installed in this computer, created April 27, 2025, 23:18 hours Eastern Time.`

restart;

ode:=diff(y(x),x)+y(x)=1+x;
IC:=y(0)=0;
sol:=dsolve([ode,IC],y(x),'series')

diff(y(x), x)+y(x) = 1+x

y(0) = 0

y(x) = x

lprint(sol); # notice solution is not series, it should be

y(x) = x

#above solution should be
y(x) = series(x+O(x^6),x,6)

y(x) = series(x+O(x^6),x,6)

#this example below is correct
ode:=diff(y(x),x)+y(x)=1+x;
IC:=y(0)=1;
sol:=dsolve([ode,IC],y(x),'series')

diff(y(x), x)+y(x) = 1+x

y(0) = 1

y(x) = series(1+(1/2)*x^2-(1/6)*x^3+(1/24)*x^4-(1/120)*x^5+O(x^6),x,6)

lprint(sol); #solution is series

y(x) = series(1+1/2*x^2-1/6*x^3+1/24*x^4-1/120*x^5+O(x^6),x,6)

 

 

Download bug_report_dsolve_series_april_28_2025.mw

3 4 5 6 7 8 9 Last Page 5 of 200