ilaplace() function is giving wrong results
20 views (last 30 days)
Show older comments
HI,
I am using ilaplace() function to transform a function with this aspect
The temporal form of that function is a linear combination of a constant term and two exponentials.
I am particularly interested in noting that f(t) is a linear combination of a,b, and c. If I run this code
syms s t a b c d e f;
Fs = (a*s^2+b*s+c)/(s*(d*s^2+e*s+f));
ft = ilaplace(Fs)
The result is
Which IMHO is NOT a linear combination of a, b, and c. Why am I getting this? The result seems wrong to me.
Thanks in advanced.
EDIT:
Found the solution. Just use this function before applyting inverse Laplace tansform to F.
partfrac(F,'FactorMode','complex')
1 Comment
Answers (1)
David Goodmanson
on 3 Sep 2020
Edited: David Goodmanson
on 7 Sep 2020
Hi David,
plugging in
cosh(z) = ((exp(z) + exp(-z))/2
sinh(z) = ((exp(z) - exp(-z))/2
results in a constant and two exponentials, as you said.
Note that in the expression for #1, the d in the denominator belongs in the argument for the square root. It does not belong under the entire expression. The fraction bar is too long, and it looks quite likely that the expression for ft has similar problems.
If you want to find the coefficients of the exponentials with a minimum of fuss, the following works.
<< the original question has been modified and includes the form shown here below >>
Find the roots of (d*s^2 + e*s + f), and reverse their signs to obtain r1,r2. Then
F(s) = (a*s^2+b*s+c) / (d*s*(s+r1)*(s+r2))
The solution has the form A0 + A1* exp(-r1*t) + A2*exp(-r2*t).
For A0, evaluate F(s) at s = 0, neglecting s in the denominator.
For A1, evaluate F(s) at s = -r1, neglecting (s+r1) in the denominator.
For A2, evaluate F(s) at s = -r2, neglecting (s+r2) in the denominator.
8 Comments
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!