14.12 Partial Fraction Expansion Using MATLAB
MATLAB provides a function calledresidue that performs the partial fraction expansion of a transfer function. Consider a transfer function
In Eq. 14.12-1, the transfer function is represented as a ratio of two polynomials in s. In MATLAB the transfer function given in Eq. 14.12-1 can be represented by two lists. One list specifies the coefficients of the numerator polynomial, and the other list specifies the coefficients of the denominator polynomial. For example,
num = [ b3 b2 b1 b0 ]
den = [ a3 a2 a1 a0 ]
(In this case both polynomials are third-order polynomials, but the orders of these polynomials could be changed.)
Partial fraction expansion can be used to represent H(s) as
R1, R2 and R3 are called residues, and p1, p2 and p3 are the poles. In general, both the residues and poles can be complex numbers. The term k(s) will, in general, be a polynomial in s. MATLAB represents this form of the transfer function by three lists:
R = [ R1 R2 R3 ]
is a list of the residues,
p = [ p1 p2 p3 ]
is a list of the poles, and
k = [c2 c1 c0 ]
is a list of the coefficients of the polynomial k(s).
The MATLAB command
[R, p, k] = residue(num, den)
performs the partial fraction expansion, calculating the poles and residues from the coefficients of the numerator and denominator polynomials. The MATLAB command
[n, d] = residue(R, p, k)
performs the reverse operation, calculating the coefficients of the numerator and denominator polynomials from the poles and residues.
Figure 14.12-1 shows a MATLAB screen illustrating this procedure. In this example
is represented as
by performing the partial fraction expansion.