# Items tagged with eigenvalueseigenvalues Tagged Items Feed

### Eigenvalues of a huge matrix...

January 20 2016
2 2

I faced a very large eigenproblem during my research. The square matrix under consideration is of size more than 2^30 times 2^30. I have tried to deal with this problem by the QR algorithm with double implicit shift (more precisely, the Francis double step QR algorithm). I'm a very beginner of programming, but I tried as follows:

--------------------------------------------------------------------------------------------------

A := Matrix([[7, 3, 4, -11, -9, -2], [-6, 4, -5, 7, 1, 12], [-1, -9, 2, 2, 9, 1], [-8, 0, -1, 5, 0, 8], [-4, 3, -5, 7, 2, 10], [6, 1, 4, -11, -7, -1]]):
H := HessenbergForm(A):
p:=6:
for p while p>2 do:
q:=p-1:
s:=H(q,q)+H(p,p):
t:=H(q,q)*H(p,p)-H(q,p)*H(p,q):
x:=(H(1,1))^(2)+H(1,2)*H(2,1)-s*H(1,1)+t:
y:=H(2,1)*(H(1,1)+H(2,2)-s):
z:=H(2,1)*H(3,2):
for k from 0 to p-3 do:
V:=Vector([x,y,z]):
P:=Transpose(HouseholderMatrix(1/(Norm(V+exp(argument(V(1))*I)*Norm(V,2)*Vector(3,shape=unit[1]),2))*(V+exp(argument(V(1))*I)*Norm(V,2)*Vector(3,shape=unit[1])))):
r:=max(1,k):
H[k+1..k+3,r..6]:=MatrixMatrixMultiply(Transpose(P),SubMatrix(H,[k+1..k+3],[r..6])):
r:=min(k+4,6):
H[1..r,k+1..k+3]:=MatrixMatrixMultiply(SubMatrix(H,[1..r],[k+1..k+3]),P):
x:=H(k+2,k+1):
y:=H(k+3,k+1):
if k<3 then z:=H(k+4,k+1):
end if:
od:
P:=GivensRotationMatrix(Vector([x,y]),1,2):
H[q..p,p-2..6]:=MatrixMatrixMultiply(Transpose(P),SubMatrix(H,[q..p],[p-2..6])):
H[1..p,p-1,p]:=MatrixMatrixMultiply(SubMatrix(H,[1..p],[p-1,p]),P):
if abs(H(p,q))<10^(-20)*(abs(H(q,q))+abs(H(p,p))) then    H(p,q):=0: p:=p-1:q=p-1:
elif abs(H(p-1,q-1))<10^(-20)*(abs(H(q-1,q-1))+abs(H(q,q))) then    H(p-1,q-1):=0: p:=p-2:q:=p-1:
end if:  od:
--------------------------------------------------------------------------------------------------

It seemed that replacing 0 in a Hessenberg matrix by a non-zero element is not allowed. How can I remedy this?

Plus, can anyone tell me the problem of the above thing(it's not really a programming...;( ), please?

I would also appreciate it if someone let me know a better idea for a huge eigenproblem.

### Symbolic matrix calculus in Maple...

January 20 2016
1 1

Sorry for the uninformative title. I've never used Maple, but I'm willing to buy a student license and learn it. But before spending too much effort and money I need to know if it suits my needs.

Basically what I need to do is:

1) I have a positive definite symmetric matrix of size nxn, where n can range from 2 to inf. I don't know the elements, except the fact that the diagonal has ones everywhere. All I know is that the elements out of the diagonal are in the range [0,1)

2) I have to compute the lower triangular cholesky decomposition of this matrix, lets call it L.

3) I need to subtract from each element of L the mean of the elements in the respective column. Lets call this matrix L*

4) Then I need to evaluate another nxn matrix computed from the elements of L* following a simple pattern.

5) Finally I need to find the eigenvalues of this last matrix.

What I would ideally want is to get a symbolic representation of the n eigenvalues as symbolic functions of the (unknown) elements of the matrix at point 1.

I can drop the assumption of n being unknown, i.e. fix n=3 and get the 3 functions that, after replacing the right values, give me the eigenvalues, then fix n=4 and get 4 functions, etc.

