Review of Laplace Transform
ECE generic        Han Q. Le (c)

Part 2

5. Inverse Laplace transforms of rational functions

5.1 Discussion

As we discuss in the example in 2.4.3 (case b) above, we might encounter expression like this:
                                          ((s^2)/( ( (s^2) + s /τ+((Subscript[ω, 0])^2)) ((s^2)+(ω^2))))                                                (5.1)
And the example shows that the inverse LT is:
              (((Subscript[α, 1]^2) (e^((Subscript[α, 1]) t)))/(((Subscript[α, 1])-(Subscript[α, 2])) (ω-i (Subscript[α, 1])) (ω+i (Subscript[α, 1]))))+((i ω (e^(-i t ω)))/(2 (ω-i (Subscript[α, 1])) (ω-i (Subscript[α, 2]))))-((i ω (e^(i t ω)))/(2 (ω+i (Subscript[α, 1])) (ω+i (Subscript[α, 2]))))+(((Subscript[α, 2]^2) (e^((Subscript[α, 2]) t)))/(((Subscript[α, 2])-(Subscript[α, 1])) (ω-i (Subscript[α, 2])) (ω+i (Subscript[α, 2]))))
or:                           (Subscript[a, 1]) (e^((Subscript[α, 1]) t))+(Subscript[a, 2]) (e^((Subscript[α, 2]) t))+(Subscript[b, p])(e^(i t ω))+(Subscript[b, m])(e^(-i t ω))                          (5.2)
This is quite simple in form.

The general approach is to reduce such a complicated rational function into partial fraction:
                                ((s^2)/( ( (s^2) + s /τ+((Subscript[ω, 0])^2)) ((s^2)+(ω^2))))=(∑_k)((Subscript[c, k;M])/(((s-(Subscript[α, k])))^(Subscript[M, k])))
Once we have simple fraction, we can use the inverse LT look-up table.

It is just plain algrebra to perform such a fraction reduction. Consider a general rational function:
                                      H[z]=((P[z])/(Q[z]))=(((∏_(l=1)^N)(((z-(Subscript[β, l])))^(Subscript[p, l])))/((∏_(k=1)^M)(((z-(Subscript[α, k])))^(Subscript[q, k]))))                                      (5.3)
where (Subscript[α, k]) are the zeros of Q[z] with order (Subscript[q, k]) and (Subscript[β, l]) are the zeros of P[z] with order (Subscript[p, l]). Then (Subscript[α, k]) are the poles of H[z], and only they are important for system response behavior. We wish to expand:
                                      H[z]=(∑_k)(∑_(m=1)^(Subscript[q, k]))((Subscript[A, k;m])/(((z-(Subscript[α, k])))^m))                                      (5.4)
Coefficients A's can be found by solving linear equations. A technique also known as Heaviside technique involves multiplying  (5.4) with the denominator, e. g. 
         H[z](((z-(Subscript[α, l])))^(Subscript[q, l]))=(∑_(m=1)^(Subscript[q, l]))(Subscript[A, k;m]) (((z-(Subscript[α, l])))^((Subscript[q, l])-m))+(∑_(k≠l))(∑_(m=1)^(Subscript[q, k]))((((Subscript[A, k;m ])(z-(Subscript[α, l])))^(Subscript[q, l]))/(((z-(Subscript[α, k])))^m))       (5.5)
Then by substituting appropriate value for (∑_(k≠l))(∑_(m=1)^(Subscript[q, k]))((((Subscript[A, k;m ])(z-(Subscript[α, l])))^(Subscript[q, l]))/(((z-(Subscript[α, k])))^m)) to vanish, it remains the value of coefficient A.

5.2 Examples and exercises

5.2.1

Consider this:              F[s]=((s+3)/((s+1) (s+2)))

Apart[((s+3)/((s+1) (s+2))),s]

InverseLaplaceTransform[(2/(s+1)),s,t]-InverseLaplaceTransform[(1/(s+2)),s,t]

Thus:                         (ℒ^(-1))[F[s]]=Θ[t] (2 (e^(-t))-(e^(-2 t)))

Notice that we must include the step function to ensure that it is meant for t≥0.

5.2.2

Consider this:              G[s]=(((s^3)+5 (s^2)+ 9 s+7)/((s+1) (s+2)))

Apart[(((s^3)+5 (s^2)+ 9 s+7)/((s+1) (s+2))),s]

InverseLaplaceTransform[s+2,s,t]+InverseLaplaceTransform[(2/(s+1)),s,t]-InverseLaplaceTransform[(1/(s+2)),s,t]

