0

I want to track specific eigenvalues belonging to some matrix using Matlab. Say we have a matrix A = A(x) and I want to see what happens to specific eigenvalues of A as I move x in a loop.

The problem is that when using the Matlab eig function it seems that the eigenvalues are not 'consistently' placed in the output vector. I've created an example of the problem

clc
clear all
close all

xMin = 0;
xMax = 100;
Nx = 1001; % changed from 101 to 1001 to highlight 'continuous' eigenvalues
xRange = linspace(xMin, xMax, Nx);

for ix=1:Nx
    x = xRange(ix) + 1i;
    A = [ cos(x)-sin(-x), 1; 1 cos(x)-exp(-x) ];
    e = eig(A);
%     e = e(1); uncomment this
    figure(1);
    hold on
    grid on
    scatter(real(e), imag(e));
end

If you run this code you will see a plot featuring two distinct eigenvalues. Now if you uncomment the commented line above so as to focus on and plot a specific eigenvalue you will see that the focus 'jumps' from one eigenvalue to the other at some point. So how can you focus on and plot just a single eigenvalue?

sonicboom
  • 4,928
  • 10
  • 42
  • 60
  • for a 2x2 matrix, it is easy to track the eigenvalue using an analytic expression, is that what you want, or something more generic? Also, "tracking" an eigen-value assumes that the your matrix changes adiabatically. Do you know that is the case in your problem? – bla Feb 25 '16 at 20:22
  • The real world matrix I'm dealing with is at least 128x128. I know from plotting all the eigenvalues simultaneously (and zooming in on various regions) that they change continuously...however I want to just focus on individual eigenvalues instead of multiple ones that overlap in various places as its too hard to make out what's going on when you have that many eigenvalues in a plot. – sonicboom Feb 25 '16 at 20:34
  • you haven't addressed the adiabatic argument. There's not much sense tracking them if the rate of change is not slow enough (hence the adiabatic approximation) – bla Feb 25 '16 at 20:38
  • I'm not familiar with the term adiabatic in this context. Well by changing continuously I mean changing slowly. Actually the Nx in the above example is too small..if you change it to 1001 you will see the slow change in eigenvalues on each iteration. As regards the real world problem, I can some in very close on any of them and see clearly which one is which...I'm losing out on the bigger picture by having into zoom into such small regions. But if I zoom out I can't tell which one is which. – sonicboom Feb 25 '16 at 20:54
  • so what you really want is a tracking mechanism of some sort. Just note that there are pathologies where eigenvalues are redundant, and there's no "right" one to follow if they coalesce, also if the dynamics is not adiabatic (not necessarily by not being slow, there are other ways to break the adiabatic approximation) the new eigen values are not really realted to the old ones... I'll try and suggest a tracking algorythm in an answer... – bla Feb 25 '16 at 21:28
  • about the adiabatic theorem...(disregard the fact that it's from QM, it's all matrix algebra at the end of the day) https://en.wikipedia.org/wiki/Adiabatic_theorem – bla Feb 25 '16 at 21:38

1 Answers1

1

Without entering the discussion of mathematical validity (see my comments), a way to achieve what you want might be answered using so-called particle tracking schemes. For example, you can try implementing this simple particle tracker that is available from the FEX, or more sophisticated options such as this, or this one. Obviously, your problem is somewhat easier as there's no need to "detect" the particles using image processing etc, on the other hand you'll need to adapt the code to more dimensions...

bla
  • 25,846
  • 10
  • 70
  • 101