Is this possible to do in maple?

Thank you

### Use Eigenvalues, not fsolve@Determinant...

January 18 2016 Maple 18
4
5

There has been a spate of Questions posted in the past week about computing eigenvalues. Invariably, the Questioners have computed some eigenvalues by applying fsolve to a characteristic polynomial obtained from a floating-point matrix via LinearAlgebra:-Determinant. They are then surprised when various tests show that these eigenvalues are not correct. In the following worksheet, I show that the eigenvalues computed by the fsolve@Determinant method (when applied to a floating-point matrix) are 100% garbage for dense matrices larger than about Digits x Digits. The reason for this is that computing the determinant introduces too much round-off error into the coefficients of the characteristic polynomial. The best way to compute the eigenvalues is to use LinearAlgebra:-Eigenvalues or LinearAlgebra:-Eigenvectors. Furthermore, very accurate results can be obtained without increasing Digits.

 The correct and incorrect ways to compute floating-point eigenvalues Carl Love 2016-Jan-18 restart: Digits:= 15: macro(LA= LinearAlgebra): n:= 2^5:  #Try also 2^3 and 2^4. A:= LA:-RandomMatrix(n): A is an exact matrix of integers; Af is its floating-point counterpart. Af:= Matrix(A, datatype= float[8]): P:= LA:-CharacteristicPolynomial(A, x): P is the exact characteristic polynomial with integer coefficients; Pf is the floating-point characteristic polynomial computed by the determinant method. Pf:= LA:-Determinant(Af - LA:-DiagonalMatrix([x\$n])): RP:= [fsolve(P, complex)]: RP is the list of floating-point eigenvalues computed from the exact polynomial; RPf is the list of eigenvalues computed from Pf. RPf:= [fsolve(Pf, complex)]: RootPlot:= (R::list(complexcons))->      plot(           [Re,Im]~(R), style= point, symbol= cross, symbolsize= 24,           axes= box, color= red, labels= [Re,Im], args[2..]      ) : RootPlot(RP); RootPlot(RPf); We see that the eigenvalues computed from the determinant are completely garbage. The characteristic polynomial might as well have been x^n - a^n for some positive real number a > 1.   Ef is the eigenvalues computed from the floating-point matrix Af using the Eigenvalues command. Ef:= convert(LA:-Eigenvalues(Af), list): RootPlot(Ef, color= blue); We see that this eigenvalue plot is visually indistinguishable from that produced from the exact polynomial. This is even more obvious if I plot them together: plots:-display([RootPlot(Ef, color= blue), RootPlot(RP)]); Indeed, we can compare the two lists of  eigenvalues and show that the maximum difference is exceedingly small.   The following procedure is a novel way of sorting a list of complex numbers so that it can be compared to another list of almost-equal complex numbers. RootSort:= (R::list(complexcons))-> sort(R, key= abs*map2(`@`, signum+2, Re+Im)): max(abs~(RootSort(RP) -~ RootSort(Ef)));

November 15 2015
0 7

### How to select eigenvalue?...

November 09 2015
0 3

Hi Mr Preben Alsholm .

for determine unknown parameter oemega(or eigenvalue) according to line ''newsys2 := subs(omega^2 = omega2*10^5,newsys)'' and also line ''approxsoln = [omega2 = 1, f(x) = x^2*(1-x)^2]''

power (5) in term'' 10^5''  in  (omega2*10^5,newsys) and initial guess (1)  (omega2 = 1) are very effective on final result eigenvalues .sometimes gain different eigenvalues ,which it is not impossible recognize that

which one is correct and convege.however i need Positive

eigenvalue that is minimum between them,If and only if , it converge after
some iteration in two section of maple file which is attached as
Eigenvalue.mw

According to my code converge occuerd until  eigenvalue gained in first section (before line `11` := ((1+6*alpha2)*(1/12))*(int(fy11^2, x = 0 .. 1))...........) are equal with those obtain in second section .(please see below file for example for_example.mw)

