Why does the Residue function returns complex coefficients of a rational function....??
Mostra commenti meno recenti
Hi
Even though I ensured that all my poles ,residues are complex conjugate pairs and the direct term is real, the residue function returns complex coefficients. May I know the reason why this is happening in matlab.
For eg:
Poles=[ -0.297252868065168 - 11.6108351815607i -0.297252868065168 + 11.6108351815607i -19.9444674513931 - 8.76592887488931i -19.9444674513931 + 8.76592887488931i -8.52965151869893 - 23.6423888144931i -8.52965151869893 + 23.6423888144931i];
Res=[ -0.219160922557423 + 0.314530473001705i -0.219160922557423 - 0.314530473001705i 3.62282522955231 + 177.563841204173i 3.62282522955231 - 177.563841204173i -4.53489652493515 - 28.5303076418931i -4.53489652493515 + 28.5303076418931i];
Direct_term=0.00210679058580560;
[b a]=residue(Res,Poles,Direct_term);
Why am I getting complex co-eff in 'b' ?? Please let me know asap....
Thanks Venu
Risposte (1)
the cyclist
il 15 Ott 2011
0 voti
Looks to me that the imaginary parts are tiny, and are just computer round-off error.
4 Commenti
venu
il 15 Ott 2011
Walter Roberson
il 15 Ott 2011
It would help if you could show the actual outputs you get. People do not always have MATLAB handy to run tests with at the time they are reading questions.
venu
il 15 Ott 2011
the cyclist
il 15 Ott 2011
venu, when I run that code, I get that the largest imaginary part is 15 orders of magnitude smaller than the largest real part. I still believe this is roundoff error.
If you need better that this, then maybe you need to solve this analytically, and not numerically. I don't know for sure, but maybe the Symbolic Math Toolbox handles this.
Categorie
Scopri di più su Mathematics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!