vv

12590 Reputation

19 Badges

8 years, 244 days

MaplePrimes Activity


These are replies submitted by vv

@NIMA112 Of course it does not work because you also have y[2].

@sand15 Yes, but try to compare the timings for e.g.

d := rand(10^20 .. 10^30)():
n := d^rand(100 .. 1000)()*rand(10^10..10^20)():


 

@nm Try  n:=90; d:=3;

@dharr Just a remark. The eigenvalues are not correctly sorted; the option key=evalf should be added.

@mehdi jafari 
 

with(LinearAlgebra):

A := <<-1,-3,-6>|<3,5,6>|<-3,-3,-4>>;

Matrix(3, 3, {(1, 1) = -1, (1, 2) = 3, (1, 3) = -3, (2, 1) = -3, (2, 2) = 5, (2, 3) = -3, (3, 1) = -6, (3, 2) = 6, (3, 3) = -4})

(1)

(V,Q):=Eigenvectors(A);

V, Q := Vector(3, {(1) = -4, (2) = 2, (3) = 2}), Matrix(3, 3, {(1, 1) = 1/2, (1, 2) = -1, (1, 3) = 1, (2, 1) = 1/2, (2, 2) = 0, (2, 3) = 1, (3, 1) = 1, (3, 2) = 1, (3, 3) = 0})

(2)

Q^(-1).A.Q = DiagonalMatrix(V);

(Matrix(3, 3, {(1, 1) = -4, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 2, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 2})) = (Matrix(3, 3, {(1, 1) = -4, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 2, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 2}))

(3)

(Vt,Qt):=Eigenvectors(A^+); # left eigenvectors; the eigenvalues are always the same

Vt, Qt := Vector(3, {(1) = 2, (2) = 2, (3) = -4}), Matrix(3, 3, {(1, 1) = -2, (1, 2) = -1, (1, 3) = 1, (2, 1) = 0, (2, 2) = 1, (2, 3) = -1, (3, 1) = 1, (3, 2) = 0, (3, 3) = 1})

(4)

A . Q[..,1] = V[1] * Q[..,1];         # A.v = lambda*v

(Vector(3, {(1) = -2, (2) = -2, (3) = -4})) = (Vector(3, {(1) = -2, (2) = -2, (3) = -4}))

(5)

Qt[..,1]^+ . A = Qt[..,1]^+ * Vt[1];  # w.A = lambda*w  

(Vector[row](3, {(1) = -4, (2) = 0, (3) = 2})) = (Vector[row](3, {(1) = -4, (2) = 0, (3) = 2}))

(6)

 

 

 

@acer However,

restart;
local a; 	
a := 17:
:-a := 18:
p := proc()
  local a;
  a := 25;
  return parse("a",statement);
end proc:

p();  #17

 

@mmcdara Sorry, probably I have seen an older version of your answer, or maybe I was not careful enough.

@mmcdara You have ommited useassumptions. So, solve has another task: a single inequality instead of a system.

@Axel Vogt Just replace 10.0 by 10

@sursumCorda 
I used Maple 2018 on an old Windows tablet  and I obtain 
limit(1/f, x=infinity) = 0.

@petit loup   "#" starts a comment, so actually method='integer'  is not needed when the matrix has integer entries.
For our matrix A,
S,U,V := SmithForm(A, output=['S,U,V'], method='integer');
and
S,U,V := SmithForm(A, output=['S,U,V']);
give the same result.
 

@mmcdara Actually, when limit returns an interval a..b, this means that the limit does not exist; mathematically this is equivalent to the undefined result, but Maple also says that the limit points (aka accumulation points) are contained in the interval a..b.

Note that e.g. 

limit(3*sin(1/x)-4*cos(1/x), x=0);
    -7 .. 7

but actually the set of accumulation points is the interval -5 .. 5, which Maple cannot find.

It would be nice to have in Maple the comands  sup, inf, limsup, liminf for functions and sequences, just like in Mathematica!

@mmcdara Probably the designers consider that <...> is enough, e.g. the first method or

<M[1,1],M[1,2]; M[2,1],M[2,2]>;

 

@Mikey_W 

restart;
m:=1000: n:=1000: A:=LinearAlgebra:-RandomMatrix(m, n):
x:=Pi/77:
    
f:=proc(x,A) local i,j,s:=0; 
for i to m do for j to n do
  s:=s+cos(sin(x+A[i,j]));
od od;
s
end proc:

CodeTools:-Usage( evalf(f(x,A)) );
## memory used=6.11GiB, alloc change=33.00MiB, cpu time=10.89s, real time=10.90s, gc time=1.70s

##                        7.639612369 10^5 

CodeTools:-Usage( evalhf(f(x,A)) );
## memory used=7.63MiB, alloc change=7.63MiB, cpu time=265.00ms, real time=266.00ms, gc time=0ns

##                    7.63961236894650501 10^5 

 

@acer  No, please do.

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