nm

8552 Reputation

19 Badges

12 years, 349 days

MaplePrimes Activity


These are questions asked by nm

When translating Maple expression with special math functions, Maple does not use the same familar name shown in worksheet, but replaces these special functions with one letter. 

This makes it very hard when looking at the equations in latex and the pdf to know what these special functions are. 

Is there an option to keep the same name used in Maple but use the \operatorname{name} in the latex generated? This will go a long way to improve the output and make one understand what they are looking at.

Here are examples below. Notice as side note, that Maple does not translate pochhammer at all. Is this a bug? It only gave its arguments in the latex. 

I think everyone will agree that reading BesselJ in the equation is more clear than reading J and reading hypergeom is more clear than and reading  MeijerG is more clear than and so on as one does not have to guess what these letters mean when looking at the final output in pdf.  
 

1384004

restart;

1384004

expr:=BesselJ(1,x);
latex(expr)

BesselJ(1, x)

J_{1}\! \left(x \right)

expr:=hypergeom( [],[],z );
latex(expr)

hypergeom([], [], z)

{}_{0}^{}{\moversetsp{}{\mundersetsp{}{F_{0}^{}}}}\! \left(;;z \right)

expr:=pochhammer(3/10, n);
latex(expr)

pochhammer(3/10, n)

\left(\frac{3}{10}\right)_{n}

expr:=MeijerG([[1, 1, 1, 1], []],[[], [4, 3, 2, 2]],Pi);
latex(expr)

MeijerG([[1, 1, 1, 1], []], [[], [4, 3, 2, 2]], Pi)

G_{4,4}^{0,4}\! \left(\pi \bigg| {\mstack{1,1,1,1}{4,3,2,2}}\right)

 


It should not be hard to provide an option for latex() in Maple (say Keep_special_function_math_names:=true) and keep default as is now.

Then all what Maple needs to do is simply generate \operatorname{BesselJ} instead of and \operatorname{hypergeom} instead of and \operatorname{pochhammer} and so on for any special function that does not have any standard Latex known notation. Even if one can argue that somewhere somehow someone should know that F is hypergeom and one should know that J means BesselJ and so on for dozens of other single letters used, I think it is much more clear to the reader to see the full name of the function as it shows in Maple worksheet.

The rest of the arguments remain the same exactly as shown by Maple on the screen and no need to make any changes there. It is only the name of the function which is the problem.

This only applies for all the special math function names ofcourse.

Any chance of making such changes to Maple's latex()? I tried to make the changes by post-processing the latex as string using patterns and string replace, but this was breaking things as it is not possible to just simply change letter J to BesselJ for example, as the letter J can be anything else in the latex. I think the best solution is to do this at the source, when the latex is generated by Maple.

Version 2023 on windows.

Download latex_math_functions.mw

ps. removed the list to make the question shorter as requested.

 

Could someone help me understand why Maple's int hangs when using int on an integrand if evala is not first applied to the integrand?

When I mean hangs, I mean really hangs. I have timelimit and maple server.exe runs at high CPU for hrs. When adding evala(), it completes instantly and returns unevaluated integral (which is just fine as I did not expect this to be evaluated) but it does not hang which is the main point.

Is this considered normal behaviour or a bug?  Should then one always add evala() on the integrand before using int?  As I get many hangs on int (even when using timelimit). I am not familiar with evala command as I have never had to use it before, but by chance I tried it and noticed this.

V 2023 on windows 10. Worksheet attached.


 

186932

restart;

186932

