Having presented the fundamentals of MATLAB in Section 2.8, let us now return to the problem we addressed in Section 2.7 on obtaining the inverse Laplace transform using partial fraction expansion. However, in this section, we will obtain the partial fraction expansion using MATLAB.
Let us consider the following transfer function:
We wish to first find its partial fraction expansion, prior to obtaining its Laplace transform using Table 2.1.
In order to use MATLAB’s command “residue” (num,den) for obtaining the partial fraction expansion, we must first describe this problem in MATLAB format where row vectors “num” and “den” specify the coefficients of the numerator and denominator of the transfer function as follows:
num = [4 24 12]
den = [1 5 6 0].
poly_add | — add two polynomials | |
polysbst | — substitution of a polynomial variable with a polynomial | |
polyder | — derivative of a polynomial (supplied with MATLAB) | |
Polynomial utilities | polyintg | — integral of a polynomial |
polymag | — locate roots of a polynomial that generate a given magnitude | |
polyangl | — locate roots of a polynomial that generate a given angle | |
rootmag | — locate roots of a polynomial that are at given magnitude | |
rootangl | — locate roots of a polynomial that are at given angle | |
crossing | — interpolates the index of specified values from a data set | |
Interpolation utilities | ||
crosses | — interpolates the value of a data set at specified indices | |
crosser | — iterates the solution of a function to a specified value | |
margins | — analytic calculations of all the phase and gain margins | |
rlpoba | — root locus point of break-away/break-in | |
Control utilities | rlaxis | — real axis portion of the root locus |
wpmp | — maximum feedback frequency location | |
nichgrid | — Nichols grid at user requested inputs | |
Nonlinear Functions (using the describing function implementation) | back_lsh | — backlash response |
dead_zn | — deadzone response | |
relays | — hysteresis response | |
sbplot | — subplot replacement | |
Compatibility Functions | frz_axis | — axis replacement |
The command residue (num, den) provides the residue r, the poles p, and the direct term k:
[r, p, k] = residue (num,den).
Applying this command for this problem, we obtain the following result:
r = 2.0000
−8.0000
10.0000
p = 0
−3.0000
−2.0000
k = 0.
Therefore, the partial fraction expansion of the transfer function Y(s) is given by:
Therefore, the inverse Laplace transform is obtained as follows using Table 2.1:
y(t) = (2 − 8e−3t + 10e−2t)U(t).
If we use the following command,
[num,den] = residue (r, p, k)
where r, p, and k are given from the previous MATLAB output, then MATLAB converts the partial-fraction expansion back to the original polynomial ratio of Y(s) as follows:
num = 4.0000 24.0000 12.0000
den = 1.0000 5.0000 6.0000 0.0000.
Therefore,