it is necessary mention that between section 1 and 2 is relations.for example amont of first obtained eigenvalue which obtain from first section must be repleaced in line ''approxsoln = [omega2 = 0.661514014001420, h(theta) = theta^2*(1-theta)^2]...........''in second section,

and this procedure should be continued between section 1 and 2 until convergence with desired accuracy occurred.Another relate is that,the first ODE system  can be solved using the first set of boundary data to obtain first estimate for  second section (fy11). At the next step by repeating in the same manner,

this time by obtained function (g) at the end of maple code (Solution of the second ODE system  with second set of boundary conditions leads to the first estimate of function g),that at this stage, the first iteration is completed.

Now by replacing omega2 which is determined in this section in to the first section ,fy11 is updated and gained Further.

Next, the updated function , by continuing the iterative procedure.

in matlab bvp4c rule is used for this purpose.is this impossible in maple software ?if not please help me for solve and gain correct omega..

thanks alot

### How to find k-th root of the given matrix over fin...

April 16 2015
1 20

Hi EveryOne!

In the the answer of the question "How to find roót of polynomial in finite field and extension finite field (at URL: http://www.mapleprimes.com/questions/203977-How-To-Find-Roots-Of-Polynomial-In-Finite#answer215097). Carl Love helped compute eigenvalues (x1,x2,...,xn)and eigenvectors of the given matrix M over GF(28)/(y^8+y^4+y^3+y+1).

I need to do:

1. Get matrix D from these eigenvalues (x1,x2,...,xn), with D[i,i] = xi and D[i,j≠i] = 0 (D will be diagonalizable matrix. Some xi may be in extension finite field  GF((28)2))

2. Get matrix P from eigenvectors corresponding to the above eigenvalues, compute P-1

3. Compute matrix B = P x D1/4 x P-1 in  extension finite field  GF((28)2).

### How do I find a condition on a characteristic equa...

March 12 2015
0 5

I have the following characteristic equation by use of maple. How do I find a condition on x, that will return real eigenvalues and complex eigenvalues?

### How do I find a condition for eigenvalues of a 50 ...

March 03 2015
2 2

So here is the issue: I have a 50 by 50 tridiagonal matrix. The entries in the first row, first column are -i*x and the last row last column is -i*x; these are along the main diagonal, where i is complex and x is a variable. Everything in between these two entries is 0. Above and below the main diagonal the entries are -1. My issue is that I have to find a conditon on x that makes the eigenvalues real. I am completely new to maple and have no programming experience.. Can someone show me how to this?

### Orthogonal, rotational matrices...

February 22 2015
0 1

I've got the following matrix :

A:=[<a,a-1,-b>|<a-1,a,-b>,<b,b,2a-1>] where <> are the column elements of A, a is  a real number defined on [0,1] and b^2=2a(1-a)

a) to show A is an orthogonal matrix, I understand that I need A.Transpose(A)=Identity(3*3) but is there a way in which I can let a take a random real numbered value between 0 and 1? The rand() only returns an integer within a range. Directly multiplying A and Transpose(A) will return an expression in a, so what's the right approach?

b) from a) we can infer that A is a matrix that describes a rotation in e1,e2,e3 where these are the standard bases vectors in R3. How can I determine the rotation axis? The hint I've been given says I need to consider the Eigenvalues and eigen vectors but I don't quite understand how.

### Analyzing a differential equation system with vary...

January 02 2015
0 5

Hi there,
I have a set of differential equations whose solution, Jacobian matrix and its eigenvalues, direction field, phase portrait and nullclines, need to be computed.

Each of the equations has a varying parameter.

I know how to get the above for a single parameter value, but when I set a range of values for the parameters, Maple is not able to handle all cases as I would expect: solving the differential equation system:

eq1 := x*(1.6*(1-(1/100)*x)-phi*y)
eq2 := (x/(15+x)-0.3e-1*x-.4)*y+.6+theta
desys := [eq1, eq2];
vars := [x, y];

Error, (in unknown) invalid input: Utilities:-SetEquations expects its 2nd argument, equations, to be of type set({boolean, algebraic, relation}), but received {-600*y+(Array(1..2, {(1) = 8400, (2) = 15900})), Array(1..5, {(1) = 0, (2) = 0, (3) = 0, (4) = 0, (5) = 0})}

