# residue

Version:

Computes the partial fraction expansion of two polynomials, or transforms a given partial fraction expansion into the original polynomial representation.

## Syntax

[b, a] = residue(r, p, k)
[r2, p2, k2] = residue(b2, a2)

## r

Residues of the partial fraction expansion. r is a real or complex vector.

## p

Poles of the partial fraction expansion. p is a real or complex vector.

## k

Coefficients in descending order of power of the quotient polynomial of a and b. k is a real or complex vector.

## b2

Coefficients in descending order of power of the numerator polynomial. b2 is an array of any dimension. If necessary, MathScript flattens b2 before the calculation.

## a2

Coefficients in descending order of power of the denominator polynomial. a2 is an array of any dimension. If necessary, MathScript flattens a2 before the calculation.

## b

Coefficients in descending order of power of the numerator polynomial.

## a

Coefficients in descending order of power of the denominator polynomial.

## r2

Residues of the partial fraction expansion. r2 is a real or complex vector.

## p2

Poles of the partial fraction expansion. p2 is a real or complex vector.

## k2

Coefficients in descending order of power of the quotient polynomial of a2 and b2.

## Calculation Methods

MathScript computes a and b using the following equation if no multiple roots exist:

b s /a s = (r 1/(s-p 1)) + (r 2/(s-p 2)) + ... + (r n /(s-p n )) + k s , where s is the power and n is the number of elements in the partial fraction expansion.

If multiple poles exist, that is, if p j = ... = p j + m - 1, where j is the element index and m is the multiple, then the partial fraction expansion includes the following terms: (r j /(s-p j )) + (r j +1/(s-p j ))2 + ... + (r j + m -1/(s-p j )) m .

B = [1, 2, 3, 4];
A = [1, 1];
[R, P, K] = residue(B, A)

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices