Inverse Laplace transform - there has to be a better way?

30 次查看(过去 30 天)
I have a transfer function and I am applying a step input . My ultimate goal is to find the time response .
Solving by hand, I know that output .
Then by partial fraction expansion I know that .
From the above I can easily take the inverse Laplace transform and see that .
My goal is to obtain with as few keystrokes as possible.
The fastest way I have found is to perform the partial fraction expansion using residue():
num = 9;
denom = [1 9 9 0];
[r,p,k] = residue(num,denom);
which gives the result:
r =
0.1708
-1.1708
1.0000
p =
-7.8541
-1.1459
0
k =
[]
From which I can write:
sym s
F = 0.1708/(s+7.8541) -1.1459/(s+1.1708) + 1/s;
ilaplace(F)
which gives the result:
ans =
(427*exp(-(78541*t)/10000))/2500 - (11459*exp(-(2927*t)/2500))/10000 + 1
which is the answer I want!
But there has to be a better way of doing this! Can someone please advise?

采纳的回答

Star Strider
Star Strider 2019-11-6
Try this:
syms s t
num = 9;
denom = [1 9 9 0];
% [r,p,k] = residue(num,denom);
nums = num;
dens = poly2sym(denom, s); % Create Symbolic Polynomial
F = nums / dens * 1/s % Transfer Function With Step Input
Fpf = partfrac(F) % Partial Fraction Expansion
f = ilaplace(Fpf) % Time Domain Expression
f = rewrite(f, 'exp') % Rewrite As Exponential Terms
f = vpa(f,4) % Convert Fractions To Decimal Equivalents
flatex = latex(f) % LaTeX Expression
producing:
  2 个评论
Star Strider
Star Strider 2019-11-7
As always, my pleasure!
The partfrac function was introduced in R2015a, and seems to be invoked automatically in the last two or three releases. It was not automatic before then, so I specifically included it here.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by