Thus:                         (ℒ^(-1))[G[s]]=2 (DiracDeltaSeq[t])+δ'(t)+Θ[t] (2 (e^(-t))-(e^(-2 t)))

5.2.3

Consider this:              F[s]=((s+12)/((s^2)+2 s+5))

Apart[((2 s+12)/((s^2)+2 s+5)),s]

We see that we must decompose the denominator.

Solve[(s^2)+2 s+5 ==0,s]

Now we can write:

Apart[((2 s+12)/((s+1+2 I)(s+1-2 I))),s]

(1+((5 I)/2)) InverseLaplaceTransform[(1/(s+(1+2 I))),s,t]+(1-((5 I)/2)) InverseLaplaceTransform[(1/(s+(1-2 I))),s,t]

FullSimplify[(1+((5 I)/2)) (E^((-1-2 I) t))+(1-((5 I)/2)) (E^((-1+2 I) t))]

Thus:                         (ℒ^(-1))[F[s]]=Θ[t] (e^(-t)) (5 sin(2 t)+2 cos(2 t))

5.2.4

Consider the case of high-order poles:              F[s]=(((s^2)+2 s+3)/(((s+1))^3))

Apart[(((s^2)+2 s+3)/(((s+1))^3)),s]

InverseLaplaceTransform[(1/(s+1)),s,t]+ InverseLaplaceTransform[(2/(((s+1))^3)),s,t]

Thus:                         (ℒ^(-1))[F[s]]=Θ[t] (e^(-t)) (1+(t^2))

5.2.5

Consider this:              F[s]=((15 (s^2) + 25 s + 20)/(((s^2)+1) ((s^2)+10 s +16)))

Apart[((15 (s^2) + 25 s + 20)/(((s^2)+1) ((s^2)+10 s +16)))]

Notice that Mathematica and factor ((s^2)+10 s +16)  into s+2 and s+8 because the roots are real.

InverseLaplaceTransform[((s+1)/((s^2)+1))+(1/(s+2))-(2/(s+8)),s,t]

Hence:                      f[t]=((e^(-8 t)) (-2+(e^(6 t)))+cos(t)+sin(t) )Θ[t] 
However, if we have complex poles, this version of Mathematica does not do complex fraction reduction:

Apart[(( (s^2) - 2 s - 1)/(((s^2)+1) ((s^2)+3s -2)))]

Of course, we can let it do the inverse for us:

InverseLaplaceTransform[%,s,t]

We don’t always have to deal with complex poles. However, it is insightful to analyze the poles of a polynomial rationals, as we will see that the main behavior of a control system can be readily understood in terms of the poles (which are the zeros of the denominator). We will consider this later.

6. Application of LT to solve ODE

This section shows a number of examples only. The best way to learn is to practice, and you should do homework to learn it. You should look even more examples (in reference books, online,...) to get proficient at it.

The recipe:
1- Apply LT theorems to perform LT of the DE
    Pay attention of initial (or boundary) condition, and substitute in the LT-equation
2- Obtain an expression for the LT of the unknown function to be solved.
3- Perform inverse LT to obtain the desire solution

6.1 Example 1:

((d^2)/(d(t^2)))x[t] +3 (d/(dt))x[t]+2 x[t]==0             (6.1a)
The initial condition is:                 x[(SuperMinus[0])]=a       ;         (d/(dt))x[(SuperMinus[0])]=b             (6.1b)

Step 1: Apply LT theorems to perform LT of the DE. We define X[s] be the LT of x[t].
Then:                                          ℒ[ ((d^n)/(d(t^n)))f[t] ] = (s^n) F[s]-(∑_(k=1)^n)(s^(n-k))(f^((k-1)))[(SuperMinus[0])]       
                                                    ℒ[ ((d^2)/(d(t^2)))x[t] ] = (s^2) X[s]-(s x[(SuperMinus[0])]+(x^((1)))[(SuperMinus[0])])       
                                                                        = (s^2) X[s]-(s a+b)                     (6.2a)                                                    
                                                    ℒ[ (d/(dt))x[t] ] = s X[s]-x[(SuperMinus[0])]
                        =s X[s]-a                            (6.2b)
                                                     ℒ[ x[t] ] = X[s]                                        (6.2c)
                                                     ℒ[ 0 ] = 0                                                  (6.2d)

Step 2: Substitute various expression to obtain an equation for X[s]
                                        (s^2) X[s]-(s a+b)+3 (s X[s]-a) + 2X[s] ==0               (6.3)
Now, let’s solve for X[s]

Solve[(s^2) X-(s a+b)+3 (s X-a) + 2X==0,X]

Step 3: Use inverse LT to obtain x[t]

InverseLaplaceTransform[((a s+3 a+b)/((s^2)+3 s+2)), s, t]

