Solving Determinant w/ Symbolic Values?
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Carlen
le 29 Oct 2014
Commenté : Aditya Vikram Singh
le 5 Sep 2021
I essentially have this determinant here that I need to solve:

Just not sure how to do it symbolically in MATLAB without values...
Also, is there a way that I could then solve for w(omega) smybolically?
0 commentaires
Réponse acceptée
Star Strider
le 29 Oct 2014
syms m1 m2 k1 k2 w
M = [(-m1*w^2 + k1) (-k1); (-k1) (-m2*w^2 + k1 + k2)];
detM = det(M);
w = solve(detM,w)
4 commentaires
Aditya Vikram Singh
le 5 Sep 2021
@Star Strider can you please also tell how to obtain the fourth degree equation in omega here with coeffiecient of each term in omega.
Plus de réponses (3)
Carlen
le 29 Oct 2014
Modifié(e) : Carlen
le 29 Oct 2014
1 commentaire
Star Strider
le 29 Oct 2014
My pleasure!
Probably the easiest way to solve for w^2 is simply to substitute w2 for it:
syms m1 m2 k1 k2 w w2
M = [(-m1*w2 + k1) (-k1); (-k1) (-m2*w2 + k1 + k2)];
detM = det(M);
w2 = solve(detM, w2)
That produces two quadratic roots.
If you want to use the roots as a function in other MATLAB code, use matlabFunction and its friends. It is much easier than coding it yourself, and it also vectorises the expression in the process.
For example:
wsq = matlabFunction(w2);
detmat = wsq(3, 5, 7, 13);
will produce a (2x1) vector of solutions.
Caio Contezini
le 18 Nov 2020
Star Strider, how can I solve that if I dont have Symbolic Math Toolbox?
0 commentaires
Voir également
Catégories
En savoir plus sur Conversion Between Symbolic and Numeric 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!