How does Matlabs Symbolic Math Toolbox always finds an analytical eigendecomposition for arbitrary polynomial matrices?

조회 수: 6 (최근 30일)
Hi,
I am a bit confused about the inner working of the symbolic math toolbox.
I always thought the symbolic math toolbox does a calculation in the background and therefore provides an exact analytical result, or notifies the user that the solution is not analytical.
But how does the "eig(...)" function then comes up with an result for an arbitrary polynomial matrix?
THe following codes shows two options to calculate the eigenvalues of an arbitrary matrix A.
Option 1 uses eig(A), to directly calculate the analytical expression for the eigenvalues.
Option 2 first constructs the characteristic polynomial and then roots it.
The following example always produces an analytical solution for option 1. But does return a "root(...)" object for option 2. If I understand correctly, the "root(...)" is used by Matlab, in case the to-be-rooted polynomial can not be rooted analytically (Abel-Ruffini Theorem?).
For me this begs the question, is the eigenvalue polynomial from eig(...) truly analytic?
% Build a random matrix:
Nlayer = 3;
syms z lambda
for idex = 1:Nlayer
A(:,:)= rand(3,3)*z^idex;
end
% Option 1: Use eig() directly
opt1_ev= eig(A)
opt1_ev = 
% Option 2: root charpoly "by hand"
% Build characteristic Poly
charPoly = charpoly(A, 'lambda')
charPoly = 
% Root characteristic poly
opt2_ev = solve(charPoly == 0, lambda)
opt2_ev = 

채택된 답변

Torsten
Torsten 2024년 6월 27일
이동: Torsten 2024년 6월 27일
For me this begs the question, is the eigenvalue polynomial from eig(...) truly analytic?
What do you mean for a polynomial to be "truly analytic" ?
If the size of your matrix is <= 4x4, you can get analytical expressions for its eigenvalues if you use the symbolic approach.
If the size of the matrix is > 4x4, MATLAB uses numerical methods of root-finding for polynomials to numerically approximate the eigenvalues - both for the symbolic and the numerical approach.
  댓글 수: 1
Bastian Loß
Bastian Loß 2024년 6월 27일
Ah, you are correct. My example was badly choosen, as a 3x3 polynomial matrix is indeed analytically solvable.
If I am using a 5x5 or larger matrix, both approaches result in the exact same "root(...)" expression.
Nlayer = 3;
syms z lambda
for idex = 1:Nlayer
A(:,:)= rand(5,5)*z^idex;
end
In my mind, my question was aimed at a more general property of the symbolic math toolbox. As a followup, I will clarify in a seperate question, as this one has been answered.
Thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by