residue
polynomial · scripts/polynomial/residue.m
[R, P, K, E] = residue (B, A)
[B, A] = residue (R, P, K)
[B, A] = residue (R, P, K, E) -- partial fraction expansion.
Forward: B(s)/A(s) = K(s) + sum_j R(j) / (s - P(j))^E(j). The poles are
the roots of A, grouped by mpoles so that a pole of multiplicity M occurs
M times with exponents 1 ... M; every member of a group is replaced by
the group mean. R, P and E are columns, K a row (empty when degree B is
below degree A).
Inverse: rebuilds the polynomials B and A from residues, poles, the
polynomial part K and (optionally) the exponents E.