Items tagged with linearalgebra

How do you recommend to calculate the square root of big Matrices (e.g, 300*300) with Maple??

My machine couldnt calculate the square root of Matrices (9*9) as you see below:


 

``

restart

Error, invalid input: with expects its 1st argument, pname, to be of type {`module`, package}, but received shareman

 

with(LinearAlgebra):

``

A := Matrix([[1, 2, 3, 4, 5, 6, 7, 8, 9], [9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 2, 3, 4, 5, 6, 7, 8, 9], [9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 2, 3, 4, 5, 6, 7, 8, 9], [9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 2, 3, 4, 5, 6, 7, 8, 9], [9, 8, 7, 6, 5, 4, 3, 2, 1], [1, 2, 3, 4, 5, 6, 7, 8, 9]])

A := Matrix(9, 9, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (1, 4) = 4, (1, 5) = 5, (1, 6) = 6, (1, 7) = 7, (1, 8) = 8, (1, 9) = 9, (2, 1) = 9, (2, 2) = 8, (2, 3) = 7, (2, 4) = 6, (2, 5) = 5, (2, 6) = 4, (2, 7) = 3, (2, 8) = 2, (2, 9) = 1, (3, 1) = 1, (3, 2) = 2, (3, 3) = 3, (3, 4) = 4, (3, 5) = 5, (3, 6) = 6, (3, 7) = 7, (3, 8) = 8, (3, 9) = 9, (4, 1) = 9, (4, 2) = 8, (4, 3) = 7, (4, 4) = 6, (4, 5) = 5, (4, 6) = 4, (4, 7) = 3, (4, 8) = 2, (4, 9) = 1, (5, 1) = 1, (5, 2) = 2, (5, 3) = 3, (5, 4) = 4, (5, 5) = 5, (5, 6) = 6, (5, 7) = 7, (5, 8) = 8, (5, 9) = 9, (6, 1) = 9, (6, 2) = 8, (6, 3) = 7, (6, 4) = 6, (6, 5) = 5, (6, 6) = 4, (6, 7) = 3, (6, 8) = 2, (6, 9) = 1, (7, 1) = 1, (7, 2) = 2, (7, 3) = 3, (7, 4) = 4, (7, 5) = 5, (7, 6) = 6, (7, 7) = 7, (7, 8) = 8, (7, 9) = 9, (8, 1) = 9, (8, 2) = 8, (8, 3) = 7, (8, 4) = 6, (8, 5) = 5, (8, 6) = 4, (8, 7) = 3, (8, 8) = 2, (8, 9) = 1, (9, 1) = 1, (9, 2) = 2, (9, 3) = 3, (9, 4) = 4, (9, 5) = 5, (9, 6) = 6, (9, 7) = 7, (9, 8) = 8, (9, 9) = 9})

(1)

MatrixFunction(A, sqrt(v), v)

Error, (in LinearAlgebra:-MatrixFunction) could not compute finite interpolating value by evaluation of (1/2)/v^(1/2) at eigenvalue 0 which has multiplicity greater than one in the minimal polynomial

 

``

``

``

``

``


 

Download askkk.mw

I have many linear equations as below(f,g,h,...,p, are linear of S,T,..,W):

y1=f(S[i,j],T[i,j],U[i,j],V[i,j],W[i,j]);

y2=g(S[i,j],T[i,j],U[i,j],V[i,j],W[i,j]);

y3=h(S[i,j],T[i,j],U[i,j],V[i,j],W[i,j]);

.

.

.

yn=p(S[i,j],T[i,j],U[i,j],V[i,j],W[i,j]);

Where (i,j)=(0,0),...,(I,J)

How ask Maple to write them in Matrix form as below:

AX=0

Where X is: X=Transpose{S[0,0],S[0,1],S[0,J],...,S[1,0],S[1,1],...,S[1,J],...,S[I,0],S[I,1],...,S[I,J],

                        T[0,0],T[0,1],T[0,J],...,T[1,0],T[1,1],...,T[1,J],...,T[I,0],T[I,1],...,T[I,J],...,W[I,J]}

    

