Accelerating the pace of engineering and science

# Documentation

## Partial Fraction Expansions

residue finds the partial fraction expansion of the ratio of two polynomials. This is particularly useful for applications that represent systems in transfer function form. For polynomials b and a, if there are no multiple roots,

$\frac{b\left(s\right)}{a\left(s\right)}=\frac{{r}_{1}}{s-{p}_{1}}+\frac{{r}_{2}}{s-{p}_{2}}+\dots +\frac{{r}_{n}}{s-{p}_{n}}+{k}_{s}$

where r is a column vector of residues, p is a column vector of pole locations, and k is a row vector of direct terms. Consider the transfer function

$\frac{-4s+8}{{s}^{2}+6s+8}$

```b = [-4 8];
a = [1 6 8];
[r,p,k] = residue(b,a)

r =
-12
8

p =
-4
-2

k =
[]```

Given three input arguments (r, p, and k), residue converts back to polynomial form:

```[b2,a2] = residue(r,p,k)

b2 =
-4     8
a2 =
1     6     8```