nm

11353 Reputation

20 Badges

13 years, 13 days

MaplePrimes Activity


These are replies submitted by nm

@ecterrab 

Thank you for the Physics update.

Btw, I was not complaining about the automatic change to y', I actually prefer this over diff(y(x),x) as it is easier to read. But I thought it might be the reason why my code fails when calling Physics:-Latex. As I said, I was not sure.

But I just installed latest Physics, but the problem still there (the problem being my test still fails when using Physics:-Latex, but the typsetting issue is corrected now).

So I spend more time trying to find why. I was able to make a MWE showing the problem.

Maple fails to solve an equation when calling Physics:-Latex BEFORE.  

When I do not call Physics:-Latex, then Maple is able to solve the same equation.  

Please see below

restart;
foo:=proc(y,x)
local eq,MM,TT,sol;

eq:=TT^(MM - 1)*y*(2*y^4 + x^3)/(2*x*(y^4 + x^3)) = y*(2*TT^(5*MM - 1)*y^4 + TT^(MM + 2)*x^3)/(2*x*(TT^(4*MM)*y^4 + x^3*TT^3));
sol :=timelimit(20,[solve(eq,MM) assuming TT>0]);
return sol;
end proc:

Physics:-Latex:-UseTypesettingCurrentSettings := true;
#Physics:-Latex(y=u*x,output=string);
foo(y,x);

Gives

      [3/4]

 

Now when I run the same code above, but uncomment the line Physics:-Latex, Maple returns

      []

So clearly calling Physics:-Latex(y=u*x,output=string); before is the cause, as that is the only difference.

Please see worksheet attached below.


 

interface(version);

`Standard Worksheet Interface, Maple 2020.1, Windows 10, July 30 2020 Build ID 1482634`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 780 and is the same as the version installed in this computer, created 2020, August 30, 13:8 hours Pacific Time.`

restart;

foo:=proc(y,x)
local eq,MM,TT,sol;

eq:=TT^(MM - 1)*y*(2*y^4 + x^3)/(2*x*(y^4 + x^3)) = y*(2*TT^(5*MM - 1)*y^4 + TT^(MM + 2)*x^3)/(2*x*(TT^(4*MM)*y^4 + x^3*TT^3));
sol :=timelimit(20,[solve(eq,MM) assuming TT>0]);
return sol;
end proc:

Physics:-Latex:-UseTypesettingCurrentSettings := true;
Physics:-Latex(y=u*x,output=string);
foo(y,x);
 

true

"y = u x"

[]

restart;

foo:=proc(y,x)
local eq,MM,TT,sol;

eq:=TT^(MM - 1)*y*(2*y^4 + x^3)/(2*x*(y^4 + x^3)) = y*(2*TT^(5*MM - 1)*y^4 + TT^(MM + 2)*x^3)/(2*x*(TT^(4*MM)*y^4 + x^3*TT^3));
sol :=timelimit(20,[solve(eq,MM) assuming TT>0]);
return sol;
end proc:

Physics:-Latex:-UseTypesettingCurrentSettings := true;
#Physics:-Latex(y=u*x,output=string);
foo(y,x);

true

[3/4]

 


 

Download latex_issue_3.mw

 

 

@ecterrab 

Ok. THanks. For now if someone get this error, it is possible to null it in Latex (or redefine it) as follows (added to the preamble)

\newcommand{\eslowbar}{}

   And now it compiles OK. This is temporary fix.

@ecterrab 

 

Thanks. Will look into  the styling. I got all the Maple packages put in the right place now.

But I think I found another issue. 

restart;
sol:=dsolve(y(x)*diff(y(x),x$2)=x);
Physics:-Latex(sol);

It generates Latex using \textit{\eslowbar}

 

And \eslowbar is not defined any where I could see. I googled it also. Here is the latex file I am using to compile the output

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

\underline{Solution by CAS} to compare with is
\[
y \left(x \right) = \left(\textit{\_a} \left({\rm e}^{\int \textit{\eslowbar}b\left(\textit{\_a} \right)d \textit{\_a} +\textit{\_C1}}\right)^{\frac{3}{2}}\right)\textbf{\textrm{where}}\left[{\left\{\frac{d}{d \textit{\_a}}\eslowbar \textrm{b}\left(\textit{\_a} \right)=\frac{\left(3 \textit{\_a}^{2}-4\right) \textit{\eslowbar}b\left(\textit{\_a} \right)^{3}}{4 \textit{\_a}}+2 \textit{\eslowbar}b\left(\textit{\_a} \right)^{2}\right\}, \left\{{\textit{\_a} =\frac{y \left(x \right)}{x^{\frac{3}{2}}}, \textit{\eslowbar}b\left(\textit{\_a} \right)=-\frac{2 x^{\frac{3}{2}}}{-2 x y^{\prime}\left(x \right)+3 y \left(x \right)}}\right\}, \left\{{x ={\rm e}^{\int \textit{\eslowbar}b\left(\textit{\_a} \right)d \textit{\_a} +\textit{\_C1}}, y \left(x \right)=\textit{\_a} \left({\rm e}^{\int \textit{\eslowbar}b\left(\textit{\_a} \right)d \textit{\_a} +\textit{\_C1}}\right)^{\frac{3}{2}}}\right\}}\right]
\]

\end{document}

The Latex error is

 

>lualatex foo3.tex
This is LuaHBTeX, Version 1.12.0 (TeX Live 2020)
.......
Package: maple2e 2005/03/17 v1.16
Defining Maple Utility Macros
(/home/me/texmf/tex/latex/mapleenv.def)
Defining Maple Plot Environemnts
 ...Defaults to "dvips" Driver
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/epsfig.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/graphics.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/trig.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/graphics.cfg) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-def/dvips.def))))
Defining Automatic Style Generation Macros
Defining Maple Spreadsheet Environments
Maple Spreadsheet and Table Support
) (/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def) (./foo3.aux) (/usr/local/texlive/2020/texmf-dist/tex/latex/base/ts1cmr.fd)
! Undefined control sequence.
<argument> \itshape \eslowbar

l.8 y \left(x \right) = \left(\textit{\_a} \left({\rm e}^{\int \textit{\eslowbar}
                                                                               b\left(\textit{\_a} \right)d \textit{\_a} +\textit{\_C1}}\right)^{\frac{3}{2}}\right)\textbf{\textrm{where}}\left[{\left\{\frac{d}{d \textit{\_a}}\eslowbar \textrm{b}\left(...
? x

 

I'll try to find where \eslowbar is supposed to be defined. This Latex macro is not generated when using normal latex() command.

Thanks for the help.

 

@ecterrab 

Thanks for the reply. I do not know what happened, but there is now new Physics 776. It did not install at first. I was running Maple 2020.1

I closed Maple, started it again, and Maple told me there is new version of Maple ready to update. After I updated Maple, now Physics version 776 installed OK and the error went away. (it still says Maple 2020.1 though, so I wonder why Maple asked me to update?)

But now the error went away. 
 

restart;

interface(version)

`Standard Worksheet Interface, Maple 2020.1, Windows 10, July 30 2020 Build ID 1482634`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 776 and is the same as the version installed in this computer, created 2020, August 28, 15:36 hours Pacific Time.`

