Finding the Smallest Eigenvalue with Power Iteration in MatLab

  • Context: MATLAB 
  • Thread starter Thread starter liquidFuzz
  • Start date Start date
  • Tags Tags
    Eigenvalue Matlab
Click For Summary

Discussion Overview

The discussion revolves around finding the smallest eigenvalue of a matrix using power iteration in MATLAB, specifically without relying on the built-in eig() function. Participants explore various approaches and challenges related to implementing this method.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant seeks guidance on finding the smallest eigenvalue without using eig(), indicating a desire to understand the underlying process better.
  • Another participant notes that their current implementation computes the largest eigenvalue and suggests a need to modify the code to find the smallest eigenvalue.
  • A different participant provides a method to find the smallest eigenvalue by first computing all eigenvalues with eig(A) and then using min() to extract the smallest value, while also noting potential issues with complex numbers.
  • One participant expresses confusion regarding the output of min() when applied to a matrix with complex numbers, highlighting discrepancies between the results of min() and comparisons using the less-than operator.
  • Another participant mentions their efforts to set up a power iteration method, indicating uncertainty about how to implement inverted power iteration to find the smallest eigenvalue.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to find the smallest eigenvalue without using eig(). There are multiple competing views and methods discussed, with some uncertainty expressed regarding the handling of complex numbers.

Contextual Notes

There are limitations regarding the assumptions made about the nature of eigenvalues, particularly in the context of complex versus real numbers, and the discussion does not resolve the mathematical steps involved in implementing the inverted power iteration.

Who May Find This Useful

Individuals interested in numerical methods for linear algebra, particularly those looking to implement eigenvalue algorithms in MATLAB without relying on built-in functions.

liquidFuzz
Messages
107
Reaction score
6
I'm tinkering with a code snippet where a part finds eigenvalues.
Code:
eig(A);
The thing is, I tried to do it not using eig() to grasp this and got stuck. Could anyone shed some light on this..? How do I find the smallest eigenvalue?
 
Physics news on Phys.org
Hmm... I might be a little bit closer. This seems to compute the biggest eigenvalue.
Code:
    while (abs(lambda - lambda_old) > tol)
        lambda_old = lambda;
        lambda = y'*A*z/norm(z, 2);   %this part should be altered to compute the smallest.
    end
 
d = eig(A) returns a vector of the eigenvalues of matrix A (notice, I'm assigning it to 'd')

to find the smallest value in a vector:

smallest = min(d)

so, all you really have is:

Code:
d = eig(A)
sm = min(d)

where sm is the smallest eigenvalue.
Not quite what MATLAB calls the smallest when mixing complex numbers with real numbers.
 
ok, weird... so:

according to min, the first entry in A is the "smallest"
Code:
A =

  1.000000000000000 + 1.000000000000000i
 -1.000000000000000 + 1.000000000000000i

>> min(A)

ans =

  1.000000000000000 + 1.000000000000000i

but according to the lessthan sign, the second entry is the "smallest"

Code:
 >> if A(1) < A(2)
dips('YES')
end
>>if A(2) < A(1)
disp('YES')
end
YES
 
I'm trying to set up a power iteration - not using eig(). I'm pretty sure I get the power iteration right, but the inverted power iteration to get the smallest..?
 

Similar threads

  • · Replies 32 ·
2
Replies
32
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
5K
Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
11
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K