How does Matlabs Symbolic Math Toolbox always finds an analytical eigendecomposition for arbitrary polynomial matrices?
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);
% Option 2: root charpoly "by hand"
% Build characteristic Poly
charPoly = charpoly(A, ‘lambda’);
% Root characteristic poly
opt2_ev = solve(charPoly == 0, lambda);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);
% Option 2: root charpoly "by hand"
% Build characteristic Poly
charPoly = charpoly(A, ‘lambda’);
% Root characteristic poly
opt2_ev = solve(charPoly == 0, lambda); 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);
% Option 2: root charpoly "by hand"
% Build characteristic Poly
charPoly = charpoly(A, ‘lambda’);
% Root characteristic poly
opt2_ev = solve(charPoly == 0, lambda); symbolic-math, eigenvalues, polynomial-matrices MATLAB Answers — New Questions