The equations are the following:
de1 := diff(x(t), t) = x(t)*(1.6*(1-(1/100)*x(t))-phi*y(t));
de2 := diff(y(t), t) = (x(t)/(15+x(t))-0.3e-1*x(t)-.4)*y(t)+.6+theta

the parameters being:
phi:=[0 0.5 1 1.5 2]
theta:=[5. 10.]

How can I handle the situation so that Maple computes each of the above for each combination of the parameters?

I would like to avoid using two for loops and having to store all results in increasingly bigger and complicated arrays.

The worksheet at issue is this: MaplePrimes_Tumour_model_phi_theta_variation.mw

Thanks,
jon

### Loop over a set of lists...

December 29 2014
0 2

Hi there,

I would like to have the Jacobian matrix of an ODE system evaluated, and their eigenvalues computed, at the steady states of the system.

I know how to get the Jacobian matrix evaluated and the eigenvalues computed on an individual basis, setting manually each steady state as the argument of the matrix.

However, I would like to have it in a loop, so that the loop manages all steady states, that is:

steadyStates:= solve(mySystem); # would yield a set of pairs/lists

m:=Jacobian(steadyStateN); # evaluate the Jacobian matrix

ev:= eigenvals(m); # compute the eigenvalues and save them to another variable/array and print them

end for:

First, I am not to find a way to loop over my steadyStates.

Attached is an example where the Jacobian matrix and eigenvalues are computed individually, where the steady states have been hard-coded once they have been computed: MaplePrimes_Predator_prey_model_Jacobian.mw

Any ideas on how to do this?

Thanks,

jon

### Computing eigenvalues with assumptions...

December 07 2014
1 6

I am trying to simplify the eigenvalues of a 2x2 matrix [[a,b],[c,d]] subject to the condition a,b,c, and d are integers such that a+b = c+d. Why do the following commands not achieve this?

with(LinearAlgebra):

A:=Matrix[[a,b],[c,d]]):

Eigenvalues(A) assuming a::integer,b::integer,c::integer,d::integer,a+b=d+c

How might I achieve what I need?

### Very bad Eigenvalues(...) rounding errors? Solved....

October 08 2014
0 1

Hello,In short: I try to get the eigenvalues of a 16x16 complex matrix with one variable B__z. I know, the vales are very small (~10^-24), so I multiply with 10^24 and collect B__z. Now, when I use Eigenvalues(H) [H is the matrix] the result is just wrong:

test.mw

(same with original values) - compared to Mathematica which solves and plots in about 1 sec:

Where is the problem? What should I do? Any suggestions?

### How to calculate eigenvalues of complex symbolic M...

October 08 2014
1 4

Hello,

first of all, this is my very fist question in this forum, so please excuse some formal mistakes I may make...

Using Maple 18.01 on Windows 7 64bit

To the topic: I want to calculate the eigenvalues of a complex matrix like this (just as an example):

M := Matrix(2, 2, {(1, 1) = a+2.5*I, (1, 2) = 1-I*a, (2, 1) = 4, (2, 2) = a})

When I try to calculate

Eigenvalues(M)

I get

Error, (in LinearAlgebra:-Eigenvalues) expecting either Matrices of rationals, rational functions, radical functions, algebraic numbers, or algebraic functions, or Matrices of complex(numeric) values

Strange, because if I replace the "2.5" with just "2", so an integer instead of a float, I get results:

I don't understand this strange behavior, since Mathematica i.e. calculates everything just fine...:

Thanks in advance for any suggestions.

### Eigenvectors of a big matrix...

August 18 2014
1 5

Hi there

I have have a 18*18 matrix which almost each of its element are in symbolic form. Now I need to have all of its eigenvectors. Unfortunately when I use the "Eigenvalues()" function in maple i got nothing. In fact I got the error which comes below.

Error, (in content/polynom) general case of floats not handled

I need to know if there's a solution to eliminate the error? If not, what can I do to determine the eigenvectors and eigenvalues in symbolic form?