Using symbolic variables, how do you expand polynomials to show complex roots in an equation
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/740089/image.png)
How do I output it so that that the polynomials are also factored such that:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/740094/image.png)
and also, how do i Output all my roots?
thank you so much in advance
0 Kommentare
Akzeptierte Antwort
Robert U
am 16 Sep. 2021
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)
rootsNum = solve(h,s); % calculate actual roots for the rational function
rootsDenum = solve(simplify(1/h),s); % calculate roots for the denumerator
rootsNum
rootsDenum
Kind regards,
Robert
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Formula Manipulation and Simplification finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!