0

I have a symbolic 6x6 matrics that I must find eigenvalues and plot them. I can't plot and I don't know what can I do.

    syms t H t1 t2 E1 E2 E3 E4 E5 E6 HH H1 v d H2 k a E;


t1=1;
t2=1.5*t1;
a=3;

H=[0 t2 0 0 0 t1  
    t2 0 t1 0 0 0
    0 t1 0 t2 0 0
    0 0 t2 0 t1 0
    0 0 0 t1 0 t2
    t1 0 0 0 t2 0];

H1=[0 0 0 0 0 0
    0 0 0 0 0 0
    0 0 0 0 0 0
    t1*exp(1i*k*a) 0 0 0 0 0
    0 0 0 0 0 0
    0 0 0 0 0 0];

H2=[0 0 0 t1*exp(1i*k*a) 0 0
    0 0 0 0 0 0
    0 0 0 0 0 0
    0 0 0 0 0 0
    0 0 0 0 0 0
    0 0 0 0 0 0];

HH=H+H1+H2;

E=eig (HH)

I can't run the [v,D]=eig(HH)
and I don't kno how to plot 6 different E(K) function

sorry for poor english and ppor knowledge of matlab and thanks for help!

Rick Smith
  • 9,031
  • 15
  • 81
  • 85

1 Answers1

0

I ran your code, and was able to do

[v,D]=eig(HH)

The diagonal values found in D will be your eigenvalues. Since you don't specify exact values for k, the output is too long to post here, but here is an example using only first matrix H:

syms t H t1 t2 E1 E2 E3 E4 E5 E6 HH H1 v d H2 k a E;


t1=1;
t2=1.5*t1;
a=3;

H=[0 t2 0 0 0 t1  
   t2 0 t1 0 0 0
   0 t1 0 t2 0 0
   0 0 t2 0 t1 0
   0 0 0 t1 0 t2
   t1 0 0 0 t2 0];

HH=H+H+H;

[v,D]=eig(HH)

Output:

v =

-0.4082   -0.2485   -0.5211    0.1548   -0.5562    0.4082
 0.4082    0.5290    0.2312   -0.2471   -0.5218    0.4082
-0.4082   -0.3271    0.4758   -0.5591    0.1441    0.4082
 0.4082   -0.0642   -0.5738   -0.3283    0.4749    0.4082
-0.4082    0.5756    0.0453    0.4043    0.4121    0.4082
 0.4082   -0.4648    0.3425    0.5754    0.0469    0.4082

D =

-7.5000         0         0         0         0         0
      0   -3.9686         0         0         0         0
      0         0   -3.9686         0         0         0
      0         0         0    3.9686         0         0
      0         0         0         0    3.9686         0
      0         0         0         0         0    7.5000

If you are trying to plot eigenvalues for varying values of k, my suggestion is to make a loop: Calculate the eigenvalues of HH for each value of k, and store these values into arrays. From there the plot should be pretty straightforward.

MATLAB documentation on plotting

Jacob Shanley
  • 893
  • 1
  • 8
  • 19