sursumCorda

235 Reputation

8 Badges

0 years, 106 days

MaplePrimes Activity


These are replies submitted by sursumCorda

@C_R Thanks. That's really strange. I don't know what happened in Maple 2023: sqrt(A^2) doesn't work, but sqrt(A)^2, sqrt(A*A), and sqrt(A)*sqrt(A) all works.

@C_R Thanks for your try. Since the error occurs in `simplify/sqrt/fraction`, can you reproduce this in Maple 2022.2? 
 

interface(version) = `Standard Worksheet Interface, Maple 2023.0, Windows 10, March 6 2023 Build ID 1689885`NULL

restart;

showstat(`simplify/sqrt/fraction`, 1 .. 2)


`simplify/sqrt/fraction` := proc(f)
local i, nu, de, n, d, nr, dr, g, j, ex, a, gtmp, rmvd, N;
   1   n := traperror(numer(f));
   2   if n = lasterror then
           ...
       end if;
       ...
end proc
 

 

FUNC := proc (x::{list, set, algebraic}) options operator, arrow; end proc

x := -1

proc (x::{list, set, algebraic}) options operator, arrow; end proc

(1)

Typesetting:-mrow(Typesetting:-mi("f0", italic = "true", mathvariant = "italic"), Typesetting:-mo("≔", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"), Typesetting:-mo("proc", bold = "true", mathvariant = "bold", fontweight = "bold", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("f", italic = "true", mathvariant = "italic")), mathvariant = "normal"), Typesetting:-mi(""), Typesetting:-mspace(height = "0.0ex", width = "0.5em", depth = "0.0ex", linebreak = "firstprocnewline"), Typesetting:-mo("local", bold = "true", mathvariant = "bold", fontweight = "bold", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo(" ", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mi("n", italic = "true", mathvariant = "italic"), Typesetting:-mo(" ", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo("≔", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"), Typesetting:-mo(" ", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mi("traperror", italic = "true", mathvariant = "italic"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("FUNC", italic = "true", mathvariant = "italic"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("f", italic = "true", mathvariant = "italic")), mathvariant = "normal")), mathvariant = "normal"), Typesetting:-mo(";", mathvariant = "normal", fence = "false", separator = "true", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.2777778em"), Typesetting:-mspace(height = "0.0ex", width = "0.5em", depth = "0.0ex", linebreak = "firstprocnewline"), Typesetting:-mi("evalb", italic = "true", mathvariant = "italic"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("n", italic = "true", mathvariant = "italic"), Typesetting:-mo("=", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"), Typesetting:-mi("lasterror", italic = "true", mathvariant = "italic")), mathvariant = "normal"), Typesetting:-mi(""), Typesetting:-mspace(height = "0.0ex", width = "0.5em", depth = "0.0ex", linebreak = "decreaseindentnewline"), Typesetting:-mo("end", bold = "true", mathvariant = "bold", fontweight = "bold", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo(":", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"))

Typesetting:-mrow(Typesetting:-mi("f1", italic = "true", mathvariant = "italic"), Typesetting:-mo("≔", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"), Typesetting:-mo("proc", bold = "true", mathvariant = "bold", fontweight = "bold", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("f", italic = "true", mathvariant = "italic")), mathvariant = "normal"), Typesetting:-mi(""), Typesetting:-mspace(height = "0.0ex", width = "0.5em", depth = "0.0ex", linebreak = "firstprocnewline"), Typesetting:-mo("local", bold = "true", mathvariant = "bold", fontweight = "bold", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo(" ", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mi("n", italic = "true", mathvariant = "italic"), Typesetting:-mo("≔", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"), Typesetting:-mi("traperror", italic = "true", mathvariant = "italic"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("numer", italic = "true", mathvariant = "italic"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("f", italic = "true", mathvariant = "italic")), mathvariant = "normal")), mathvariant = "normal"), Typesetting:-mo(";", mathvariant = "normal", fence = "false", separator = "true", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.2777778em"), Typesetting:-mspace(height = "0.0ex", width = "0.5em", depth = "0.0ex", linebreak = "firstprocnewline"), Typesetting:-mi("evalb", italic = "true", mathvariant = "italic"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(""), Typesetting:-mrow(Typesetting:-mi("n", italic = "true", mathvariant = "italic"), Typesetting:-mo("=", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"), Typesetting:-mi("lasterror", italic = "true", mathvariant = "italic")), Typesetting:-mi("")), mathvariant = "normal"), Typesetting:-mi(""), Typesetting:-mspace(height = "0.0ex", width = "0.5em", depth = "0.0ex", linebreak = "decreaseindentnewline"), Typesetting:-mo("end", bold = "true", mathvariant = "bold", fontweight = "bold", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo(":", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"))

f0("")

true

(2)

f1("")

false

(3)

NULL


 

Download lasterror.mw

@Preben Alsholm Many thanks. Could you test f~(x,y) and f~(x,` $`,y) additionally? (I think that the latter would run a bit faster, but I cannot confirm this.)

@Scot Gould This works: 

restart;
with(Units):
Automatically loading the Units[Simple] subpackage


A := 1, 2, 3:
B := 4, 5, 6:
AB := :-eval('B' - 'A');
                         AB := 3, 3, 3

Note that the original B - A is equivalent to 

Units:-Simple:-`+`(B, Units:-Simple:-`-`(A));
                               11

B - A;
                               11

:-eval('B' - 'A'); # fix it
                            3, 3, 3

 

@Preben Alsholm & @Carl Love Thanks again. 
Maybe the real time just depends upon the chronological order of codes. When I run the zip version first, `~` is slower instead: (But it seems to me that the first call almost always uses more memories.) 
 

restart;

x := combinat:-randperm(2*10^7):
y := combinat:-randperm(2*10^7):

undefine(f);

t4 := CodeTools[Usage](zip(f, x, y), iterations = 5)

memory used=1.44GiB, alloc change=2.42GiB, cpu time=2.14m, real time=37.94s, gc time=105.51s

 

t2a := CodeTools[Usage](`~`[f](x, y), iterations = 5)

memory used=1.04GiB, alloc change=-4.00MiB, cpu time=2.29m, real time=38.87s, gc time=115.58s

 

t2b := CodeTools[Usage](`~`[f](x, ` $`, y), iterations = 5)

memory used=1.04GiB, alloc change=0 bytes, cpu time=2.20m, real time=38.44s, gc time=109.43s

 

evalb(t2a = t2b and t2b = t4)

true

(1)

NULL


 

Download `_`_and_zip.mw

@Preben Alsholm Thanks for your reply. Surely their respective domains of operation are different, but I am intrigued to know when `~` and map do the same thing, why the latter is less efficient here. (Is this just determined by the computer's performance?)

@Christian Wolinski Many thanks. I think that this doesn't work on the trivial case x = [].

@Carl Love Thanks very much. I shall think it over later.

And what about other two commands? Contrary to my expectations, they do not do the same thing (at least here). 

@Oliveira I find an instance such that _Z1  _Z1

restart;
op([-1, -1], Invfunc[cos](0)):
ToInert(%);

restart;
op([-1, -1], Invfunc[cos](0)):
ToInert(%);

restart;
op([-1, -1], Invfunc[cos](0)):
ToInert(%);

The return value is always _Inert_LOCALNAME("_Z1~", ```different number```), which is surely distinct from the ToInert(_Z1).

@nm Thanks. As regards the series solutions, if an "exact" general solution is available, we can utilize the asympt function later, but if the symbolic solver is stuck… 
An instance that both Maple and Mathematica cannot solve: 

dsolve({t^2*diff(diff(z(t),t),t)+log(t)^2*z(t)=0},z(t),type='series',t=infinity):
AsymptoticDSolveValue[t^2*Derivative[2][z][t]+Log[t]^2*z[t]==0,z[t],t->Infinity];

@nm It's a undocumented internal function, so use of Holonomic`DifferentialAsymptoticSeries is somewhat discouraged. 

In addition, unfortunately, 

dsolve({t^6*diff(diff(z(t),t),t)+2*t^5*diff(z(t),t)-4*z(t)=0},z(t),'series');

returns nothing (in other words, Maple is unable to find symbolic solution), but Mma's AsymptoticDSolveValue is still capable of solving it. (I don't why.)

@nm Actually, one can obtain (almost) the same results in Mma: 

Series solutions from MatLab's ode::series (just for comparison): 

@Carl Love & @mmcdara Thanks. 

In my opinion, Mathematica's Apply is technically not identical with Maple's apply. Compare:

(* Mma *)
Construct[f, a, b, c];
(* Maple *)
apply(f, a, b, c):

 and 

(* Mma *)
Apply[f, {a, b, c}];
(* Maple *)
`?()`(f, [a, b, c]):

@Carl Love Well, maybe the better term is "ordered pair" rather than "rule" (let alone "function"). (A bijection is dispensable.)
Here is the result from Mathematica: 

1 2 3 4 5 Page 1 of 5