I want to perform inverse Laplace transform but my code does not seem to work

7 次查看(过去 30 天)
I am trying to perform inverse Laplace transform the following way, but I am getting an answer that is not satisfying.
syms s K tau a
fun2 = ((60*K*(exp(-a*s)))/tau)/(s*(s + 1/tau));
y2 = ilaplace(fun2);
pretty(y2)
/ exp(-a s) \ K ilaplace| -------------, s, t | 60 | / 1 \ | | s | s + --- | | \ \ tau / / ------------------------------------ tau
I am getting the answer that code shows, but it is not helpful as it does not perform the Laplace inverse transform. I do not know how to solve the problem.

采纳的回答

Paul
Paul 2023-10-27
Hi Carlos,
ilaplace assumes that all signals are causal, which wouldn't be true in this case if a < 0.
Add the appropriate assumption, and ilaplace returns a closed-form expression.
syms s K tau a
assume(a >= 0)
fun2 = ((60*K*(exp(-a*s)))/tau)/(s*(s + 1/tau))
fun2 = 
y2 = ilaplace(fun2)
y2 = 
  4 个评论
Paul
Paul 2023-10-27
You may be more familiar with the term unit step, or step, function, rather than Heaviside function.
It shows up in y2 as a result of the time shift property of the unilateral Laplace transform:
f(t-a)*u(t-a) -> exp(-a*s)*F(s) , a > = 0
u(t) is the same as heaviside(t)
y2(a) = 0 regardless of the value of heaviside(0).
Paul
Paul 2023-10-27
Also, you have to be careful with Matlab if you want to apply the time shift property by hand because ilaplace does not always tack on the heaviside to the result like it should (others may have different opinion).
For example
syms s K tau t a
assume(a >= 0)
fun2(s) = ((60*K)/tau)/(s*(s + 1/tau))
fun2(s) = 
y2(t) = ilaplace(fun2)
y2(t) = 
Now, if we want to find the ilapalce of exp(-a*s)*fun2(s), it's tempting to just shift y2(t) to the right by a
y2(t-a)
ans = 
whch is incorrect. Instead, we have to tack on the heaviside to the y2(t) first and then shfit
y2(t) = y2(t)*heaviside(t);
y2(t-a)
ans = 
which is the same result as above (after canceling tau in result above).

请先登录,再进行评论。

更多回答(0 个)

类别

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

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by