solving a cubic equation
295 ビュー (過去 30 日間)
古いコメントを表示
vaggelis vaggelakis
2014 年 8 月 20 日
コメント済み: Christopher Creutzig
2014 年 8 月 29 日
I am using the command
x = solve('a*x^3 + b*x^2 + c*x + d')
to get the polynomial's roots. It returns a symbolic answer. Then i evaluate the a,b,c,d and i do copy-paste the first symbolic answer and then "enter" to get a numerical answer.
The numbers i get (1 almost real and 2 complex, as it is expected) are not roots of the equation!
I am looking for the poles of a mechanical system, so the roots must exist... What am i doing wrong?
1 件のコメント
Christopher Creutzig
2014 年 8 月 29 日
Please provide the values for a, b, c, d with which you run into that problem.
Note that these solution formulas are well known to be numerically unstable. That may be the root of your problem. (No pun intended.)
採用された回答
Star Strider
2014 年 8 月 20 日
Maybe I’m missing something, but why use the Symbolic Math Toolbox at all for this?
x = roots([a b c d])
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!