Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'matrix symbolic eigenvalues' topicStudent Support Forum > General > Archives > "matrix symbolic eigenvalues"

Help | Reply To Topic
Author Comment/Response
02/22/13 10:26am

I am calculating eigenvalues of a set of M matrices which depend on a set of parameters (omegac, delta, G, J; G, J are left unspecified till the end) defined by:

M = 11;
omegac = 10;
HA = SparseArray[{Band[{1, 1}] -> omegac, Band[{2, 1}] -> -J,
Band[{1, 2}] -> -J}, {M, M}];
delta = 0;
omegaq = delta + omegac;

HAqn = Table[PadRight[HA, {M + n, M + n}], {n, 1, M}];

Do[HAqn[[j, M + n, M + n]] = omegaq, {j, 1, M}, {n, 1, j}];

Do[HAqn[[j, n, M + n]] = G, {j, 1, M}, {n, 1, j}];
Do[HAqn[[j, M + n, n]] = G, {j, 1, M}, {n, 1, j}];

EnAqn = Table[Eigenvalues[HAqn1[[n]]], {n, 1, M}];

The first M diagonal elements are omegac; the second M elements are omegaq. the matrix HAqn[[1]] has dimensions M+1, M+1; the HAqn[[2]] has dimensions M+2, M+2 etc.

i would like to calculate the eigenvalues of these M matrices as a function of the parameter J for fixed parameter G, for example G=1.

i then write:

Plot[EnAqn[[1]], {t, 0, 2}, PlotRange -> {-3, 3},
AxesLabel -> {J/g, (\[Omega] - Subscript[\[Omega], c])/g},
AxesOrigin -> {0, -3}]

for the eigenvalues of HAqn[[1]] and so on. the thing is i get wrong results!!!!! i really do not understand why.
if i substitute a value of J already in the matrices and then calculate the eigenvalues the results are correct!! so i don't understand why assigning the value afterwards is wrong, as if the calculation of the eigenvalues with unspecified parameters would be wrong.

any help would be great!!!
Many many thanks!!!!!!!!!!!

URL: ,
Help | Reply To Topic