restart;
sol:=dsolve(t*(t-2)^2*diff(diff(y(t),t),t)+t*diff(y(t),t)+y(t) = 0,y(t));
latex(sol);  #OK

y(t) = _C1*HeunC(1/2, 1, -1, -1/2, 3/2, -2/(t-2))+_C2*HeunC(1/2, 1, -1, -1/2, 3/2, -2/(t-2))*(Int(exp(1/(t-2))/HeunC(1/2, 1, -1, -1/2, 3/2, -2/(t-2))^2, t))

y \left( t \right) ={\it \_C1}\,{\it HeunC} \left( {\frac{1}{2}},1,-1,
-{\frac{1}{2}},{\frac{3}{2}},-2\, \left( t-2 \right) ^{-1} \right) +{
\it \_C2}\,{\it HeunC} \left( {\frac{1}{2}},1,-1,-{\frac{1}{2}},{\frac
{3}{2}},-2\, \left( t-2 \right) ^{-1} \right) \int \!{{{\rm e}^{
 \left( t-2 \right) ^{-1}}} \left( {\it HeunC} \left( {\frac{1}{2}},1,
-1,-{\frac{1}{2}},{\frac{3}{2}},-2\, \left( t-2 \right) ^{-1} \right)
 \right) ^{-2}}\,{\rm d}t

Physics:-Latex(sol);

y \left(t \right) =
\textit{\_C1} \textit{HC}\left({\frac{1}{2}, 1, -1, -\frac{1}{2}, \frac{3}{2}, -\frac{2}{t -2}}\right)+\textit{\_C2} \textit{HC}\left({\frac{1}{2}, 1, -1, -\frac{1}{2}, \frac{3}{2}, -\frac{2}{t -2}}\right) \left(\int \frac{{\rm e}^{\frac{1}{t -2}}}{\textit{HC}\left({\frac{1}{2}, 1, -1, -\frac{1}{2}, \frac{3}{2}, -\frac{2}{t -2}}\right)^{2}}d t \right)

 


I will now try to learn how to use the Maple package maplestd2e.sty as I never used it before, and see how to change the setting to use y' instead of dot.

Thanks

Download maple_new_latex.mw

 

 

@ecterrab 

Thank you very much for such good news! I just installed Latest Physics, and I see that now Maple does much better when using Physics:-Latex() vs. latex()

So I am changing my code to use Physics:-Latex() and will run a big test which will take few hrs to compile.  If I find any problems, I will post separate question on it.

But here are two quick tests showing the difference

sol := -3/(2*(x^3 + 3*z));
latex(sol);
           -3\, \left( 2\,{x}^{3}+6\,z \right) ^{-1}

