Using symbolic variables, how do you expand polynomials to show complex roots in an equation

12 ビュー (過去 30 日間)
This is my code:
clc; clear; close all;
syms s
Num = 10^4*(s+5)*(s+70);
Den = s*(s+45)*(s+55)*(s^2+7*s+110)*(s^2+6*s+95);
F = Num/Den
h=vpa(partfrac(F,s),5);
pretty(h)
and this is my output:
How do I output it so that that the polynomials are also factored such that:
and also, how do i Output all my roots?
thank you so much in advance

採用された回答

Robert U
Robert U 2021 年 9 月 16 日
Hi bob,
I guess it's a transfer function and you are looking for poles and zeros.
syms s
Num = 10^4*(s+5)*(s+70);
Den = s*(s+45)*(s+55)*(s^2+7*s+110)*(s^2+6*s+95);
F = Num/Den;
h=vpa(partfrac(F,s,'FactorMode','complex'),5); % get complex parts of fraction
pretty(h)
0.0066 + 1.0618e-43i 0.0017773 0.13532 - 1.0213 - 0.1349i - 1.0213 + 0.1349i 0.95126 + 0.089607i 0.95126 - 0.089607i -------------------- - --------- + ------- + ------------------ + ------------------ + ------------------- + ------------------- s + 45.0 s + 55.0 s s + 3.0 - 9.2736i s + 3.0 + 9.2736i s + 3.5 - 9.8869i s + 3.5 + 9.8869i
rootsNum = solve(h,s); % calculate actual roots for the rational function
rootsDenum = solve(simplify(1/h),s); % calculate roots for the denumerator
rootsNum
rootsNum = 
rootsDenum
rootsDenum = 
Kind regards,
Robert

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFormula Manipulation and Simplification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by