expr:=-1/3*2^(2/3)/((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)*((-1/2*a^2*p-1/2*p^2*a+1/2*p*((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)*a-3)*(-p^2*(-((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a+p))^(2/3)+2^(2/3)*p*(-(a+3/2*p)*p*((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a^2*p+5/2*p^2*a+3/2*p^3+3))/(-((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a+p)/(-1/2*2^(2/3)*(-p^2*(-((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a+p))^(2/3)+p*(p*(-p^2*(-((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a+p))^(1/3)+2^(1/3)))/p^2:
try
    anti := timelimit(30,int(evala(expr),p));
catch:
    print("timed out OK");
end try:
print("done");

"done"

restart;

expr:=-1/3*2^(2/3)/((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)*((-1/2*a^2*p-1/2*p^2*a+1/2*p*((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)*a-3)*(-p^2*(-((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a+p))^(2/3)+2^(2/3)*p*(-(a+3/2*p)*p*((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a^2*p+5/2*p^2*a+3/2*p^3+3))/(-((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a+p)/(-1/2*2^(2/3)*(-p^2*(-((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a+p))^(2/3)+p*(p*(-p^2*(-((a^2*p+2*a*p^2+p^3+4)/p)^(1/2)+a+p))^(1/3)+2^(1/3)))/p^2:
try
    anti := timelimit(30,int(expr,p));
catch:
    print("timed out");
end try;
print("done");


The second case above just hangs. Make sure to save all your work. I found I have to terminate all of Maple sometimes as killing server.exe seems to make the frontend hangs and not respond, ending up losing work in other worksheets which I did not save.

Download int_hangs_june_2_2023.mw

In trying to find why my Maple program encouter long delays when using timelimit and hangs, I found from windows 10 task manager that it uses thread and the thread can hang on network IO. I have no idea why mserver.exe is doing network IO for in the middle of timelimit(). 

But I think this has something to do with the problems I am seeing (reference).

The first thing I noticed is the network panel has check for update ON. So I turned that off.

I do not know if this was causing the problem, where Maple in middle of computation was trying to check for an update over the network or not.

But my question here is this: Does mserver.exe uses threads under the cover? If so, is there an option to turn this off? I.e tell Maple server.exe not to use threads at all?

I was to see if this is the cause or not. I see on the help on kernel options it says

And when I do   kernelopts(multithreaded)  it says  true

But how to turn this off? When I type

kernelopts(multithreaded=false)
Error, kernelopts cannot set multithreaded value

Is it enough to tell it to use ONE thread only then? Like this

kernelopts(gcmaxthreads=1)
                            numcpus

kernelopts(gcmaxthreads)
1

If one is not able turn multhreading off, will setting gcmaxthreads=1 have same effect or is there a better way to do these things?

My code does not do any mutlithreading. So I do not need it.

Maple 2023 on windows 10

Is it possible to permanently turn off threading? I looked at options and see no such option.

 

 

 

Why this error with PDEtools:-Solve  but not with solve on same exact input?

235572

interface(version);

`Standard Worksheet Interface, Maple 2023.0, Windows 10, March 6 2023 Build ID 1689885`

restart;

235572

expr:=1/9*b^2*(cos(x)^4*hypergeom([3/2, 1/2*m+2],[5/2],-cot(x)^2)^2*m^2-6*sin(x)^2*cos(x)^2*hypergeom([1/2, 1/2*m+1],[3/2],-cot(x)^2)*hypergeom([3/2, 1/2*m+2],[5/2],-cot(x)^2)*m+4*cos(x)^4*hypergeom([3/2, 1/2*m+2],[5/2],-cot(x)^2)^2*m+9*sin(x)^4*hypergeom([1/2, 1/2*m+1],[3/2],-cot(x)^2)^2-12*sin(x)^2*cos(x)^2*hypergeom([1/2, 1/2*m+1],[3/2],-cot(x)^2)*hypergeom([3/2, 1/2*m+2],[5/2],-cot(x)^2)+4*cos(x)^4*hypergeom([3/2, 1/2*m+2],[5/2],-cot(x)^2)^2-9*sin(x)^(8+2*m))*csc(x)^8:

PDEtools:-Solve(expr =0,x):

Error, (in collect/recursive) invalid subscript selector

PDEtools:-Solve(expr =0,x):

Error, (in collect/recursive) invalid subscript selector

solve(expr =0,x):

Warning, solutions may have been lost

solve(expr =0,x,AllSolutions):

Warning, solutions may have been lost

 

Download problem_Solve_may_30_2023.mw

This looks like regression? as it works ok on Maple 2022

interface(version);

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

restart;

expr:=1/9*b^2*(cos(x)^4*hypergeom([3/2, 1/2*m+2],[5/2],-cot(x)^2)^2*m^2-6*sin(x)^2*cos(x)^2*hypergeom([1/2, 1/2*m+1],[3/2],-cot(x)^2)*hypergeom([3/2, 1/2*m+2],[5/2],-cot(x)^2)*m+4*cos(x)^4*hypergeom([3/2, 1/2*m+2],[5/2],-cot(x)^2)^2*m+9*sin(x)^4*hypergeom([1/2, 1/2*m+1],[3/2],-cot(x)^2)^2-12*sin(x)^2*cos(x)^2*hypergeom([1/2, 1/2*m+1],[3/2],-cot(x)^2)*hypergeom([3/2, 1/2*m+2],[5/2],-cot(x)^2)+4*cos(x)^4*hypergeom([3/2, 1/2*m+2],[5/2],-cot(x)^2)^2-9*sin(x)^(8+2*m))*csc(x)^8:

PDEtools:-Solve(expr =0,x):

solve(expr =0,x):

Warning, solutions may have been lost

 

Download problem_Solve_may_30_2023_maple_2022.mw

Is this something known or should be fixed? I check it is exists also in V 2022 for same input.

restart;

expr:=40/9*(43/32*2^(1/3)*(2*exp(16*c[2])*y^15-46/43*exp(11*c[2])*y^10+1/86*exp(6*c[2
])*y^5)*y*16^(2/3)*(exp(c[2])^7*y^7)^(2/3)-5/4*2^(2/3)*(2*exp(20*c[2])*y^20-169
/40*exp(15*c[2])*y^15+1/5*exp(10*c[2])*y^10)*16^(1/3)*(exp(c[2])^7*y^7)^(1/3)+(
2*exp(24*c[2])*y^20-53/2*exp(19*c[2])*y^15+17/4*exp(14*c[2])*y^10)*y^4)*exp(3*c
[2])/y^3/exp(5*c[2])/(1/9*(-1/4-exp(10*c[2])*y^10+8*exp(5*c[2])*y^5)*16^(2/3)*(
exp(c[2])^7*y^7)^(2/3)+(-2/3*(11/4*exp(9*c[2])*y^5-1/2*exp(4*c[2]))*2^(1/3)*y*
16^(1/3)*(exp(c[2])^7*y^7)^(1/3)+2^(2/3)*(2*exp(13*c[2])*y^10-2*exp(8*c[2])*y^5
))*y^3)/(-3/8*2^(2/3)*16^(2/3)*(exp(c[2])^7*y^7)^(2/3)*exp(c[2])*y+(exp(5*c[2])
*y^5-1/4)*16^(1/3)*(exp(c[2])^7*y^7)^(1/3)+3/2*2^(1/3)*exp(4*c[2])*y^4):


int(expr,y);

Error, (in convert/parfrac) cannot convert to partial fraction form

But for some reason I do not now understand, I am able to actually trap this error, which makes it much less serious for me, as the program can continue.

In all other cases where Maple generated such internal exceptions, it was not cought by try/catch.

So I am able to bypass this problem, but thought to check if someone can shed more light on this and why it happens.

interface(version)

`Standard Worksheet Interface, Maple 2023.0, Windows 10, March 6 2023 Build ID 1689885`

restart;

138508

interface(warnlevel=4);
kernelopts('assertlevel'=2):

3

expr:=40/9*(43/32*2^(1/3)*(2*exp(16*c[2])*y^15-46/43*exp(11*c[2])*y^10+1/86*exp(6*c[2
])*y^5)*y*16^(2/3)*(exp(c[2])^7*y^7)^(2/3)-5/4*2^(2/3)*(2*exp(20*c[2])*y^20-169
/40*exp(15*c[2])*y^15+1/5*exp(10*c[2])*y^10)*16^(1/3)*(exp(c[2])^7*y^7)^(1/3)+(
2*exp(24*c[2])*y^20-53/2*exp(19*c[2])*y^15+17/4*exp(14*c[2])*y^10)*y^4)*exp(3*c
[2])/y^3/exp(5*c[2])/(1/9*(-1/4-exp(10*c[2])*y^10+8*exp(5*c[2])*y^5)*16^(2/3)*(
exp(c[2])^7*y^7)^(2/3)+(-2/3*(11/4*exp(9*c[2])*y^5-1/2*exp(4*c[2]))*2^(1/3)*y*
16^(1/3)*(exp(c[2])^7*y^7)^(1/3)+2^(2/3)*(2*exp(13*c[2])*y^10-2*exp(8*c[2])*y^5
))*y^3)/(-3/8*2^(2/3)*16^(2/3)*(exp(c[2])^7*y^7)^(2/3)*exp(c[2])*y+(exp(5*c[2])
*y^5-1/4)*16^(1/3)*(exp(c[2])^7*y^7)^(1/3)+3/2*2^(1/3)*exp(4*c[2])*y^4);

(40/9)*((43/32)*2^(1/3)*(2*exp(16*c[2])*y^15-(46/43)*exp(11*c[2])*y^10+(1/86)*exp(6*c[2])*y^5)*y*16^(2/3)*((exp(c[2]))^7*y^7)^(2/3)-(5/4)*2^(2/3)*(2*exp(20*c[2])*y^20-(169/40)*exp(15*c[2])*y^15+(1/5)*exp(10*c[2])*y^10)*16^(1/3)*((exp(c[2]))^7*y^7)^(1/3)+(2*exp(24*c[2])*y^20-(53/2)*exp(19*c[2])*y^15+(17/4)*exp(14*c[2])*y^10)*y^4)*exp(3*c[2])/(y^3*exp(5*c[2])*((1/9)*(-1/4-exp(10*c[2])*y^10+8*exp(5*c[2])*y^5)*16^(2/3)*((exp(c[2]))^7*y^7)^(2/3)+(-(2/3)*((11/4)*exp(9*c[2])*y^5-(1/2)*exp(4*c[2]))*2^(1/3)*y*16^(1/3)*((exp(c[2]))^7*y^7)^(1/3)+2^(2/3)*(2*exp(13*c[2])*y^10-2*exp(8*c[2])*y^5))*y^3)*(-(3/8)*2^(2/3)*16^(2/3)*((exp(c[2]))^7*y^7)^(2/3)*exp(c[2])*y+(exp(5*c[2])*y^5-1/4)*16^(1/3)*((exp(c[2]))^7*y^7)^(1/3)+(3/2)*2^(1/3)*exp(4*c[2])*y^4))

try
   int(expr,y);
catch:
   print("error");
end try;

"error"

int(expr,y);

Error, (in convert/parfrac) cannot convert to partial fraction form

int(simplify(expr),y);

Error, (in convert/parfrac) cannot convert to partial fraction form

 

Download int_error_may_29_2023.mw

First 12 13 14 15 16 17 18 Last Page 14 of 164