EGR 261 – Inverse Laplace Transforms using MATLAB 1 Residue method using MATLAB [R,P,K] = residue(N, D) finds the residues, poles and direct term of a partial fraction expansion of the ratio of two polynomials N(s)/D(s). If there are no multiple roots, • • • • • • • Vectors B and A specify the coefficients of the numerator and denominator polynomials in descending powers of s. R = column vector of residues P = column vector of pole locations K = row vector of direct terms The number of poles is n = length(D)-1 = length(R) = length(P). The direct term coefficient vector is empty if length(N) < length(D), otherwise length(K) = length(N) - length(D)+1. If P(j) = ... = P(j+m-1) is a pole of multiplicity m, then the expansion includes terms of the form [N, D] = residue(R,P,K), with 3 input arguments and 2 output arguments, converts the partial fraction expansion back to the polynomials with coefficients in N and D. Reference: type help residue in MATLAB EGR 261 – Inverse Laplace Transforms using MATLAB Example – Residue method using MATLAB V(s) 4s s 3s 2 2 4s s 1s 2 8 s2 -4 s 1 Note that the largest pole is listed first 2 EGR 261 – Inverse Laplace Transforms using MATLAB Example – Residue method using MATLAB 2s 23s 79s 4 V(s) 3 2 96s 88 s 4 s 6 2s 3s 1 2 Could be found by hand using long division 3 10 s6 4 s4 EGR 261 – Inverse Laplace Transforms using MATLAB Example – Residue method using MATLAB V(s) s3 s 1 s 2 2 1 s2 -1 s 1 Note that the largest pole is listed first 4 2 s 12 Note that repeated roots are from lowest power to highest power EGR 261 – Inverse Laplace Transforms using MATLAB Example – Residue method using MATLAB 5s 64s 99 2 V(s) s 1 s 2 6s 25 1.5 - j5 s 3 j4 1.5 j5 s 3 j4 Answer expressed using complex roots 5 2 s 1 s 3s 49 2 6s 25 2 s 1 Answer expressed using quadratic factor EGR 261 – Inverse Laplace Transforms using MATLAB Finding inverse Laplace transforms using MATLAB Although we just saw how we could use MATLAB to perform partial fraction expansion using the residue method, an even more powerful function is available for finding inverse Laplace transforms: ilaplace( ). 6 ilaplace(F) - the inverse Laplace transform of symbolic F with default independent variable s. The default return is a function of t. The inverse Laplace transform is applied to a function of s and returns a function of t. ilaplace(F, y) - returns a function of y instead of a function of t - ilaplace(F, t) is the same as ilaplace(F) ilaplace(F, y, x) - finds the inverse transform as a function of x (instead of s) and returns a function of y (instead of t) - ilaplace(F, t, s) is the same as ilaplace(F) Note: Since we are using one-sided Laplace transforms, there is an implied u(t) associated with functions. So if ilaplace (2/s) returns the value 2, then it is implied that f(t) = 2u(t). Examples: See the following pages EGR 261 – Inverse Laplace Transforms using MATLAB Examples – using MATLAB Verify the following relationships: -1 1 L 2 tu(t) s 10 20 -1 2 L 2 - 10e s s 2 s 3 -1 10s L 2 10cos(2t)u (t) s 4 10e - 4s L 10u(t - 4) s -1 - 2t 20e - 3t u(t) 7 EGR 261 – Inverse Laplace Transforms using MATLAB Examples Find inverse Laplace transforms for the some of the following functions and use MATLAB to verify the results. (Optional: Also find the poles and residues.) A) V(s) C) F(s) E) F(s) 2s B) I(s) s4 2e 10s s 12s 100 2 -4s s 4 D) V(s) 2 2s 10 s 2 s 3 2s s 2 2 s 3 F) V(s) 4s s 3s 2 2 s 1 s 2 2s 23s 79s 4 G) V(s) 4s 3 2 8 s2 96s 88 s 4 s 6 -4 s 1 2s 3s 1 2 10 s6 4 s4 8