12.07.2015 Views

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 28: Polynomial Manipulations 231residue (b, a, tol)Function FileIf b and a are vectors of polynomial coefficients, then residue calculates the partialfraction expansion corresponding to the ratio of the two polynomials.The function residue returns r, p, k, and e, where the vector r contains the residueterms, p contains the pole values, k contains the coefficients of a direct polynomialterm (if it exists) and e is a vector containing the powers of the denominators in thepartial fraction terms.Assuming b and a represent polynomials P (s) and Q(s) we have:P (s)MQ(s) = ∑m=1r m(s − p m ) e mN∑+ k i s N−i .i=1where M is the number of poles (the length of the r, p, and e vectors) and N is thelength of the k vector.The argument tol is optional, and if not specified, a default value of 0.001 is assumed.The tolerance value is used to determine whether poles with small imaginary componentsare declared real. It is also used to determine if two poles are distinct. Ifthe ratio of the imaginary part of a pole to the real part is less than tol, the imaginarypart is discarded. If two poles are farther apart than tol they are distinct. Forexample,b = [1, 1, 1];a = [1, -5, 8, -4];[r, p, k, e] = residue (b, a);⇒ r = [-2, 7, 3]⇒ p = [2, 2, 1]⇒ k = [](0x0)⇒ e = [1, 2, 1]which implies the following partial fraction expansions 2 + s + 1s 3 − 5s 2 + 8s − 4 =−2s − 2 + 7(s − 2) 2 + 3s − 1roots (v)For a vector v with N components, return the roots of the polynomialFunction Filev 1 z N−1 + · · · + v N−1 z + v N .polyout (c, x)Write formatted polynomialFunction Filec(x) = c 1 x n + . . . + c n x + c n+1and return it as a string or write it to the screen (if nargout is zero). x defaults tothe string "s".

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!