Effacer les filtres
Effacer les filtres

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

7 vues (au cours des 30 derniers jours)
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.

Réponse acceptée

Paul
Paul le 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))
fun2 = 
y2 = ilaplace(fun2)
y2 = 
  4 commentaires
Paul
Paul le 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
Paul le 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))
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).

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by