1

I have created a matrix of potentials for a particle in a square well. When I take the eigenvectors of the matrix, I get mirror images for the first few (about 10) vectors. For example, the first eigenvector is a postive hump but there is also a negative mirror hump underneath. I looked at the output of the first few vectors and it appeared that the sign of the number was merely changing back and forth from positive to negative. For later vectors this is not the case so I cannot just plot every other point of the vectors. I am using the following command to plot eigenvectors.

[V,D] = eig(A);

I do not see imaginary numbers in my output. However, it has been suggested to me that MATLAB may be trying to plot the real and imaginary components of the eigenvectors. I found the following command on this site and thought it would fix my problem assuming my problem is in fact that the real and imaginary components are not being plotted.

A1 = real(V*real(D)/V);

then I plot:

[V,D] = eig(A1);

Nothing has changed and I am confused as to whether I am correctly plotting the real eigenvalues or if there is something else causing these mirror images. Help!

Floern
  • 33,559
  • 24
  • 104
  • 119
  • 1
    Use the command `isreal` to see if any of the elements in your eigenvalues and eigenvectors is really complex. Other than that I have no idea what's going on. – rayryeng May 19 '14 at 01:12
  • 1
    If you ask Matlab to plot something with real and imaginary components, it will plot the real parts, and give a warning that it is ignoring the imaginary parts. If you can give more information (a matrix that reproduces the problem, the eigenvectors, or a picture of the resulting plot) it might help. – David May 19 '14 at 01:18
  • 1
    @David: That's not entirely true as `plot(Y)` in the case when `Y` is complex is equivalent to `plot(real(Y),imag(Y))`. However, the OP needs to clarify what he/she means by "plot", as the `eig` function does not plot as the question implies, but rather prints. I think that may be what is actually meant. – horchler May 19 '14 at 01:40
  • 1
    @horchler yep good point. I should wait until I know what the OPs question really is. – David May 19 '14 at 01:44
  • 1
    @user3650942: I'm confused about what this question is actually asking. There is not sufficient information to understand what is going on. Please indicate what you mean by "plot." A [small example with runnable code](http://stackoverflow.com/help/mcve) would go a long ways in terms of us being able to help you. Is the issue perhaps related to the [ordering of the eigenvalues/vectors](http://stackoverflow.com/q/13704384/2278029) returned by `eig` or the fact that the [arbitrary signs of of the eigenvectors switch](https://www.mathworks.com/matlabcentral/newsreader/view_thread/306717)? – horchler May 19 '14 at 01:54
  • 2
    Symmetric real matrics don't have imaginary eigenvalues: http://en.wikipedia.org/wiki/Symmetric_matrix. There's something else going on here. – duffymo May 19 '14 at 12:41

1 Answers1

0

Real symmetric matrices have always only real eigenvalues and orthogonal eigenspaces, i.e., one can always construct an orthonormal basis of eigenvectors.

If your physical system has a spacial symmetry, for instance if you can mirror it about some symmetry axis such that the physics of both systems is the same, then this symmetry is also reflected in the eigenspaces, they will always have even dimension and you can either construct odd and even symmetric eigenvectors or pairs of eigenvectors that are mirror images of each other.

To say more one needs more details about your problem.

Lutz Lehmann
  • 25,219
  • 2
  • 22
  • 51