Real-time calculation of eigenvalues and eigenvectors

234 Views Asked by At

Are there ways to calculate eigenvalues and eigenvectors in real time for implementation on the control microprocessor?

I start from the questions that users helped me solve in the following topics:

https://mathematica.stackexchange.com/questions/207732/solve-the-vector-matrix-equation-minimize-the-length-of-the-desired-n-dimension/207752?noredirect=1#comment533606_207752

Smallest radius sphere intersect with the quadric surface

From these methods, the need arises for calculating the eigenvalues and vectors in real time to control some object.

1

There are 1 best solutions below

5
On BEST ANSWER

For 'real-time calculation' I understand that the algorithm has to be fast enough for real problem solutions involving short times. Because you are using a microcontroller, you should look for an algorithm in C.

There's a book called "Numerical Recipes in C" that has information on how to do this if you want to program it yourself. If you want to use LAPACK (Linear Algebra Package), actually the function DGEEV that computes that for you, you can take a look at the official documentation for it. It's written in Fortran, so you might want to re-write it or find it in C. Here you can find it written in C, and you can adapt it.


Apart from the apparent coding implementation of the algorithm that you are going to use, if you are interested in the mathematics behind eigenvectors and eigenvalue computation, several books explain it.

A few that I personally like are:

  • Golub and Van Loan - Matrix Computations. Chapter 7 starts with the unsymmetric eigenvalue problem and gives several methods that allow you to compute eigenvalues: Power Method, Orthogonal Iteration, QR and LR Iterations, etc.
  • Similar to that one, you have Demmel - Applied Numerical Linear Algebra, which I (personally) like more than the one above, but both are great. Chapter 4 also starts with the unsymmetric eigenvalue problem and how to approach it via direct methods.
  • Another good book would be Trefeten and Bau - Numerical Linear Algebra that approaches the eigenvalue problem in lecture 24, part 5.
  • Horn and Johnson - Matrix Analysis. It's more on the analysis side, so it may be more useful if you want to set a basis for a broader understanding of the algorithms.

Apart from that, because it's a coding problem, I would recommend that you take a look at Numerical Recipes in C. Also, BLAS and LAPACK could help you implement it.