# Trying to determine roots of this polynomial (Det)

6 vues (au cours des 30 derniers jours)
Joseph Slattery le 16 Avr 2024
Commenté : Joseph Slattery le 16 Avr 2024
k = [1750 -750 0; -750 1250 -500; 0 -500 500];
m = [75 0 0; 0 75 0; 0 0 50];
D=inv(m)*k;
syms x
I = [x,0,0;0,x,0;0,0,x];
Lambda = D-I;
DET = det(Lambda);
eqn = DET==0;
sol = root(eqn,3)
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponses (3)

John D'Errico le 16 Avr 2024
Modifié(e) : John D'Errico le 16 Avr 2024
k = [1750 -750 0; -750 1250 -500; 0 -500 500];
m = [75 0 0; 0 75 0; 0 0 50];
D=inv(m)*k;
syms x
I = [x,0,0;0,x,0;0,0,x];
Lambda = D-I;
DET = det(Lambda);
eqn = DET==0
eqn =
At this point, you have generated a cubic polynomial. It is a symbolic polynomial in x. That would be a good start. You needed to make only one more step.
But, what do you think root does? (Nothing. There is no function named root.) You can use solve.
xsol = solve(eqn,'maxdegree',3)
xsol =
And that looks pretty messy, but the fact is, the roots of a cubic polynomial are a bit messy for a completely general polynomial.
vpa(xsol)
ans =
So there are three real roots. They look like they are complex roots, because they have an imaginary part, but it is an infinitessimal one. Just discard that part.
real(vpa(xsol))
ans =
Those are the three roots. Are they correct?
eig(D)
ans = 3x1
31.6965 15.6084 2.6951
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
Indeed, what you did was valid. At least until that very last line.
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Joseph Slattery le 16 Avr 2024
ty

Connectez-vous pour commenter.

Torsten le 16 Avr 2024
k = [1750 -750 0; -750 1250 -500; 0 -500 500];
m = [75 0 0; 0 75 0; 0 0 50];
eig(k,m)
ans = 3x1
2.6951 15.6084 31.6965
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Joseph Slattery le 16 Avr 2024
nice

Connectez-vous pour commenter.

Sam Chak le 16 Avr 2024
k = [1750 -750 0; -750 1250 -500; 0 -500 500];
m = [75 0 0; 0 75 0; 0 0 50];
D = inv(m)*k;
syms x
I = [x,0,0;0,x,0;0,0,x];
Lambda = D - I;
DET = det(Lambda);
eqn = DET==0;
If you would like to use 'eqn' as the input argument for the 'roots()' command to find the roots of the polynomial, you can consider using this syntax:
sol = roots(fliplr(coeffs(lhs(eqn))))
sol =
Essentially, it is equivalent to executing these four lines of code:
lhsEqn = lhs(eqn) % get the left side of the symbolic equation
lhsEqn =
C = coeffs(lhsEqn) % get the coefficients of the polynomial expression
C =
P = fliplr(C) % flip the row vector C with the order of its elements reversed
P =
sol = roots(P) % find the roots based on the coefficients in lhsEqn
sol =
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Linear Algebra dans Help Center et File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by