nm

7580 Reputation

19 Badges

10 years, 253 days

MaplePrimes Activity


These are replies submitted by nm

@Rouben Rostamian  

That is correct, the code does chop and not round, it comes from tihis line 

L[2]:=L[2][1..k];

It is easy to add code to make it do rounding instead. Will leave that to the OP as an exercise if they want to use it, but I suspect they will use your version as it is shorter and does rounding already.

 

 

have a look at  GraphTheory:-ShortestPath

@Ronan 

 This is a Maple specific problem

This is what I also think, since it is only the Maple application that this happens to. And only in Maple 2023. I have not seen this in Maple 2022.2. 

@alexsid 

I'll try to upgrade nvidia driver and see if this fixes this. I have to find how to do that. My windows 10 is all up-to-date.

But the question is, why is it only Maple that have its window content disappear like this?

I have many other windows apps open and none of them have this issue. But none of those other apps use Java for the front end (which is a good thing they do not. Java is horrible for GUI).

I do not know if it is related to Java or not, but that is the main difference I see now.

confirmed on windows 10, V 2023

@sand15 

nice touch with the change to 

`#mo("ℤ")`

This makes it look nice in Latex.

@Preben Alsholm 

thanks. This works better. But it overlooked some case Where it keeps _Z as is and not change it to Z like the others. Your code is supposed to change all "_Znnnn~" to "Z" right? not to "_Z" ? Here is an example where "_Z" remained as "_Z"

restart;
S4:=singular(1/(cos(x)*sin(x)*Psi(1/x)),x);
#S4:=singular(1/(cos(x))+Psi(1/x),x); 
#S4:=singular(1/cos(x),x); 
idts:=indets([S4],`local`);
S:=convert~(idts,string);
idts;

resZ,resNoZ:=selectremove(s->evalb(s[2]="Z"),S);
resN,resNoN:=selectremove(s->evalb(s[2]="N"),resNoZ);
resNN,resNoNN:=selectremove(s->evalb(s[2..3]="NN"),resN);
numZ:=numelems(resZ);
numNN:=numelems(resNN);
numN:=numelems(resNoNN);
`union`(idts[1..numN]=~N,idts[numN+1..numNN]=~NN,idts[numN+numNN+1..numZ+numNN]=~Z) ;
assign(%);
S4;

The input is 

Notice that last _Z has no ~ after it, like all the others,. May that is why it was not changed by your code. Here is the output of your code

But this is not a big deal. Just thought to mention it. Will test your code more on other examples. I do not know what Maple does not have a ~ after that last Z like with all the other ones.

@Preben Alsholm 

Ah! But now your new code does not work any more on a little different example. I think it is because you hardcoded [-2..1] in there for the specific example we were talking about? 

restart;

#S4:=singular(1/(cos(x)*sin(x))+Psi(1/x),x);
S4:=singular(1/(cos(x))+Psi(1/x),x);  #try on this one
idts:=indets([S4],`local`);

idts[1]=~NN;

assign(%);

idts;

idts[-2..-1]=~Z; # Don't use _Z

assign(%);

idts;

S4;

For the above we see it changes

To

So the problem is still there. 

I think a StringTools:-RegSubs might be the easier way to do this, i.e. convert each output to string (we only need RHS) and make a regular expression which changes  _Z*anything* to _Z and also change _N*anything* to _N.  

My regular expression skill is a little rusty, but will try to see if I ca do it later on.

Btw, your example above will work if I change idts[-2..-1]=~Z;  to idts[-1..-1]=~Z;  

If you could automate this part, then I think it will work.  I can't hardcode [-2..1] ofcourse, it has to be something decided at run-time.

This is not an easy problem, all becuase Maple likes to change _Z on its own for some reason instead of using just one _Z

@Preben Alsholm 

I was also looking at StringTools:-RegSubs to do this. But I tried your code. But it seems to change _N to _Z?

I am just now interested in single example, The union part I can always do at the very end, so it is not important. I tried your code on this

S4:=singular(1/(cos(x)*sin(x))+Psi(1/x),x);

Which gives

So it should have changed _Z2 to _Z and changed _Z1 to _Z, which is does. But why it changed _NN to _Z also? DId I not use your code correctly?

restart;



S4:=singular(1/(cos(x)*sin(x))+Psi(1/x),x);
idts:=indets([S4],`local`);
idts=~NN;
assign(%);
idts;
idts=~Z; # Don't use _Z
assign(%);
idts;
S4

@Axel Vogt 

Yes, I had this problem trying the answers given above and they do not work on such cases.

I am still trying to find if there is a way out. The answers given assume there is only one singularity generated (because my example had only one output. I've just added more examples) , but there could be more (as with your example) each using different _Znnn in them and this is still a problem. The solutions given work fine when there is only one _Znnn in the result.

I wish there is away to tell Maple to just use one _Z and not keep changing it,

 

 

try with timelimit

@C_R 

Any other mserver.exe corresponds to the tabs as you open files in Maple.

But how to know which mserver.exe is connected to which worksheet?? That is the whole point of this question. I can have 10 worksheets open at once. Also many times there could be an mserver.exe  in separate places in the task manager. I've seen mserver.exe sitting on its own outside the main group of mservers.  This method of counting is not practical.

@mmcdara 

Thanks but that is too complicated for me to even follow. All what Maple needs to do is display the server.exe process ID at the bottom of the worksheet (in the bottom bar).

Should I make separate post in the product suggestion for this? This is actually one of the most annoying thing for me, because that I have no idea which mserver.exe to terminate (since Maple hangs many times for me and I need to do this few times during the day), and I end up killing the wrong mserver.exe)

