![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/247129/image.png)
Inverse Laplace transform - there has to be a better way?
54 ビュー (過去 30 日間)
古いコメントを表示
I have a transfer function
and I am applying a step input
. My ultimate goal is to find the time response
.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/247100/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/247101/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/247102/image.png)
Solving by hand, I know that output
.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/247103/image.png)
Then by partial fraction expansion I know that
.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/247104/image.png)
From the above I can easily take the inverse Laplace transform and see that
.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/247105/image.png)
My goal is to obtain
with as few keystrokes as possible.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/247106/image.png)
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?
0 件のコメント
採用された回答
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/247129/image.png)
2 件のコメント
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 Center および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!