nm

8552 Reputation

19 Badges

12 years, 353 days

MaplePrimes Activity


These are replies submitted by nm

@ecterrab 

thanks. I did not know about interface(imaginaryunit) command. This solves the issue. I will add this at start of my script now.

 

@ecterrab 

Hello,

There is still a problem in V 788. Latex still generates \textit{Physics}:-* in some places. Please see below. it seems to happen when expression in denominator.  If I find anything more, will update.
 

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 788 and is the same as the version installed in this computer, created 2020, September 1, 11:0 hours Pacific Time.`

Physics:-Latex(1/(a*y^2))

\frac{1}{\textit{Physics}:-*\left({a , y^{2}}\right)}

latex(1/(a*y^2))

{\frac {1}{a{y}^{2}}}

 


 

Download latex_issue_7.mw

@ecterrab 

Thank you!  

I will try 788 as soon my current script is finished. If there is any issue I will make new post. I will be able to test 788 later today.

my latex_issue_4.mw was posted in one of my replies to earlier post:

https://www.mapleprimes.com/questions/230429-New-Issue-Using-PhysicsLatex--Changes 

But it is OK now. I had to change my code as I show in the above, to workaround it, and now it works. 

thanks

@ecterrab 

Thanks. When I tried it, it generates `\textit{Physics}`. What are these?  Please see 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 786 and is the same as the version installed in this computer, created 2020, September 1, 1:8 hours Pacific Time.`

restart;        
expr:=1/2*int(exp(-t)*f(t),t)*exp(t)-1/2*exp(-t)*int(exp(t)*f(t),t)
 

(1/2)*(int(exp(-t)*f(t), t))*exp(t)-(1/2)*exp(-t)*(int(exp(t)*f(t), t))

Physics:-Latex:-UseColor := false:        
Physics:-Latex(expr)
 

\frac{\textit{Physics}:-*\left({\int \textit{Physics}:-*\left({{\rm e}^{-t}, f \left(t \right)}\right)d t , {\rm e}^{t}}\right)}{2}-\frac{\textit{Physics}:-*\left({{\rm e}^{-t}, \int \textit{Physics}:-*\left({{\rm e}^{t}, f \left(t \right)}\right)d t}\right)}{2}

 


Here is the result of compiling it

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

\begin{document}

\[
\frac{\textit{Physics}:-*\left({\int \textit{Physics}:-*\left({{\rm e}^{-t}, f \left(t \right)}\right)d t , {\rm e}^{t}}\right)}{2}-\frac{\textit{Physics}:-*\left({{\rm e}^{-t}, \int \textit{Physics}:-*\left({{\rm e}^{t}, f \left(t \right)}\right)d t}\right)}{2}
\]

\end{document}

I noticed this happens where is a multiplication in the expression

Physics:-Latex(exp(x)*f(x))

                    \textit{Physics}:-*\left({{\rm e}^{x}, f \left(x \right)}\right)

And

Physics:-Latex(a*b)

            \textit{Physics}:-*\left({a , b}\right)

This was not there in the earlier version of Physics. 

Download latex_issue_6.mw

@nguyenhuyenag 

I also tried “open with” but not work.

You need to right-click the mws file, then say open-with->Select another application->Select Maple 2020->Check the box that says always use this app to open mws

This should work. This is all standard windows operation and not related to Maple. Did you try the above?

You did not say what is the OS.

" installed Maple 2016, 2020 and set Maple 2016 as default opening files .mw, .mws."

Well, if you allready knew how to set the default to Maple 2016, why not use the same method to change it to Maple 2020? 

But on windows, one can also right-click the file, select open with-> and select the "always open using this application" option from the window that comes up.

But this is on windows. I do not know about other OS's.

@nm 

I found if I change the code from 

               sol:= solve(eq,MM) assuming TT>0;

to

              sol:= solve(eq,MM);
              sol:=simplify(sol) assuming TT>0; 

Then it works now even if calling Physics:-Latex beforehand. This is all using Physics 781.

So I changed my code to do the above. If I find new issues, will make separate question.
 

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 781 and is the same as the version installed in this computer, created 2020, August 30, 14:31 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)]);
return simplify(sol) assuming TT>0;
end proc:

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

"y = u x"

[3/4]

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 := [solve(eq,MM) assuming TT>0];
return sol;
end proc:

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

"y = u x"

[]

 


 

Download fixed.mw

 

 

@ecterrab 

Thanks for the update.

As I mentioned in original post, I thought the problem was due to latex setting changing automatically, that my program was now failing when using Physics:-Latex.

But I just installed 781 and solve still failed.

I can change my code from assuming TT>0 to use Physics if that is all is needed, but not sure now how since I did not use Physics:-Assume before. Will need to look into it. i.e how should I change the call to solve in the code below to make it return the same 3/4 solution, but still use Physics:-Latex?

Please see attached showing the test still fail in Physics 781

Thanks again for the help.


 

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 781 and is the same as the version installed in this computer, created 2020, August 30, 14:31 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(y=u*x,output=string);
foo(y,x);
 

"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(y=u*x,output=string);
foo(y,x);

[3/4]

 


 

Download latex_issue_4.mw

@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. 

First 30 31 32 33 34 35 36 Last Page 32 of 71