Hence, the solution is:        x[t]= (e^(- t)) (2 a +b )-(e^(-2 t))(a+b)      (6.4)

6.2 Example 2:

((d^2)/(d(t^2)))x[t] +2 (d/(dt))x[t]+5 x[t]==3             (6.5a)
The initial condition is:                 x[(SuperMinus[0])]=0       ;         (d/(dt))x[(SuperMinus[0])]=0             (6.5b)

Step 1: Apply LT theorems to perform LT of the DE. We define X[s] be the LT of x[t].
                                                    ℒ[ ((d^2)/(d(t^2)))x[t] ] = (s^2) X[s]-(s x[(SuperMinus[0])]+(x^((1)))[(SuperMinus[0])])       
                                                                        = (s^2) X[s]                               (6.6a)                                                    
                                                    ℒ[ (d/(dt))x[t] ] = s X[s]-x[(SuperMinus[0])]
                        =s X[s]                     (6.6b)
                                                     ℒ[ x[t] ] = X[s]                                        (6.6c)    
                                                      ℒ[ 3] = (3/s)                                                 (6.6d)

Step 2: Substitute various expression to obtain an equation for X[s]
                                        (s^2) X[s] +2s X[s] +5X[s] ==(3/s)                            (6.7)
Now, let’s solve for X[s]

Solve[(s^2) X +2s X +5X==(3/s)  ,X]

Step 3: Use inverse LT to obtain x[t]

InverseLaplaceTransform[(3/(s ((s^2)+2 s+5))), s, t]

FullSimplify[%]

Hence, the solution is:        x[t]= (3/5)-(3/10) (e^(-t)) (sin(2 t)+2 cos(2 t))            (6.8)

Manipulate[Plot[(3/5)-(3/10) (E^(-α t)) (sin(2 ω t)+2 cos(2 ω t)), {t,0,10}, PlotRange-> {-0.2,1.5}, Frame-> True, GridLines-> Automatic, PlotStyle-> {Thick,Red}]
,{{α,1},0,4},{ω,1,5}]

7. More about LT techniques of polynomial rational

As discussed in 2.5, there are a number of basic features of LT of the class of functions we encounter in control engineering. It is useful to examine some of them here for later applications.

App for general discussion of the section

7.1 Poles and zeros

From (5.3), we will often see expression of the type:
                                                 H[z]=((P[z])/(Q[z]))=(((∏_(l=1)^N)(((z-(Subscript[β, l])))^(Subscript[p, l])))/((∏_(k=1)^M)(((z-(Subscript[α, k])))^(Subscript[q, k]))))                                      (5.3)
which represents the response of a system. β’s are the zeros and α are the poles. The zeros are relevant only to the amplitude of the response, but the poles, (which are the zeros of Q[z]) is more important as they determine the behavior of the response. Let’s look at some examples.

7.1.1 Example 1

Consider:                                              H[s]=((P[s])/(Q[s]))=((2 s +25)/(s ((s^2)+ 4 s +25)))                             (E7.1)
The poles can be found by solving: Q[s]==0

Z= s /. Solve[s ((s^2)+4 s+25 )==0, s]

Here they are on the complex plane.

CPPlot[Z,,{0.005,0.05,0.12},,]

7.1.2 Example 2

Consider:                                              H[s]=((P[s])/(Q[s]))=(((s^2) -2 s +a)/((((s+1))^2) (c (s^3)+ b s +a)))                             (E7.2)
The poles can be found by solving: Q[s]==0. See App that design general transfer function

Review various concepts:
- High-order poles
- Conjugate poles.
- Poles with real part in the positive side (right half CP) and negative side (left half CP).

7.2 Factoring a rational

We can write a code that follows step by step recipe to factor and separate apart a polynomial rational into a sum of single-pole terms:

7.2.1 Example 1

W=DecompLT[(( s +8)/( s ( (s^2)+3 s+8) )),"s", 1]

We can verify the factoring into simple pole terms:

FullSimplify[(2/((Sqrt[23]) (-2 I s+(Sqrt[23])-3 I)))+(2/((Sqrt[23]) (2 I s+(Sqrt[23])+3 I)))+(1/s)-((16 I)/((23 I-3 (Sqrt[23])) s+7 (Sqrt[23])+69 I))-((16 I)/((23 I+3 (Sqrt[23])) s-7 (Sqrt[23])+69 I))]