Physics:-Latex(sol)
          -\frac{3}{2 \left(x^{3}+3 z \right)}

When compiled, here is the difference

Another example

restart;
latex(1/x);
                     {x}^{-1}

Physics:-Latex(1/x)

                   \frac{1}{x}

When compiled, here is the difference

Thanks for doing this and for those in Maple who worked on it.

Latex is very important. I use Maple to generate lots of Latex.

 

@acer 

thank. any hint how did you find the proc names to trace? That is always something I have hard time figuring out. Maple infolevel does not provide the names of the proc. 

@emendes 

From help it says

"Note: In some cases, the execution may not abort at exactly the time limit imposed, but will abort as soon as it can do so safely.  This can happen when execution is in critical sections of certain built-in routines."

This is what happened to me today: It hanged at iteration 2225. (the loop always hangs at some iteration).

I left home and came back later. It was still hanged. Waited more and suddenly after 2 hrs, it went to the next iteration on its own !

Even though the timeout is only 30 seconds on odetest.

Then I noticed it is taking very long time on the next one as well. So I did not want to wait another 2-3 hrs. I stopped maple and started it again and run the loop again from where it hanged and it finished the remaining 300 or so iterations in less than 15 minutes. 

When it starts, it is very fast. The hang happens always near the end of long run.  Seems like memory problems. mserver.exe was not doing anything at all when this happens. No changes in memory use and zero CPU.

When it hanged with you, try to leave it for few hrs and see if it go to next iteration on its own.

I tried changing timeout to 1 minute, 2 minute, etc.. it still hangs at somepoint. One rule of thumb I noticed is the the smaller the timeout, the less likely it will hang. But this is no guarantee.

Maplesoft clearly does not do stress testing on its software. They only do unit tests on individual functions and if each function works correctly, that is it.

But they should also test the whole system, using stress testing, by running long loops over and over and someone inside Maplesoft will see these problems. 

I've seen these hangs with timeouts for years now.  When I use Mathematica, it never once hanged on a timeout. I run longer jobs with Mathematica, it never failed not to timeout at the exact timeout limit set.  Why is it hard to do this with Maple, I do not know.  

 

 

@Carl Love 

>>>> Do you put the restart in its own execution group? 

Yes.

Ok. It hanged now. At same place. In the worksheet, which is hanged now, it says at the bottom:

        "before calling odetest with time limit"

Is the last print on the screen as of 20 minutes ago. At iteration 2225.  The timelimit is only 30 seconds. 

Looking at task manager, I see 2 mserver.exe there. with ZERO cpu and no memory change at all. Here is screen shot

 

I will leave it hanged like this for now, as I have to rush for an errand. When I come back later in the day, will see if I can find anything more. 

So mserver.exe is not doing anything at all. It clearly hanged inside the odetest with timeout not firing. 

 

@Carl Love 

I started the loop again now. it will take few hrs. when it hangs, (and almost sure it will, since it did each time before), I will record what mserver is doing then).  I will check on it in the morning.

 

@Carl Love 

Yes, I meant Maple gave no syntax error.  

But this is strange if it just ignores it. I thought the parser will have complained if  one uses invalid option. 

Maple should do better syntax checking in this case. 

@Carl Love 

>>>> I can't find any documentation on an assume option to odetest. Where did you see it?

I did not see it anywhere, I just tried it and it worked, so switched to it.

But I will try now to change it back to the syntax you just showed, since it allows me to use assuming with a list also, which is what I wanted. And assuming works, but for some reason, assume=[] does not like the list I have.

thanks.

@Carl Love 

>>>>    You say that when you press "interupt the current operation", it doesn't work.

But I said  

                   "interrupt the current operation". This does stop the hangs.

it works. i.e. the hangs stops. I read what  I wrote again, I do not see where I said it does not work.

After the hanged worksheet stop, I do restart and starts the loop again. It hangs again. That is what I meant.

Only when I restarted Maple itself, does the hang not return.

>>>>>> All that you need to do is kill the kernel from Windows Task Manager

Yes, I know I could do this. The problem is that there are a number of mserver.exe and I do not know which one. So easier just to restart Maple. I always save my worksheets before I run the main loop, since I know Maple will always hang at some point. 

 

 

 

If you want same order each time, you can sort them as given here

https://www.mapleprimes.com/questions/119852-Order-Of-Eigenvalues-In-LinearAlgebra

There must be a bug in your Maple version. Your proc is not defined to take in any arguments.

Please report this to Maplesoft support. This should not have worked. i.e. it should not have given the result you show. Here is what it gives on Maple 2020.1

restart;
norm3d:=proc() local a,b,c;sqrt(a^2+b^2+c^2) end;
norm3d(3,4,5);

This version works

restart;
norm3d:=proc(a,b,c) 
   return sqrt(a^2+b^2+c^2) 
end;
norm3d(3,4,5);

First 51 52 53 54 55 56 57 Last Page 53 of 91