very large abnormal value of partial fraction expansion using answers of residuez command?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am making a program on matlab to determine partial fraction expansion of z transform given by G(z)=(18z^3) / (18z^3+3z^2-4z-1)
code m file attached
but whenever i run this program i get abnormally large/garbage values in H that i think are not realizeable
0 Kommentare
Antworten (1)
Adam Danz
am 2 Okt. 2018
Bearbeitet: Adam Danz
am 2 Okt. 2018
To understand why these large numbers appear, let's look at a small part of the last line of your code.
From your full line
H=r(1)/(1-p(1)*z^(-1) ) +r(2)/(1-p(2)*z^(-1))+r(3)/(1-p(3)*z^(-1))
let's look at
1-p(2)*z
When you evaluate 1-p(2)*z you get 1.333*z. That is converted to a fraction (375299970653903*z)/1125899906842624 + 1. When you evaluate 1-p(2)*z, the output will be in fraction format and if you evaluate that fraction, you'll find that it's the same as 1.333*z. Since your code converts to fraction format, those large numbers stay in the equation.
As a test, reduce the equation manually, assign z a value and compare the result of the simplified and non-simplified equations.
For example, given your other inputs, your last line reduces to ( done quickly, double check...)
H=r(1)/(1-p(1)*z^(-1) ) +r(2)/(1-p(2)*z^(-1))+r(3)/(1-p(3)*z^(-1))
H = 0.36/(0.5*z^(-1)) + 0.24 / (1.333*z^(-1)) + 0.4 / (1.333*z^(-1))
H = (39994*z)/33325
4 Kommentare
Adam Danz
am 3 Okt. 2018
To answer your first question, regarding the number, 8646911323865919, there are three terms in your equation:
H = r(1)/(1-p(1)*z^(-1) )
+ r(2)/(1-p(2)*z^(-1))
+ r(3)/(1-p(3)*z^(-1))
Those three terms evaluated individually are
-9/(25*(1/(2*z) - 1))
8646911323865919/(36028797018963968*(375299970653903/(1125899906842624*z) + 1))
3602879692067755/(9007199254740992*(3002399737929439/(9007199254740992*z) + 1))
Notice the number 8646911323865919 is coming from the 2nd term. When the full equation is evaluated, for some reason I haven't looked into the order of the terms are rearranged but that wouldn't affect the result anyway.
I'd have to think about your 2nd question later.
Siehe auch
Kategorien
Mehr zu Logical 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!