@minoush82 

But (2*x)' or (x^n)' are simply wrong math notation for what you mean.

One can write y' or z' to imply diff(y(x),x) or diff(z(x),x) but not  (2*x)' to mean diff(2*x,x)

This will be most confusing to your students. Nerver seen it used anywhere.

The tick notation is used only on a single variable (i.e. function name). Not on a whole expression.

So writing  (x*sin(x)+cos(x))' is simply wrong math notation.  But one can write first  y=x*sin(x)+cos(x) and after that y'. It will be OK now.

@minoush82 

This seems to be a problem due to encoding of the output of ShowSolution not working in command line vs. worksheet. It has nothing to with Latex. Here is screen shot of the output of just the ShowSolution command without calling Latex. Notice the bad characters showing up. This is on windows

 

So when you pass this output to Latex it complains as it can't parse it. Latex itself works fine on normal Maple commands:

 

 

It looks like ShowSolution output is meant to only be used/displayed in worksheet, and they do not play nice with standard output on the terminal for some reason.

 

with(Student[Calculus1]):
res:=ShowSolution(Diff(ln(x),x)):

lprint(res)
Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mtext("",
"mathcolor" = "black")),Typesetting:-mtd(),Typesetting:-mtd(Typesetting:-mrow(
Typesetting:-mtext("Differentiation Steps","mathcolor" = "black")))),
Typesetting:-mtr(Typesetting:-mtd(),Typesetting:-mtd(),Typesetting:-mtd(
Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mstyle(
Typesetting:-mo("ⅆ",Typesetting:-msemantics = "inert")),
Typesetting:-mrow(Typesetting:-mstyle(Typesetting:-mo("ⅆ",
Typesetting:-msemantics = "inert")),Typesetting:-mi("x"))),Typesetting:-mspace(
width = "0.4em"),Typesetting:-mrow(Typesetting:-mi("ln",fontstyle = "normal"),
Typesetting:-mo("⁡"),Typesetting:-mfenced(Typesetting:-mi("x"))))
))),Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mtext("▫","mathcolor" = 
"black")),Typesetting:-mtd(),Typesetting:-mtd(Typesetting:-mrow(Typesetting:-
mrow(Typesetting:-mtext("1. Apply the","mathcolor" = "black"),Typesetting:-
mspace(" "," ",width = "thickmathspace"),Typesetting:-mstyle(Typesetting:-mtext
("natural logarithm","mathcolor" = "black"),"fontweight" = "bold","mathcolor" =
"black"),Typesetting:-mspace(" "," ",width = "thickmathspace"),Typesetting:-
mtext("rule","mathcolor" = "black"))))),Typesetting:-mtr(Typesetting:-mtd(),
Typesetting:-mtd(Typesetting:-mtext("◦","mathcolor" = "black")),Typesetting:-
mtd(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mtext(
"Recall the definition of the","mathcolor" = "black"),Typesetting:-mspace(" ",
" ",width = "thickmathspace"),Typesetting:-mstyle(Typesetting:-mtext(
"natural logarithm","mathcolor" = "black"),"fontweight" = "bold","mathcolor" =
"black"),Typesetting:-mspace(" "," ",width = "thickmathspace"),Typesetting:-
mtext("rule","mathcolor" = "black"))))),Typesetting:-mtr(Typesetting:-mtd(),
Typesetting:-mtd(),Typesetting:-mtd(Typesetting:-mrow(Typesetting:-mrow(
Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mstyle(Typesetting:-mo(
"ⅆ",Typesetting:-msemantics = "inert")),Typesetting:-mrow(
Typesetting:-mstyle(Typesetting:-mo("ⅆ",Typesetting:-msemantics =
"inert")),Typesetting:-mi("x"))),Typesetting:-mspace(width = "0.4em"),
Typesetting:-mrow(Typesetting:-mi("ln",fontstyle = "normal"),Typesetting:-mo(
"⁡"),Typesetting:-mfenced(Typesetting:-mi("x")))),Typesetting:-mo
("="),Typesetting:-mfrac(Typesetting:-mn("1"),Typesetting:-mi("x")))))),
Typesetting:-mtr(Typesetting:-mtd(Typesetting:-mtext("","mathcolor" = "black"))
,Typesetting:-mtd(),Typesetting:-mtd(Typesetting:-mrow(Typesetting:-mtext(
"This gives:","mathcolor" = "black")))),Typesetting:-mtr(Typesetting:-mtd(),
Typesetting:-mtd(),Typesetting:-mtd(Typesetting:-mrow(Typesetting:-mfrac(
Typesetting:-mn("1"),Typesetting:-mi("x"))))),columnalign = "left")


 

may be changing some settings will make it work in command line. I do not know.  It looks like it is this character which causes the problems

\textrm{▫}

when displayed in standard output

1 2 3 4 5 6 7 Last Page 1 of 65