235 Reputation

0 years, 106 days

thank you...

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

lastexception...

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

=

 > restart;
 >
 `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
 >
 >
 (1)
 >
 >
 >
 (2)
 >
 (3)
 >

` \$`...

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

one way...

@Scot Gould This works:

```restart;
with(Units):

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
```

Now I know...

@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);
 >
 memory used=1.44GiB, alloc change=2.42GiB, cpu time=2.14m, real time=37.94s, gc time=105.51s
 >
 memory used=1.04GiB, alloc change=-4.00MiB, cpu time=2.29m, real time=38.87s, gc time=115.58s
 >
 memory used=1.04GiB, alloc change=0 bytes, cpu time=2.20m, real time=38.44s, gc time=109.43s
 >
 (1)
 >

clean up...

@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?)

But...

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

enquiry...

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

An observation...

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

I see...

@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];
```

reserved for internal use...

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

`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.)

As for Mathematica...

@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]):
```

MMA...

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