nm

8552 Reputation

19 Badges

12 years, 350 days

MaplePrimes Activity


These are questions asked by nm

Are there rules of thumb to follow to decide to use evalindets vs. subsindets?  They seems to do the same thing, but I did not read every details of the help pages.  Is the difference similar to difference between using eval vs. subs? i.e.

          eval(expr,A=2)

vs.

         subs(A=2,expr) ?

For example

expr:=ln(A)+ln(B);
evalindets(expr,`&+`('specfunc(ln)','specfunc(ln)'),f->ln(op([1,1],f)*op([2,1],f)));
subsindets( expr, `&+`('specfunc(ln)','specfunc(ln)'), f->ln(op([1,1],f)*op([2,1],f)));

Both give

in my program, I keep assumptions in a set. Sometimes this is empty if no assumptions are used. This never caused a problem before (at least I do not think so, else I would have seen it) when using empty {} in assuming, except for now.

Here is one example below. Is this a known problem? I noticed when changing {} to [] the error goes away. I am not sure why, and if this is known issue. But will change from a set to a list to avoid this. 

Maple 2022.2 on windows 10

interface(version);

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

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1392 and is the same as the version installed in this computer, created 2023, February 13, 12:58 hours Pacific Time.`

restart;

ode:=diff(diff(y(x),x),x)+diff(y(x),x)^2+diff(y(x),x) = 0;
ic:=y(0) = 0;
sol:=y(x) = -ln(exp(x))+ln(-1+_C1*exp(x))-ln(-1+_C1);

diff(diff(y(x), x), x)+(diff(y(x), x))^2+diff(y(x), x) = 0

y(0) = 0

y(x) = -ln(exp(x))+ln(-1+_C1*exp(x))-ln(-1+_C1)

odetest(sol,[ode,ic]) assuming {};

Error, (in convert/multiset) too many levels of recursion

odetest(sol,[ode,ic]) assuming [];

[0, 0]

odetest(sol,[ode, ic]);

[0, 0]

 

Download feb_14_2023.mw

What is the logic behind this?

expr:=(c[2]+x)^3;
simplify(expr)

Which is what expected. But 

expr:=(c[2]+x)^3+a;
simplify(expr)

gives

Which does not look simpler to me. I expected it to be the same as before but with "a" added.  This is what Mathematica gives for comparison

I know I can use simplify with size option. But my question is, how did Maple decide that x^3 + 3*x^2*c[2] + 3*x*c[2]^2 + c[2]^3 + a is "simpler" than (c[2] + x)^3 + a ? It must use some logic which I am trying to understand.

Maple 2022.2 on windows 10

I've probably asked about this long time ago but I do not remember now. But it is still a problem any way in 2022.2

Compare these two results

code is

 

restart;

alias(seq(c[k] = _C||k, k = 0..10));
c[1]*h(x);
Int(c[1]*h(x),x);


restart;
c[1]*h(x);
Int(c[1]*h(x),x);

I tried with typesetting level as extended and standard and same result.

Is this a know issue? It is not a big deal as it only affects display but it will be nice to find why it happens when using alias.

 

after updating to latest Physics package, I find now latex geneated is invalid as it gives compile error.

I looked at old files I have and I see the latex generated before was correct. so something changed in the latex() command to cause this and now none of my files compile when I run my Maple program.

Before, same code used to generate this

 \left(-x^{2}+1\right) \left(y^{\prime}\right)^{2} = 1-y^{2} 

which compiled correctly.

Here is worksheet
 

interface(version)

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

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1378 and is the same as the version installed in this computer, created 2023, January 29, 12:4 hours Pacific Time.`

latex:-Settings(useimaginaryunit=i,
      usecolor = false,
      powersoftrigonometricfunctions= mixed, ## computernotation,
      leavespaceafterfunctionname = true,
      cacheresults = false,
      spaceaftersqrt = true,
      linelength=10000  
);
Typesetting:-Unsuppress('all'); #always do this.
Typesetting:-Settings(prime=x,'typesetprime'=true); #this says to use y'(x) instead of dy/dx    
Typesetting:-Suppress(y(x)); # this says to use y' and not y'(x)

[useimaginaryunit = i, usecolor = false, powersoftrigonometricfunctions = mixed, leavespaceafterfunctionname = true, cacheresults = false, spaceaftersqrt = true, linelength = 10000]

x, false

ode:=(-x^2+1)*diff(y(x),x)^2 = 1-y(x)^2;

(-x^2+1)*(diff(y(x), x))^2 = 1-y(x)^2

latex(ode)

\left(-x^{2}+1\right) y^{\prime}^{2} = 1-y^{2}

 

 

The error from the latex compiler is 

 

\documentclass[12pt]{book}
\usepackage{breqn}
\usepackage{amsmath}
\begin{document}

\begin{dmath*}
\left(-x^{2}+1\right) y^{\prime}^{2} = 1-y^{2}
\end{dmath*}

\end{document}

compiled using texlive lualatex command gives

(/usr/local/texlive/2022/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
! Double superscript.
<recently read> \mathsup 
         
l.12 \left(-x^{2}+1\right) y^{\prime}^{2}
                                        = 1-y^{2}
? 

The fix is to keep same latex as before or use an extra {} like this  {y^{\prime}}^{2} 

but I think \left(y^{\prime}\right)^{2} looks better. But y^{\prime}^{2} is definitly wrong latex.

Download latex_problem.mw

First 20 21 22 23 24 25 26 Last Page 22 of 164