Carl Love

Carl Love

28110 Reputation

25 Badges

13 years, 121 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

There is no attached file on your question.

@J4James Sorry, I didn't notice the attached file. I got it now.

What is it that the output doesn't match? Can you show a graph of the alternative?

It's an interesting problem. The simplified form that you got with solve andsubs contains sqrt(s[4]), even though the expressions to be simplified and the side relations are purely polynomial. The simplify-with-side-relations will never introduce sqrt like that. There may be some options though. I haven't been able to get it to work yet, but there may be a way where you change s[4] to s[4]^2.

Thanks for the addition. I had stretched out the computation for pedagogical reasons---to emphasize the linear algebra---thinking that the OP was taking a course in it.

Thanks for the addition. I had stretched out the computation for pedagogical reasons---to emphasize the linear algebra---thinking that the OP was taking a course in it.

No MaplePrimes 2D math mode, please, because it looks like this: int(1/(1+cot(x)), x);

No MaplePrimes 2D math mode, please, because it looks like this: int(1/(1+cot(x)), x);

There was no attached file on your post.

Generally only real symmetric or Hermitian matrices are classified by the "nature" of their definiteness. Those matrices only have real eigenvalues.

So, the ion is always placed on one of the coordinate axes, right? Then it can be done as three 2d plots: Energy vs. position along the axis, done for each axis.

Mehdi,

Do you mean that you want to do exact computations? Or do you mean that you want Maple to truncate the decimals rather than rounding them?

 Here's a comparison of several of Maple's solvers on a 256x256 dense system.

 

Comparison of several dense linear system solvers working at simulated quadruple precision.

restart:

Digits:= 34:

with(LinearAlgebra):

A:= RandomMatrix(2^8):

Make it symmetric positive definite so that we can use Cholesky.

A:= A^%T.A:

B:= RandomVector(2^8):

The modular method is an exact p-adic solver.

X1:= CodeTools:-Usage(LinearSolve(A, B, method= modular)):

memory used=145.09MiB, alloc change=24.00MiB, cpu time=2.09s, real time=2.12s

Verify exactness.

Norm(A.X1 - B);

0

 

Convert random data to floating point for the remaining methods.

A:= Matrix(A, datatype= float):  B:= Vector(B, datatype= float):


X2:= CodeTools:-Usage(LinearSolve(A, B, method= LU)):

memory used=2.31GiB, alloc change=48.00MiB, cpu time=18.06s, real time=17.06s

Norm(A.X2 - B);

0.9485e-27

 

Norm(X1-X2);

0.6429e-30

 

The hybrid method uses LU in hardware double precision with iterative refinement to the full value of Digits.

X3:= CodeTools:-Usage(LinearSolve(A, B, method= hybrid)):

memory used=317.98MiB, alloc change=0 bytes, cpu time=2.97s, real time=2.26s

Norm(A.X3 - B);

0.808e-27

 

Norm(X3 - X1);

0.4583e-30

 

So hybrid is significantly faster and slightly more accurate than plain LU.

 

X4:= CodeTools:-Usage(LinearSolve(A, B, method= QR)):

memory used=4.65GiB, alloc change=0 bytes, cpu time=38.58s, real time=35.67s

Norm(A.X4 - B);

0.1055e-26

 

Norm(X4 - X1);

0.10927e-29

 

X5:= CodeTools:-Usage(LinearSolve(A, B, method= Cholesky)):

memory used=1.19GiB, alloc change=0 bytes, cpu time=8.56s, real time=8.12s

Norm(A.X5 - B);

0.5172e-27

 

Norm(X5 - X1);

0.8069e-30

 

Amazingly, the exact solver wins by a wide margin.

 

Download Linear_Solvers.mw

@Kitonum You're using Maple 16, right? I don't know what's wrong. It works in my Maple 16 (and Maple 17 of course). I think that even in Maple V r 4 (my earliest), `or` took an arbitrary number of arguments.

@Kitonum You're using Maple 16, right? I don't know what's wrong. It works in my Maple 16 (and Maple 17 of course). I think that even in Maple V r 4 (my earliest), `or` took an arbitrary number of arguments.

ISC:=proc(T::list, Eq::`=`)
local f:= unapply((lhs-rhs)(Eq), indets(Eq,name)[]);
     `or`(seq(f(i[]) >= 0, i= T)) and `or`(seq(f(i[]) <= 0, i= T))
end proc:

First 599 600 601 602 603 604 605 Last Page 601 of 710