Get eigenvalues of symbolic matrix

I want to get the symbolic eigenvalues from a 8x8 symbolic matrix. But after I used the eig(A) function, Matlab ran for a while and returned a very very very long expression begin with "RootOf{..." which I believed meant no solution. Here is the code.
syms t1 t2 t11 t22 t3 t33 t4 t44;
syms H;
syms kx ky;
a=1.05*pi/180;
v=0.3;
w=0.11;
d=4*pi/(3*2.46);
H=[-v/2 t1 w w w*exp(-i*2*pi/3) w w*exp(i*2*pi/3) w;t11 -v/2 w w w*exp(i*2*pi/3) w*exp(-i*2*pi/3) w*exp(-i*2*pi/3) w*exp(i*2*pi/3);w w v/2 t2 0 0 0 0;w w t22 v/2 0 0 0 0; w*exp(i*2*pi/3) w 0 0 v/2 t3 0 0; w*exp(-i*2*pi/3) w*exp(i*2*pi/3) 0 0 t33 v/2 0 0; w*exp(-i*2*pi/3) w 0 0 0 0 v/2 t4; w*exp(i*2*pi/3) w*exp(-i*2*pi/3) 0 0 0 0 t44 v/2 ];
dd=eig(H);
Can anyone give me a hint the way to calculate the symbolic eigenvalues of the matrix "H"? And how long will it take? My ultimate goal is to plot the 8 eigenvalues in the range of kx=[-1:0.1:1] and ky=[-1:0.1:]. Thanks very much.

 Accepted Answer

The RootOf() was probably a valid part of the solution. MuPAD sometimes expresses even square-roots as RootOf()
Maple took approximately 1 second to find the eigenvalue formula. The eigenvalues are the roots of an 8th order polynomial in your t* variables.
Internal note: in Maple format, the matrix is
eval(`<,>`(`<|>`(-(1/2)*v, t1, w, w, w*exp(-2*i*pi*(1/3)), w, w*exp(2*i*pi*(1/3)), w), `<|>`(t11, -(1/2)*v, w, w, w*exp(2*i*pi*(1/3)), w*exp(-2*i*pi*(1/3)), w*exp(-2*i*pi*(1/3)), w*exp(2*i*pi*(1/3))), `<|>`(w, w, (1/2)*v, t2, 0, 0, 0, 0), `<|>`(w, w, t22, (1/2)*v, 0, 0, 0, 0), `<|>`(w*exp(2*i*pi*(1/3)), w, 0, 0, (1/2)*v, t3, 0, 0), `<|>`(w*exp(-2*i*pi*(1/3)), w*exp(2*i*pi*(1/3)), 0, 0, t33, (1/2)*v, 0, 0), `<|>`(w*exp(-2*i*pi*(1/3)), w, 0, 0, 0, 0, (1/2)*v, t4), `<|>`(w*exp(2*i*pi*(1/3)), w*exp(-2*i*pi*(1/3)), 0, 0, 0, 0, t44, (1/2)*v)), [i = I, pi = Pi, a = (1/180)*(105/100)*Pi, v = 3/10, w = 11/100, d = 4*Pi/(3*246/100)])
======
Using your full equations as per email:
Working here because it is not possible to format comments:
Maple:
vars := [a = (1/180)*(105*(1/100))*Pi, v = 3/10, w = 11/100, d = 4*Pi/(3*(246*(1/100))), t1 = 3*(d*cos((1/2)*a)+kx-I*(d*sin((1/2)*a)+ky)), t11 = 3*(d*cos((1/2)*a)+kx+I*(d*sin((1/2)*a)+ky)), t2 = 3*(d*cos((1/2)*a)+kx-I*(d*sin(-(1/2)*a)+ky)), t22 = 3*(d*cos((1/2)*a)+kx+I*(d*sin(-(1/2)*a)+ky)), t3 = 3*(d*cos(2*Pi*(1/3)-(1/2)*a)+kx-I*(d*sin(2*Pi*(1/3)-(1/2)*a)+ky)), t33 = 3*(d*cos(2*Pi*(1/3)-(1/2)*a)+kx+I*(d*sin(2*Pi*(1/3)-(1/2)*a)+ky)), t4 = 3*(d*cos(4*Pi*(1/3)-(1/2)*a)+kx-I*(d*sin(4*Pi*(1/3)-(1/2)*a)+ky)), t44 = 3*(d*cos(4*Pi*(1/3)-(1/2)*a)+kx+I*(d*sin(4*Pi*(1/3)-(1/2)*a)+ky)), we3 = w*exp(-(1/3)*(I*2)*Pi)]; H := `<,>`(`<|>`(-(1/2)*v, t1, w, w, we3, w, we3, w), `<|>`(t11, -(1/2)*v, w, w, we3, we3, we3, we3), `<|>`(w, w, (1/2)*v, t2, 0, 0, 0, 0), `<|>`(w, w, t22, (1/2)*v, 0, 0, 0, 0), `<|>`(we3, w, 0, 0, (1/2)*v, t3, 0, 0), `<|>`(we3, we3, 0, 0, t33, (1/2)*v, 0, 0), `<|>`(we3, w, 0, 0, 0, 0, (1/2)*v, t4), `<|>`(we3, we3, 0, 0, 0, 0, t44, (1/2)*v));
HH := eval(eval(H,vars),vars);
dd := LinearAlgebra[Eigenvalues](HH);
I am waiting for the results at the moment.

6 Comments

Thank you very much! But I'm still a little confused, since I know nothing about Maple. In my computer, the eig() function took about 1 minute to get a result. And when I defined a kx and ky, such as kx=-pi, ky=-pi, and trid eval(dd(1)), I waited for thirty minutes and the Matlab was still 'busy'.
From this and your answer, does it mean that I should perform this in Maple other than Matlab?
P.S. the t* variables are functions of a,d,kx and ky
I do not have the symbolic toolbox for MATLAB, so I am unable to experiment with the MATLAB performance.
If you have provided full functions for your t* variables, then it might be the case that the calculation would take longer, especially in the section of trying to find analytic solutions to the roots.
If you provide the fuller expressions in symbolic form, I could test using Maple.
Please note that a number of the roots are likely to be complex, but that exactly _which_ of the roots are complex might vary as kx and ky vary. In order to plot meaningfully, you need to define more clearly what you want to have happen with the complex roots and what you want to have happen as different roots go in or out of being complex.
Thank you very much!
I emailed you the full expressions in symbolic form. Sorry for the inconvenience. Yes, it may result in complex values. And when it happens, I just want to plot the real part of them. If it can work in maple, would you please tell the time it takes? Then I will obtain Maple software and learn how to use it. Thank you so much!
I cut off the full Maple symbolic computation after about 16 minutes when it had gone through all my available memory. (My testbed is a 4 GHz P4, no hyperthreads, no cores, older slower internal architecture.)
When I substituted specific kx and ky values and told Maple to switch from symbolic computations to hardware floating point, the eigenvector computation was less than 1/100 cpu seconds.
Unfortunately my attempt to plot over an area has gummed up my display and provoked a Maple bug, so I better go report that...
OK. Thank you all the same. I will turn to solve the problem in a numeric way. Sorry for taking you so long time.
No problem. Writing up the bug report took longer than the plot computation did.
I might be able to play with it a bit more at home.

Sign in to comment.

More Answers (1)

Ayesha Idrees
Ayesha Idrees on 14 Jun 2022

2 Comments

Find eigen values of this jacobian matrix?
To be honest, I am not going to bother typing that matrix in.

Sign in to comment.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!