I want to perform inverse Laplace transform but my code does not seem to work
7 views (last 30 days)
Show older comments
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)
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.
0 Comments
Accepted Answer
Paul
on 27 Oct 2023
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))
y2 = ilaplace(fun2)
4 Comments
Paul
on 27 Oct 2023
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
on 27 Oct 2023
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))
y2(t) = ilaplace(fun2)
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)
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)
which is the same result as above (after canceling tau in result above).
More Answers (0)
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!