Dear Maple experts,

I am struggling with a difference between the symbolic and numerical solution of an eigendecomposition of a symmetric positive definite matrix. Numerically the solution seems correct, but the symbolic solution puzzles me. In the symbolic solution the reconstructed matrix is different from the original matrix (although the difference between the original and the reconstructed matrix seems to be related to an unknown scalar multiplier.

restart;
with(LinearAlgebra);
Lambda := Matrix(5, 1, symbol = lambda);
Theta := Matrix(5, 5, shape = diagonal, symbol = theta);
#Ω is the matrix that will be diagonalized.
Omega := MatrixPower(Theta, -1/2) . Lambda . Lambda^%T . MatrixPower(Theta, -1/2);
#Ω is symmetric and in practice always positive definite, but I do not know how to specify the assumption of positivess definiteness in Maple
IsMatrixShape(Omega, symmetric);

# the matrix Omega is very simple and Maple finds a symbolic solution
E, V := Eigenvectors(Omega);

# this will not return the original matrix

simplify(V . DiagonalMatrix(E) . V^%T)

# check this numerically with the following values.

lambda[1, 1] := .9;lambda[2, 1] := .8;lambda[3, 1] := .7;lambda[4, 1] := .85;lambda[5, 1] := .7;
theta[1, 1] := .25;theta[2, 2] := .21;theta[3, 3] := .20;theta[4, 4] := .15;theta[5, 5] := .35;

The dotproduct is not always zero, although I thought that the eigenvectors should be orthogonal.

I know eigenvector solutions may be different because of scalar multiples, but here I am not able to understand the differences between the numerical and symbolic solution.

I probably missed something, but I spend the whole saturday trying to solve this problem, but I can not find it.

I attached both files.

Anyone? Thank in advance,

Harry

eigendecomposition_numeric.mw

eigendecomposition_symbolic.mw

Hi Maple Community,

I just got my Maple licence and currently I'm going thorugh some basic tutorials in which I've encountered a problem I can't seem to fix:

I'm trying to use the 'LinearSolve' solver as it is shown in the examples on the Maplesoft.com support page:

 

 

But I can't seem to get Maple to display a result like it is shown in the picture above.

Instead Maple displays this:

 

I would be very grateful if someone could tell me what I'm doing wrong.

 

regards, Alex

In Maple18.02:

Hso := Matrix(8, {(1, 4) = -x, (1, 6) = I*x, (2, 3) = x, (2, 5) = I*x, (3, 2) = x, (3, 5) = -I*z, (3, 8) = y, (4, 1) = -x, (4, 6) = I*z, (4, 7) = -y, (5, 2) = -I*x, (5, 3) = I*z, (5, 8) = -I*y, (6, 1) = -I*x, (6, 4) = -I*z, (6, 7) = -I*y, (7, 4) = -y, (7, 6) = I*y, (8, 3) = y, (8, 5) = I*y})

av, AV := LinearAlgebra[Eigenvectors](Hso)

Error, (in Polynomial:-Quadratic) type `truefalseFAIL` does not exist


This does not happen in Maple17.

Hey guys,

I have this (6x1) matrix:

And I wish to factor a vector of the recurring terms out of it, this particular vector:

So that I end up with a (6x6) Matrix multiplied to that vector.

 

Thank you

The following procedure is intended to recursively generate all vectors in the set of n dimension vectors with elements 0 to p-1. If I use a fixed value for p it works fine, but as soon as I introduced p as an argument it gives the error "Error, (in F) invalid input: F uses a 2nd argument, n, which is missing".

F:=proc(p,n)
  if n=1 then:
    return [seq(Vector([x]),x=0..(p-1))];
  else:
    return [ seq(seq(Vector([v[],xn]),v in F(n-1)),xn=0..(p-1)) ];
  end if:
end proc:

F(3,2);

I cannot for the life of me figure out what is wrong with the above code? Can anyone enlighten me?

Thanks in advance for your help.

fn1 and gn1 are the 2x2 matrices. For example
 

fn1:=Matrix(2,2,[seq(f[i],i=1..4)])
gn1:=Matrix(2,2,[seq(g[i],i=1..4)])


eq1:=evalm(Matrix(2,2, [1, 1, 0, 3])&*fn1+gn1)=Matrix(2,2,[0]);

eq2:=evalm(fn1+gn1)=Matrix(2,2, [0]);

how can we find fn1 and gn1 matrices?

I can't find in the Linear Algebra package the command for creating the duplication matrix.

The duplication matrix is the n * n rows and n * ( n + 1 ) / 2 columns that transforms vech(A)
to vec(A) where A is a symmetric n by n matrix (Magnus & Neudecker).

If it not yet in Maple itself, has someone already made a proc for it?

Harry Garst

 

I've read the spec online for LinearSolve but it's not clear on the function of inplace on nonsquare matrices. For example, consider the following:

A:=<0;1>;
B:=<0:2>;
LinearSolve(A,B,inplace=true)

This last line outputs <2;0>, which is also the value stored in B after the operation, whereas [2] would be the desired result. In the case of A being a row vector an error is encountered due to lack of storage. Does what happened above generalise for any matrix with more rows than columns: storing the result in B, but adding zeroes to the bottom unused parts of B, due to B being larger than the solution?

Also, does anyone have any advice on an efficient method for solving A.x=b, in the case where b is a vector, and A is a large but tall (varying size, but often 5x as many rows as columns, e.g. 10000x2000) integer matrix, where most of the entries in any particular column are zero (more than 90%)? I've found the option method='modular' helps quite a lot, but not enough, any ideas for quick fixes?

Q1: Pascal’s Matrix of order n is given by:
Sij =(i + j)!/ i!*j!
Use Mable to produce Pascal’s Matrix of order 8.

Q2: Study the Matrix decomposition (i.e. QR, LU, and LLT), then use Maple to produce these decompositions for a random Matrix of order 6.

Q3: Write one paragraph of your own to explain Moore-Penrose Inverse of a Matrix. Use Maple to find Moore-Penrose Inverse for a random Matrix of order 8.

Q4: Use Maple to find Jordan Canonical form for a random Matrix of order 10.

Q5: Use the seq command to generate the triple [i,j,k] for all possible values for 1 ≤ i,j,k ≤ 10, then plot this triple. i.e. Use nested seq .

Q6: Let F[n] be the set:
F[n] = {p / q: 1 ≤ q ≤ n,p ≤ p ≤ q}
Use Maple to find F[6].

Hi dears,

How can I detect two equivalent matrices? Is there any Maple command for this?

Also, Is there any command to verify that two matrices have the same Smith normalform?

Sincerely yours

First Question: How to define nx1 matrix Y:=(y1,y2,...,yn) ? (n is a Natural number while it is ungiven)

Second Question: How to derivative of matrix Y with respect to nx1 matrix X:=(x1,x2,...,xn) ?

 


My efforts for the first question:  (I know to define 6x1 matrix etc. , but I dont know to define nx1 matrix

restart: Matrix(1..6,1,symbol=y) 

 

My efforts for the second question:

restart; with(VectorCalculus);
Matrix([x^2, x*y, x*z]);
Jacobian([x^2, x*y, x*z], [x, y, z]);


Can you help me? 

Hello;


Let matrix A be nxn matrix. How to find modal matrix M, the modal matrix for the matrix A is the n × n matrix formed with the eigenvectors of A as columns in M? (D=M^-1*A*M, where D is dioganal matrix with the eigenvalues of A on the main diagonal of D)

For example;

restart;with(LinearAlgebra):
A := Matrix(2, 2, [-4, -2, 3, 1])

How to find M modal matrix?

 

I attempted to use convolution in AudioTools to convolve 2 vectors with arbitrary values, but could not since the operation is expecting numeric values.  Can this be done?    Is there not a convolution operastor in the LinearAlgebra package?  See attached:

convolutionWithAu[1].mw

1 2 3 4 5 6 7 Page 1 of 8