0% found this document useful (0 votes)
54 views8 pages

Laplace - Lecture Juvgnhf Lectura

This document discusses piecewise defined functions and using the Laplace transform to solve differential equations with piecewise defined forcing terms. It provides examples of representing piecewise functions using Heaviside functions and calculating their Laplace transforms. It also gives examples of taking the inverse Laplace transform of various functions to solve differential equations.

Uploaded by

Heisy Mayen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views8 pages

Laplace - Lecture Juvgnhf Lectura

This document discusses piecewise defined functions and using the Laplace transform to solve differential equations with piecewise defined forcing terms. It provides examples of representing piecewise functions using Heaviside functions and calculating their Laplace transforms. It also gives examples of taking the inverse Laplace transform of various functions to solve differential equations.

Uploaded by

Heisy Mayen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Piecewise defined functions and the Laplace transform

We look at how to represent piecewise defined functions using Heavised functions, and use
the Laplace transform to solve differential equations with piecewise defined forcing terms.
We repeatedly will use the rules: assume that L(f (t)) = F (s), and c ≥ 0. Then

L uc (t)f (t − c) = e−cs F (s) , L−1 e−cs F (s) = uc (t)f (t − c),


 

where
(
0, t < c
L uc (t) = e−cs .

uc (t) = ,
1, t ≥ c

For example, consider


(
0, 0≤t≤2
f (t) =
t − 2, 2 ≤ 2 < ∞
which is plotted as follows:

2
f (t)

0 1 2 3 4 5
t
It is pretty easy to see that
f (t) = u2 (t)(t − 2)
Let’s calculate its Laplace transform. We know from formula 3 with n = 1 that L(t) = 1/s2 ,
so
e−2s
L(f (t)) = 2 .
s
Consider the following function:


 t, 0≤t≤1

1, 1≤t≤2
f (t) =

 3 − t, 2≤t≤3

0 3≤t<∞

which is plotted as follows:


2

1
f (t)

−1
0 1 2 3 4 5
t
To write this using the Heaviside functions, lets go step by step from left to right. We
start off with the function t. At t = 1, we subtract t − 1 to get t − (t − 1) = 1. At time 2, we
subtract t − 2 to get 1 − (t − 2) = 3 − t. Then at t = 3 we add t − 3 to get (3 − t) + (t − 3) = 0.
So,
f (t) = t − u1 (t)(t − 1) − u2 (t)(t − 2) + u3 (t)(t − 3),
and
1 e−s e−2s e−3s 1 
L(f (t)) = 2 − 2 − 2 + 2 = 2 1 − e−s − e−2s + e−3s .
s s s s s
Sometimes you need to rewrite the function a bit to recognize that it is in delayed form.
For example, consider
u2 (t) (t − 3).
We want to write this in the form u2 (t)f (t−2) in order to use rule 13. To avoid problems, let’s
temporarily think of f as a function of u. We then want to find f (u) so that f (t − 2) = t − 3.
Letting u = t − 2 is the same as t = u + 2, so we see that
f (u) = u − 1
In short, we are writing

u2 (t)(t − 3) = u2 (t) (t − 2) − 1 = u2 (t)(t − 2) − u2 (t).
Then
 e−2s e−2s
L u2 (t) (t − 3) = 2 −
s s
where we use
1 1
L(t) =
2
, L(1) = .
s s
As a more complicated example, consider the problem of writing
u1 (t) sin(t) = u1 (t)f (t − 1)
Introducing a variable u = t − 1 , t = u + 1, we want f (u) = sin(u + 1). To calculate the
Laplace transform of u1 (t) sin(t), we have the problem that there is not an entry in the tables
for the Laplace transform of sin(u + 1). So we need to use trig identities to write
sin(u + 1) = cos(1) sin(u) + sin(1) cos(u)
leading to the formula
sin(t) = cos(1) sin(t − 1) + sin(1) cos(t − 1).
We then obtain the final answer to our problem
 
L u1 (t) sin(t) = L u1 (t) cos(1) sin(t − 1) + u1 (t) sin(1) cos(t − 1)
 
= cos(1)L u1 (t) sin(t − 1) + sin(1)L u1 (t) cos(t − 1)
e−s se−s
= cos(1) + sin(1)
s2 + 1 s2 + 1

Inverse Laplace transforms


Now let’s do some inverse Laplace transforms. Consider
s e−πs
F (s) = .
s2 + 4
 
We recognize that L−1 1
s2 +4
= sin(2t), hence
 e−πs 
L−1 = uπ (t) sin(2(t − π)) = uπ (t) sin(2t − 2π).
s2 + 4
Since sin(2t − 2π) = sin(2t), this also equals uπ (t) cos(2t), but in most examples things won’t
work out so nicely. We can plot this

2
1
f (t)

0
−1
−2 π
0 2π 3π 4π 5π
t
Now let’s work out L−1 (F (s)) where
s e−3s
F (s) = .
(s2 + 4)(s2 + 2s + 2)
We carry out partial fractions on the rational part (at this step ignore the exponential)
1
s 6
s + 32 − 16 s − 13
= + 2
(s2 + 4)(s2 + 2s + 2) s2 + 4 s + 2s + 2
We then split F (s) into the two terms. For the first term, we calculate
 ( 1 s + 2 )e−3s  1  s  1 −1  −3s 2 
L−1 6 3
= L−1
e −3s
+ L e
s2 + 4 6 s2 + 4 3 s2 + 4
1 1
= u3 (t) cos(2(t − 3)) + u3 (t) sin(2(t − 3)).
6 3
For the second term, we need to complete the square and simplify to use the tables,
− 61 s − 13 − 61 s − 13 − 16 (s + 1) − 16
= = +
s2 + 2s + 2 (s + 1)2 + 1 (s + 1)2 + 1 (s + 1)2 + 1
We multiply by e−3s and take the inverse Laplace transform,
 (− 1 s − 1 )e−3s  1 −1  −3s s+1  1  1 
−1 6 3 −1 −3s
L =− L e − L e
s2 + 2s + 1 6 (s + 1)2 + 1 6 (s + 1)2 + 1
1 1
= − u3 (t)e−(t−3) cos(t − 3) − u3 (t)e−(t−3) sin(t − 3).
6 6

A nice long example!


We will now carry out a problem, start to finish, with a function we looked at in lecture.
The problem is long, but you should be able to follow each step and see how to get from one
to the next. Recall the following function from lecture:


 0, t < 1
1, 1 ≤ t < 2,



f (t) = 2, 2 ≤ t < 3,




 3, 3 ≤ t < 4,
0, 4 ≤ t < ∞

which is plotted as follows:

2
f (t)

0 1 2 3 4 5 6 7
t
We write f (t) = u1 (t) + u2 (t) + u3 (t) − 3u4 (t). To understand this formula, note that at
time t = 1 the function f (t) increases by 1, then at time t = 2 it increases by 1 more, then
at time t = 3 it increases by 1 more, then at time t = 4 it decreases by 3.
By the linearity of the Laplace transform and the formula L uc (t) = e−cs , we calculate


 e−s e−2s e−3s 3e−4s 1  −s 


L f (t) = + + − = e + e−2s + e−3s − 3e−4s .
s s s s s
Now let’s solve the following equation:
y 00 + 2y 0 − 3y = f (t), y(0) = 1, y 0 (0) = 2.
We take the Laplace transform of both sides, using rule 18. Assume L(y(t)) = Y (s). Then
the equation becomes
1  −s 
s2 Y (s) − sy(0) − y 0 (0) + 2 sY (s) − y(0) − 3Y (s) = e + e−2s + e−3s − 3e−4s .
 
s
Inserting the values for y(0) and y 0 (0) we get
1  −s 
(s2 + 2s − 3)Y (s) − s − 4 = e + e−2s + e−3s − 3e−4s
s
We solve for Y (s) to obtain
s+4 1 
−s −2s −3s −4s

Y (s) = 2 + e + e + e − 3e .
s + 2s − 3 s(s2 + 2s − 3)
We next apply partial fractions to simplify the rational functions we see. For the first term,
s+4 s+4 5 1 1 1
2
= = −
s + 2s − 3 (s + 3)(s − 1) 4 (s − 1) 4 (s + 3)
Using formula 2, we then obtain
 s+4  5 1
L−1 2 = et − e−3t .
s + 2s − 3 4 4
You might note that this is the homogeneous solution satisfying y(0) = 1, y 0 (0) = 2.
We next find the inverse Laplace transform of the second term. We need to apply partial
fractions only to the rational part; the exponentials in the parentheses don’t come up at this
step. So, we write
1 1 1 1 1 11
2
= + − .
s(s + 2s − 3) 4 (s − 1) 12 (s + 3) 3 s
Then  et e−3t 1
−1
 1
L = + − .
s(s2 + 2s − 3) 4 12 3
We then get the following (somewhat long) formula
−1
 1 −s −2s −3s −4s

L e + e + e − 3e =
s(s2 + 2s − 3)
 et−1 e−3(t−1) 1   et−2 e−3(t−2) 1 
u1 (t) + − + u2 (t) + −
4 12 3 4 12 3
 et−3 e−3(t−3) 1   et−4 e−3(t−4) 1 
+ u3 (t) + − − 3u4 (t) + − .
4 12 3 4 12 3
The solution to the original IVP equals this plus the first term 5
4
et − 1
4
e−3t .
Advanced example: square wave forcing.

This is an advanced example to illustrate the power of using the Laplace transform (and
no, it won’t be on the final exam). We consider driving an undampened harmonic oscillator
by a square wave that has the same period as the homogeneous solution. The square wave
is a step function approximation to cos(t):

2
1
f (t)

0
−1
−2 π
0 2π 3π 4π 5π 6π 7π 8π 9π
t

We can represent the square wave as a sum of Heaviside functions:

f (t) = u0 (t) − 2uπ (t) + 2u2π (t) − 2u3π (t) + 2u4π (t) − 2u5π (t) + 2u6π (t) − 2u7π (t) + · · ·

You can imagine that the wave stops after a finite number of terms so we don’t have to
worry about infinite sums, but the following steps don’t require that. We first calculate the
Laplace transform of f (t):

L(f (t)) = L(u0 (t)) − 2L(uπ (t)) + 2L(u2π (t)) − 2L(u3π (t)) + 2L(u4π (t)) − 2L(u5π (t))

1 2e−πs 2e−2πs 2e−3πs 2e−4πs 2e−5πs


= − + − + − + ···
s s s s s s
1 
= 1 − 2e−πs + 2e−2πs − 2e−3πs + 2e−4πs − 2e−5πs + · · ·
s

Now suppose we want to solve the equation


y 00 + y = f (t), y(0) = 0, y 0 (0) = 0.
Taking the Laplace transform of both sides leads to the equation for Y (s) = L(y(t)),
2 1 −πs −2πs −3πs −4πs −5πs

(s + 1)Y (s) = 1 − 2e + 2e − 2e + 2e − 2e + ···
s

We divide by s2 + 1 and apply partial fractions to write


1 1 1 s
= − 2 ,
s2 +1 s s s +1
and obtain the formula for Y (s):
1 
Y (s) = 1 − 2e−πs + 2e−2πs − 2e−3πs + 2e−4πs − 2e−5πs + · · ·
s
s  −πs −2πs −3πs −4πs −5πs

− 2 1 − 2e + 2e − 2e + 2e − 2e + ···
s +1
If we take the inverse Laplace transform, we get the following formula for y(t):
y(t) = u0 (t) − 2uπ (t) + 2u2π (t) − 2u3π (t) + · · ·

− cos(t) + 2uπ (t) cos(t − π) − 2u2π (t) cos(t − 2π) + 2u3π cos(t − 3π) − · · ·

We next use cos(t − π) = − cos(t), cos(t − 2π) = cos(t), et cetera to write this as
y(t) = u0 (t) − 2uπ (t) + 2u2π (t) − 2u3π (t) + · · ·

− cos(t) u0 (t) + 2uπ (t) + 2u2π (t) + 2u3π (t) + · · ·

This is a little complicated, but you can see that the first line is just f (t), and bounces
between 1 and −1. The second line is cos(t) times a function that jumps by 2 each time t
increases by π, so it will grow proportional to t, just like resonant driving.
On the following page we compare square wave forcing to cos(t) forcing (both forcing
terms at the same frequency as the homogeneous frequency). They look qualitatively the
same, but a close inspection shows some differences. The physical explanation for why the
solution for the square wave force grows faster is that the square wave contains more energy
than the cosine wave.
Square wave forcing:
Solution to y 00 + y = f (t), y(0) = 0, y 0 (0) = 0, where f (t) is the square wave.

20

15

10

5
y(t)

−5

−10

−15

0 π 2π 3π 4π 5π 6π 7π 8π 9π
t

Resonant forcing:
The solution to y 00 + y = cos(t), y(0) = 0, y 0 (0) = 0, is given by y = 21 t sin t.

15

10

5
.5 ∗ t ∗ sin(t)

−5

−10

0 π 2π 3π 4π 5π 6π 7π 8π 9π
t

You might also like