Items tagged with linearalgebra

Feed

hello. i want to write this function with  "for"loop. but i don't know
1.mw

How to write a code find fundamental matrix of the following Matrix?

restart; with(LinearAlgebra): A:=Matrix([[0, 1, 0, 0], [-a, 0, b, 0], [0, 0, 0, 1], [c, 0, -d, 0]]);eigenvectors(A);

where a,b,c,d∈IR.

I want to find eigenvalues and eigenvectors and then want to calculate e^( λ i)*ri  where λi's are eigenvalues, ri's are eigenvectors of A for i=1,2,3,4  respectively.

Then, I want to calculate Wronskian of the matrix which consists of vectors e^(λi)*ri in the columns. Could you help me?

See: Fundamental Matrix

hello . how can i get 7 given parameters(b1,a1,b1,a2,b2,.....) in this equation with maple. thanks

 

 

 

1.mw

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?