필터 지우기
필터 지우기

very large abnormal value of partial fraction expansion using answers of residuez command?

조회 수: 1 (최근 30일)
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

답변 (1개)

Adam Danz
Adam Danz 2018년 10월 2일
편집: Adam Danz 2018년 10월 2일
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
ABTJ
ABTJ 2018년 10월 3일
is there any method in matlab,that we can skip this big number form and get simple answer just like
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))
Adam Danz
Adam Danz 2018년 10월 3일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by