vv

13922 Reputation

20 Badges

10 years, 10 days

MaplePrimes Activity


These are replies submitted by vv

@Carl Love 

For the body of a module the documentation is not clear enough. It seems that the assignments to locals are always executed here.
For example, if in Rand the ModuleLoad is removed, it works the same from library or directly.

Just want to add that the final answer can be simplified a bit, but unfortunately Maple needs a litte help for this:

simplify(eval(ans, t=2*ln(z))):
ANS:=simplify(eval(%, z=exp(t/2)));

 

@Kitonum 

Of course, a more "artistic" version is welcome.

@acer
Sometimes this old post works. In this case:

Par3d((8 - x^2 - y^2-z)*(x^2 + y^2-z), x=0, y=0, z=4, 10, 40,40):
PLOT3D(%);

 

 

@Earl 

The options are distinct.
For more than one inequalities, inequal fills the intersection while implicitplot fills the union.

@Carl Love 

Such a method has chances only for simple expressions (not containing user's function calls).
A general method would need a kernel redesign.

@Carl Love 

It works simply because the inner evalf has Digits=Digits0=10 >= 5.

But a sigfig is not simple. evalf[n] for a mathematical function gives in general n significant correct digits, but for an expession it's difficult because we must estimate the needed precision (to compensate e.g. the catastrophic cancellations).
Mathematica tries to do this, but fails sometimes. Maple prefers to let the user choose the precision for the desired accuracy. However for some commands (e.g. Int) there is an "epsilon" for accuracy.

f := x -> sqrt(x^2+1)-x + 1/3:
g := x -> 1/(sqrt(x^2+1)+x):
a:=10^9/3: # exact
evalf[15](f(a)-g(a)); # exact = 1/3;

                       0.333332998500000
a:=10^15/3: # exact
evalf[15](f(a)-g(a)); # exact = 1/3;

                    -1.50000000000000*10^(-15)  

@Glowing 

restart
p1 := 1007.0:
p2 := 1014.0:
evalf(evalf(p2 - p1), 2);   
# The outer evalf passes Digits=2 to the inner evalf
# For Digits=2 we have p1 - p2 = 1e3 - 1e3 = 0.
# So, the outer evalf does evalf[2](0.) = 0.  

                               0.
evalf(evalf(p2 - p1, 4), 2);
# Now the inner evalf sets Digits from 2 to 4 ==> 7.0

                               7.

 

Note that

evalf[2](1014.0-1007.0);
           7.

due to automatic simplification, which is done with Digits=10.

 

@Kitonum 

We cannot compare evalf[n] with Mathematica's N because N attempts to give the result with n digits precision
while evalf[n] uses n digits precision.
I think that it would be useful to explain how Maple obtains the following answers (evaluation rules, option remember):

restart;
m:=206:  x:=210.0:
evalf[2](`+`(x,-m)) , (evalf[2]@`+`)(x,-m), (evalf[2]@`+`)('x',-m);

                       0., 4.0, x - 210.
 

restart;
m:=206:  n:=210:  x:=210.0:

evalf[2](x-m), evalf[2](n-m);  
                             0., 4.

 

restart;
m:=206:  n:=210: z:=0.0:
evalf[2](n-m+z), evalf[2](2*z+n-m);  

                             4., 0.
restart;
m:=206:  n:=210: z:=0.0:
evalf[2](n-m+z), evalf[2](z+n-m);  

                             4., 4.
restart;
m:=206:  n:=210: z:=0.0:
evalf[2](z+n-m), evalf[2](n-m+z);  

                             0., 0.
restart;
m:=206:  n:=210: z:=0.0:
evalf[2](2*z+n-m), evalf[2](n-m+z);

                             0., 4.

 

@Carl Love 

1.

Yes, it's curious that RowReduce is faster, because for Determinant, the default method is REF.
BTW, replacing in MDS Determinant by RowReduce, in Maple 2019 I get [each after restart]:

CodeTools:-Usage(MDS2(A80,8)):
memory used=1.02GiB, alloc change=32.00MiB, cpu time=15.96s, real time=15.96s, gc time=265.20ms
CodeTools:-Usage(IsMDS(A80,8)):
memory used=2.65GiB, alloc change=60.50MiB, cpu time=15.27s, real time=15.20s, gc time=795.61ms
(In Maple 2018 the results are the same.)

2.

n <= m <= n^2 - n +1

both limits being attained.

 

 

@Carl Love 

But of course, if A has integer[], Mod is not necessary, e.g.
A:= LA:-RandomMatrix(64$2, generator= rand(0..1), datatype=integer[kernelopts(wordsize)/8]):

Merry Christmas !

 

@Magma 

LinearAlgebra:-Modular:-MatrixPower(2, A, k)

 

@Magma

It also appears in the definition of B[i,j].
I am curious if it takes <1 min. I do not have a 64 MDS matrix to check.

@Magma 

It seems that you have a 32 bit Maple. Please replace integer[8] with integer[4] (twice)

@Magma 

I think you have copied the code while I was editing. Please copy again.

First 52 53 54 55 56 57 58 Last Page 54 of 176