Indeed it is correct.
The last line gives us the inverse LT of each term
(e^(-((3/2)+((i (Sqrt[23]))/2)) t)),(e^(-((3/2)-((i (Sqrt[23]))/2)) t)),1,(e^(-(1/2) (3-i (Sqrt[23])) t)),(e^(-(1/2) (3+i (Sqrt[23])) t))
And each inverse LT is multiplied with a coefficient:
(i/(Sqrt[23])),-(i/(Sqrt[23])),1,-(1/2)+((3 i)/(2 (Sqrt[23]))),-(1/2)-((3 i)/(2 (Sqrt[23])))

We can see the plot of the poles:

W=DecompLT[(( s +8)/( s ((s^2)+3 s+8) )),"s",]  ;
CPPlot[W[[1]],,{0.0075,0.07,0.075},,]

7.2.2 Example 2

W=DecompLT[((4 s +35)/( s (2 (s^3)+13 (s^2)+34 s+35) )),"s", 1]

W=DecompLT[((4 s +35)/( s (2 (s^3)+13 (s^2)+34 s+35) )),"s", ] ;
CPPlot[W[[1]],,{0.01,0.05,0.15},,]

7.2.3 Example 3

W=DecompLT[(((s^2) +5)/( s (((s+1))^2) ((s^2)+2 s+4) )),"s", 1]

7.3 Signal and response from inverse LT

As we see in 2.6, the inverse LT is usually the solution to the signal or system response that we are seeking. We see that any polynomial rational can be decomposed into terms with single poles:
    H[z]=((P[z])/(Q[z]))=(((∏_(l=1)^N)(((z-(Subscript[β, l])))^(Subscript[p, l])))/((∏_(k=1)^M)(((z-(Subscript[α, k])))^(Subscript[q, k]))))=(∑_k)(∑_(m=1)^(Subscript[q, k]))((Subscript[A, k;m])/(((z-(Subscript[α, k])))^m))              (5.4)
and the inverse LT of any expression (1/(z-α)) is simply:

InverseLaplaceTransform[(1/(s-α)),s,t]

α is generally complex: α=-σ+i ω

(E^(α t)) /. α-> -σ+I ω

Thus, we obtain a crucial result: the response of any control system of which the LT can be represented by a polynomial rational is a sum of exponential functions, (e^(-σ t +i ω t)). Depending on the poles, the response can be purely exponential in real term, or harmonic (sine, cosine) or a product of both.
Although we use complex quantities, we know that the physical response is always real. All the poles and coefficients are conjugate of each other and their sum is a real number:

FullSimplify[(a+I b) (E^(-t (σ+I ω))) +(a-I b) (E^(-t (σ-I ω))) ]

We can write further:  2 (e^(σ (-t))) (a cos(t ω)+b sin(t ω))=2 (e^(-σ t)) b ((a/b)cos(t ω)+sin(t ω))
                                                             =2 (e^(-σ t)) b (((Sin[ϕ])/(Cos[ϕ]))cos(t ω)+sin(t ω))
                                                              =2 (e^(-σ t)) (b/(Cos[ϕ])) sin(t ω+ϕ)
                                                              =2 (e^(-σ t)) (Sqrt[(a^2)+(b^2)]) sin(t ω+ϕ)
Sometime, we define:              σ≡ζ ω

Manipulate[Plot [{UnitStep[t]*(E^(-ζ ω t ))
,-UnitStep[t]*(E^(-ζ ω t ))
, UnitStep[t]*  c[t,ζ,ω, ϕ]},{t,-0.1 tmax,tmax}, PlotRange-> All, Frame-> True, GridLines-> Automatic,PlotStyle-> {Dashed, Dashed,{Red, Thickness[0.005]},{Blue, Thickness[0.0075]}}], {{ω,1,frequency},1,10},{{ζ,0.1, damping factor},0,1},{{ϕ,0,phase},0,2 π},{tmax,10,100}
,Initialization:>{
c[t_,ζ_,ω_, ϕ_]:=(E^(-ζ ω t ))Sin[t ω+ϕ]  ;
}
]

Consider the case below. Discussion?

Manipulate[Plot [{UnitStep[t]*(E^(-ζ ω t ))
,-UnitStep[t]*(E^(-ζ ω t ))
, UnitStep[t]*  c[t,ζ,ω, ϕ]},{t,-0.1 tmax,tmax}, PlotRange-> All, Frame-> True, GridLines-> Automatic,PlotStyle-> {Dashed, Dashed,{Red, Thickness[0.005]},{Blue, Thickness[0.0075]}}], {{ω,1,frequency},1,10},{{ζ,-0.1},-1,0},{{ϕ,0,phase},0,2 π},{tmax,10,100}
,Initialization:>{
c[t_,ζ_,ω_, ϕ_]:=(E^(-ζ ω t ))Sin[t ω+ϕ]  ;
}
]