Eigenvalues and eigenvectors

Ax = b is a linear equation which emerges from static problems. Eigenvalues, on the other hand, are used for dynamic problems. Let's consider A as a matrix with x as a vector; we will now solve the new equation in linear algebra, Ax= λx.

As A multiplies x, the vector x changes its direction. But there are certain vectors in the same direction as Ax-these are known as eigenvectors, for which the following equation holds good:

Ax= λx

In the last equation, vector Ax is lambda times the vector x, and λ is known as eigenvalue. Eigenvalue λ gives the direction of a vector-if it is reversed, or is in the same direction.

Ax= λx also conveys that det(A - λI) = 0, where I is the identity matrix. This determines n eigenvalues.

The eigenvalue problem is defined as follows:

A x = λ x

A x-λ x = 0

A x-λ I x = 0

(A-λ I) x = 0

If x is non-zero, the preceding equation will have a solution only if |A-λ I| = 0. Using this equation, we can find eigenvalues.

val A = DenseMatrix((9.0,0.0,0.0),(0.0,82.0,0.0),(0.0,0.0,25.0)) 
val es = eigSym(A)
val lambda = es.eigenvalues
val evs = es.eigenvectors
println("lambda is : " + lambda)
println("evs is : " + evs)

This last code gives us the following result:

lambda is : DenseVector(9.0, 25.0, 82.0)
evs is : 1.0 0.0 0.0
0.0 0.0 1.0
0.0 1.0 -0.0