help-octave
[Top][All Lists]

## Re: Inverse Laplace Transform

 From: Colin Macdonald Subject: Re: Inverse Laplace Transform Date: Tue, 17 Jul 2018 10:16:46 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

```On 2018-07-15 11:03 AM, aheak123 wrote:
```
```Hi, I am trying to take the inverse laplace transform from (Signal and System
with Matlab Application by Steven T. Karris)

I(s) = (s^2+2*s-1)/(2*s^3+9*s^2+6*s+3)

I use the residue command
```
```n = [1 2 -1];
d = [2 9 6 3];
[r,p,k] = residue(n,d)
```
```r =

0.24020 + 0.00000i
0.12990 + 0.23250i
0.12990 - 0.23250i

p =

-3.81700 + 0.00000i
-0.34150 + 0.52570i
-0.34150 - 0.52570i

k = [](0x0)

from this I got the inverse laplace transform of

*0.24*exp(-3.8*t)+exp(-0.34*t)(0.26*cos(0.53*t)-0.46*sin(0.53*t)*

In the book, he got answer of

*0.48*exp(-3.8*t)+exp(-0.34*t)(0.52*cos(0.53*t)-0.92*sin(0.53*t)
*

which is just a factor of 2 from my solution.  In the book he did not use
the residue command.

He did it partial fraction expansion:

(s^2+2*s-1)/(s+3.817)*(s^2+0.683*s+0.393) =
r1/(s+3.817)+(r2*s+r3)/(s^2+0.683*s+0.393)

found r1 = 0.48, r2 = 0.52, r3 = -0.31, thus

0.48/(s+3.817)+(0.52*s-0.31)/(s^2+0.683*s+0.393)

He got the answer as (a scale factor of 2 from my solution).
0.48*exp(-3.82*t)-0.93*exp(-0.34*t)*sin(0.53*t)+0.53*exp(-0.34*t)*cos(0.53*t)

But which one is correct?  I checked both ways of doing it and they seem to
be correct.  What am I doing wrong here?
```
```
```
I'm not sure. I think you're asking a math question rather than an Octave question.
```
```
One way to check the two solutions would be to compute the (forward) Laplace transform and check which one gives I(s).
```
>> t
>> B = 0.48*exp(-3.8*t) + exp(-0.34*t)*(0.52*cos(0.53*t)-0.92*sin(0.53*t))

```
(Note this will give lots of warnings because of those decimal places, but should be close enough for a rough test).
```
>> laplace(B)

ans = (sym)

⎛       2                  ⎞
4⋅⎝12500⋅s  + 24895⋅s - 12384⎠
─────────────────────────────────────────
⎛       3          2                  ⎞
5⋅⎝10000⋅s  + 44800⋅s  + 29805⋅s + 15067⎠

```
Note that is very close to I. But if you do this with your 0.24*exp()..., the result is also off by a factor of two.
```
best,
Colin

```