residue
Partial fraction expansion of a ratio of polynomials.
Category: Mathematics > Elementary Math
Syntax
[r, p, k] = residue(b, a)
Expands b(s)/a(s) into residues r, poles p and the direct polynomial term k.
[b, a] = residue(r, p, k)
Converts back: combines the partial fractions into numerator b and denominator a.
Description
The decomposition is b(s)/a(s) = r(1)/(s - p(1)) + ... + r(n)/(s - p(n)) + k(s). A repeated pole p appears several times in p, and its residues correspond to the terms 1/(s-p), 1/(s-p)^2, and so on. It is the standard tool for inverse Laplace and Z transforms, where each term is inverted separately.
Close or repeated poles make the result sensitive to rounding, because they are found with roots.
Input arguments
b, a- Coefficient vectors of the numerator and denominator, highest power first.
r, p, k- Residues, poles and direct term, as returned by the first form.
Output arguments
r, p- Column vectors of residues and poles of the same length.
k- Coefficients of the polynomial part; empty when the degree of
bis less than that ofa.
Example
Expand and rebuild
[r, p, k] = residue([1 0 0 1], [1 3 2])
[b, a] = residue(r, p, k)
Output
r = 2×1
7
0
p = 2×1
-2
-1
k = 1×2
1 -3
b = 1×4
1 0 0 1
a = 1×3
1 3 2