Documentation

residue

Convert between partial fraction expansion and ratio of two polynomials

Syntax

Description

example

[r,p,k] = residue(b,a) finds the residues, poles, and direct term of a Partial Fraction Expansion of the ratio of two polynomials, where the expansion is of the form

b(s)a(s)=b1sm+b2sm1+b3sm2++bm+1a1sn+a2sn1+a3sn2++an+1

The inputs to residue are vectors of coefficients of the polynomials b = [bn ... b1 b0] and a = [am ... a1 a0]. The outputs are the residues r = [rm ... r2 r1], the poles p = [pm ... p2 p1], and the polynomial k. For most textbook problems, k is 0 or a constant.

example

[b,a] = residue(r,p,k) converts the partial fraction expansion back to the ratio of two polynomials and returns the coefficients in b and a.

Examples

collapse all

Find Partial Fraction Expansion

Find the partial fraction expansion of the following ratio of polynomials F(s) using residue

$$F(s) = \frac{b(s)}{a(s)} = \frac{5s^3 + 3s^2 - 2s + 7}{-4s^3 + 8s +
3}.$$

b = [ 5 3 -2 7];
a = [-4 0 8 3];
[r,p,k] = residue(b,a)
r =

   -1.4167
   -0.6653
    1.3320


p =

    1.5737
   -1.1644
   -0.4093


k =

   -1.2500

This represents the partial fraction expansion

$$F(s) = \frac{b(s)}{a(s)} = \frac{-1.4167}{s-1.5737} -
\frac{0.6653}{s+1.1644} + \frac{1.3320}{s+0.4093} - 1.2500.$$

Convert the partial fraction expansion back to polynomial coefficients using residue.

[b,a] = residue(r,p,k)
b =

   -1.2500   -0.7500    0.5000   -1.7500


a =

    1.0000   -0.0000   -2.0000   -0.7500

The result is normalized for the leading coefficient in the denominator and represents

$$F(s) = \frac{b(s)}{a(s)} = \frac{-1.25s^3-0.75s^2+0.50s-1.75}{s^3-2s-0.75}.$$

Expansion with Numerator Degree Greater Than Denominator Degree

The ratio of polynomials F(s) and its partial fraction expansion is

$$F(s) = \frac{b(s)}{a(s)} = \frac{2s^4+s}{s^2+1} = \frac{0.5-1i}{s-1i} + \frac{0.5+1i}{s+1i} + 2s^2-2.$$

Find the partial fraction expansion of F(s) using residue. When the degree of the numerator is greater than the degree of the denominator, output k is a vector that represents the coefficients of a polynomial in s.

b = [2 0 0 1 0];
a = [1 0 1];
[r,p,k] = residue(b,a)
r =

   0.5000 - 1.0000i
   0.5000 + 1.0000i


p =

   0.0000 + 1.0000i
   0.0000 - 1.0000i


k =

     2     0    -2

k represents the polynomial $2s^2-2$.

Related Examples

Input Arguments

collapse all

b — Coefficients of numerator polynomialvector of numbers

Coefficients of the polynomial in the numerator, specified as a vector of numbers representing the coefficients of the polynomial in descending powers of s.

Data Types: single | double
Complex Number Support: Yes

a — Coefficients of denominator polynomialvector of numbers

Coefficients of the polynomial in the denominator, specified as a vector of numbers representing the coefficients of the polynomial in descending powers of s.

Data Types: single | double
Complex Number Support: Yes

Output Arguments

collapse all

r — Residues of partial fraction expansioncolumn vector of numbers

Residues of partial fraction expansion, returned as a column vector of numbers.

p — Poles of partial fraction expansioncolumn vector of numbers

Poles of partial fraction expansion, returned as a column vector of numbers.

k — Direct termrow vector of numbers

Direct term, returned as a row vector of numbers that specify the coefficients of the polynomial in descending powers of s.

More About

collapse all

Partial Fraction Expansion

Consider the fraction F(s) of two polynomials b and a of degree n and m, respectively

F(s)=b(s)a(s)=bnsn++b2s2+b1s+b0amsm++a2s2+a1s+a0.

The fraction F(s) can be represented as a sum of simple fractions

b(s)a(s)=r1sp1+r2sp2++rnspn+k(s)

This sum is called the partial fraction expansion of F. The values rm,...,r1 are the residues, the values pm,...,p1 are the poles, and k(s) is a polynomial in s. For most textbook problems, k(s) is 0 or a constant.

The number of poles n is

n = length(a)-1 = length(r) = length(p)

The direct term vector is empty if length(b) < length(a); otherwise

length(k) = length(b)-length(a)+1

If p(i) = ... = p(i+j-1) is a pole of multiplicity j, then the expansion includes terms of the form

rjspj+rj+1(spj)2++rj+m1(spj)m.

Algorithms

residue first obtains the poles using roots. Next, if the fraction is nonproper, the direct term k is found using deconv, which performs polynomial long division. Finally, residue determines the residues by evaluating the polynomial with individual roots removed. For repeated roots, resi2 computes the residues at the repeated root locations.

Numerically, the partial fraction expansion of a ratio of polynomials represents an ill-posed problem. If the denominator polynomial, a(s), is near a polynomial with multiple roots, then small changes in the data, including roundoff errors, can result in arbitrarily large changes in the resulting poles and residues. Problem formulations making use of state-space or zero-pole representations are preferable.

References

[1] Oppenheim, A.V. and R.W. Schafer. Digital Signal Processing. Prentice-Hall, 1975, p. 56.

See Also

| |

Introduced before R2006a

Was this topic helpful?