Items tagged with linear-algebra linear-algebra Tagged Items Feed

How to implement in maple, the differentiation matrix of second order ?
Is it possible to implement it with the command LinearAlgebra[BandMatrix]?

I can not get the matrix:



Lets look at an example using the following set of 8 discrete points (x,y)

(2,5),(4,15),(6,35),(8,65),(10,100),(12,145),(14,195), and (16,255).

The "." notation for the dot product of Vectors is very convenient and intuitive.  For example:

> <1,2,3> . <1,1,1>;

6

One sometimes annoying feature of it, however, is that by default Maple is using a dot product (suitable for Vectors with complex scalars) that is conjugate-linear in the first argument.  But let's say you will only be working with real scalars.  There's no problem if your Vectors have numeric entries, but...

Help!

I've used Eigenvectors to solve for eigenvalues & eigenvectors.  Eigenvalues works, no problem.

The eigenvectors are not normalized to unit magnitude (how would I do that for all eigenvectors?) and the usual matrix multiplication of the eigenmatrix by its transpose should give the identity matrix--and somehow it does not. 

Can someone point out the flaw in my thinking?  The file is attached.

 

Thanks for you insight! 

problem with MatrixPower

June 02 2011 by riptor 0 Maple

hello!

 

i seem to have a problem with MatrixPower...

if i define a matrix such as

A:=([[-5,1],[-5,0]])

and use MatrixPower(A,k);

then i get the matrix A^k.

but, if fur example i do the following, i get an error:

A:=([[-5,1],[-5,0]]);

a:=exponential(A,1);

MatrixPower(a,k);

Error, (in LinearAlgebra:-MatrixPower) invalid input: LinearAlgebra:-MatrixPower expects its 1st argument, A, to be of type Matrix(square...

The goal of computing only a select number of eigenvectors of a real symmetric floating-point Matrix comes up now and then. For very large Matrices the memory requirements can be more restrictive than the timing.

The attached worksheet and code computes this, more quickly and with significantly less memory allocation than does the usual task of computing all eigenvectors. By using the supplied Matrix itself as a partial "workspace" the amount of additional workspace and memory allocation for the task is negligible.

For example, having created the very large Matrix in the first place,  essentially no significant further memory allocation is required to compute the largest eigenvalue and its associated eigenvector.

A little about this routine `SelectedEigenvectors` follows.

It only works in hardware double precision. It expects a float[8] datatype Matrix (because you are serious about using minimal memory!). It uses the CLAPACK function dsyevx, using the "wrapperless" version of Maple's external-calling mechanism. It seems to work fine in the systems I've tried so far: Maple 13 and 14 on both 32bit and 64bit Linux and Windows.

Whether it computes and returns the selected eigenvectors (alongside the selected eigenvalues, which are always returned) is controlled by the 'vectors=truefalse' optional argument. By default it uses the Matrix argument as partial workspace and so destroys the original data; but this can be overridden with the 'preserve=true' optional argument. The requested accuracy can be relaxed with the 'epsilon=float' optional argument, which might sometimes speed it up.

The input Matrix is presumed to be symmetric. By default it uses the data in the lower triangle, but this can be changed to be the upper triangle with the 'uplo' optional argument.

The choice of eigenvalues is controlled by the two integer arguments `il` and `iu`. If il=iu=n then only the nth largest eigenvalue is computed. If il=1 and iu=4 then the four smallest eigenvalues are computed.

It returns three things: a Vector of dimension n whose first m entries are the selected eigenvalues, a nxm Matrix whose columns are the m associated eigenvectors, and a Vector of dimension n whose entries indicate whether corresponding eigenvectors failed to converge.

I didn't enable float arguments such as `vl` and `vu` which in principle could allow one to supply a floating-point range in which to find eigenvalues.

I didn't make an optimization of having it do an initial "dummy" external call in which no calculation would be done, but which would instead query for and subsequently utilize the optimal-performance additonal float workspace size.

For reasons mysterious to me, on Windows the 64bit version runs almost exactly half as fast as the 32bit version.

Usually, the workspace for eigen-solving is implemented to be at least O(n^2) for an nxn Matrix. But this routine does only O(m+n) extra workspace allocation to compute the m eigenvectors. And that is linear. Which is the Big Deal.

A 5000x5000 datatype=float[8] (ie. hardware double precision) Matrix takes 200MB of memory. With the preserve=true option, this routine can compute just the largest eigenvector with only about 200MB of additional allocation. And if the original Matrix is no longer required then with the preserve=false option this routine can do that task with less than 1MB further allocation. In comparison, the regular LinearAlgebra:-Eigenvectors command would require about 600MB of additional memory allocation while computing all eigenvectors.

At size 5000x5000 this routine is only about four times faster than LinearAlgebra:-Eigenvectors. I suspect that is because it still has to compute in full the reduction to tridiagonal form.

Download dsyevx.mw

I have a system of equations  AX=B where the matrix A from dimension 307x200, X from 200x1, and B from 307x1
How can I use Gauss elimination to solve these system of equations.

How to explain, in Maple, Ax as a combination of the columns of A?

HerClau

Gracias

Using SVD to underst.mw

Hola ev1;
In the procedure PLOTSVD, I get the error
"Error, (in SVDPLOT) invalid input: linearalgebra" SingularValues Expects output value for keyword parameter to Be of type {list (identical (U, S, Vt, list)), identical (U, S, Vt, list)}

How to Shuffle Matrix

December 02 2010 by herclau 933 Maple

Hola;

one short question:

 How to apply random permutations of data within an matrix.

<a,b,c;d,e,f> --Shuffle-->

finding parameters

November 08 2010 by Michele T 5 Maple

Is there a way to solve the following problem?
Given a nxn A=(A_ij) matrix (for example n=3,4...) where A-ij is a
polynomial of degree one in X_1, ..., X_n, and given a n-vector
v=(B_11*X_1+...+B_1n*X_n, ..., B_n1*X_1+...+B_nn*X_n)^t where B_ij are
parameters, is it possible to find value for B_ij in such way that the
vector v belongs to the vector space spanned by the columns of A?
thank you.
best
Michele

Lie algebra cohomology

October 30 2010 by Michele T 5 Maple

I would like to compute the Lie algebra cohomology of a complex lie algebra g in a representation h/g where h is a Lie algebra containing g. is it possible?if yes, how. thank you.


I have the following list, vector or set, I put it in a matrix

 

 

With the idea developed by Robert Israel on the

What is the Problem? Do not use SingularValues (A, output = ['list'])?
Some care in handling this command?



1 2 Page 1 of 2