Sections06-09.mws

Unit 1: Ordinary Differential Equations - Part 1

Chapter 6: The Laplace Transform

Sections6.9: convolution products by the convolution theorem

Copyright

Copyright * 2001 by Addison Wesley Longman, Inc.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America.

Initializations

> restart;

> with(inttrans):
with(plots):
with(plottools):
with(student):

Warning, the name changecoords has been redefined

> read(`C:/Program Files/Maple 6.01/pvac.txt`):

Computing Convolutions by the Convolution Theorem

Sections6.8 presented the definition of the convolution product, and demonstrated how to obtain this product by performing one of two alternate versons of the convolution integral. In addition, Sections6.8 revealed the convolution theorem whereby the product of two Laplace transforms is the transform of the convolution. In symbols we wrote both the "forward" version

L*[f*`*`*g] = F(s)*G(s)

and the "backward" version

L^`-1`*[F(s)*G(s)] = f*`*`*g

Moreover, Sections6.8 showed that f*`*`*g , the convolution product of f(t) and g(t) could be obtained as the inverse Laplace transform of F(s)*G(s) , the product of the Laplace transforms of f(t) and g(t) . The present Sectionswill again demonstrate how to use the convolution theorem to compute the convolution product of two functions f(t) and g(t) . In particular, we will be interested in cases where at least one of the two functions is a piecewise-defined function, especially one in which Heaviside functions appear.

When a factor in a convolution product is piecewise-defined, shifting the argument from t to t-x in the convolution integral can be subtle because such functions don't have a single formula for their definition. The inequalities in the piecewise-defined function and the inequality 0 < x `` < t , where x is the varaible of integration, can be a challenge to coordinate.

The method explored here is the use of the convolution theorem which takes both functions to the frequency domain, uses ordinary multiplication instead of convolution, then inverts back out of the frequency domain to the time domain.

We illustrate with the following examples.

Example 6.34

Compute the convolution of t^2 and Heaviside(t-1) by using (a) the convolution theorem, and (b) the defining integral for convolution. The point of the example is to demonstrate how much easier the convolution theorem is to apply than direct integration, especially when one of the factors in the convolution is a piecewise-defined function like the Heaviside function.

Using the Convolution Theorem

The convolution theorem says the Laplace transform of the convolution is the product of the transforms

L*[t^2] = 2/(s^3)

and

L*[Heaviside(t-1)] = exp(-s)/s

Thus,

L*[t^2*Heaviside(t-1)] = 2*exp(-s)/(s^3)

so the desired convolution is

t^2*`*`*Heaviside(t-1) = L^`-1`*[2*exp(-s)/(s^3)] = 1/3 (t-1)^3*Heaviside(t-1)

as determined by the Second Shifting Law applied in conjunction with the transform L*[t^3] = 6/(s^4) .

To implement these calculations in Maple, enter the factors

> f := t^2;
g := Heaviside(t - 1);

f := t^2

g := Heaviside(t-1)

>

Then, obtain F(s)*G(s) , the product of the Laplace transforms of f(t) and g(t) , getting

> `L[f*g]` := laplace(f,t,s)*laplace(g,t,s);

`L[f*g]` := 2*exp(-s)/(s^4)

>

Since this is the transform of the convolution, we need only invert this transform to obtain the desired convolution product.

> `f*g` := factor(invlaplace(`L[f*g]`, s, t));

`f*g` := 1/3*Heaviside(t-1)*(t-1)^3

>

A graph of the ordinary product f(t)*g(t) and the convolution product f*`*`*g is revealing.

> p1 := plot(f*g, t=0..3, discont=true, color=red, thickness=3, title = `f(t) g(t)`):
p2 := plot(`f*g`, t = 0..3, color=green,thickness=3, title = `f * g`):
display(array(1..2,[p1,p2]),xtickmarks=2, font=[TIMES,ROMAN,12]);

[Maple Plot]

>

The ordinary product, namely, f(t)*g(t) = t^2*Heaviside(t-1) , appears in red on the left. The convolution, in green, appears on the right. The two products are indeed different.

Doing a convolution integral for piecewise-defined functions is tricky. Maple allows the convolution integral to be computed directly in terms of Heaviside functions, but it still requires care to get the answer to come out right.

> q := Int((t-x)^2*Heaviside(x-1),x=0..t);

q := Int((t-x)^2*Heaviside(x-1),x = 0 .. t)

> q1 := value(q);

q1 := 1/3*Heaviside(t-1)*t^3-Heaviside(t-1)*t^2+Hea...

>

The signum function is a mathematical object that Maple understands and uses. A plot of the signum function is the best explanation.

> plot(signum(x),x=-1..1);

[Maple Plot]

>

The best way to deal with the signum function in our answer is to convert it to Heaviside functions.

> q2 := convert(q1, Heaviside);

q2 := 1/3*Heaviside(t-1)*t^3-Heaviside(t-1)*t^2+Hea...

>

Now, factoring yields the previous solution.

> factor(q2);

1/3*Heaviside(t-1)*(t-1)^3

>

Using the Definition of Convolution

Direct evaluation of the convolution integral

L*[t^2*`*`*Heaviside(t-1)] = Int(Heaviside(x-1)*(t-...

requires a delicacy that starts with an analysis of the integrand. First, it is far easier to shift t to t-x in the function t^2 than it is in the Heaviside function. Second, because of the Heaviside function, the integrand is nonzero for x-1*`>`*0 . Third, the very definition of integration requires 0 < x `` < t throughout the interval of integration. The region in the xt -plane satisfying both these constraints is shaded in Figure 6.31, obtained below. A representative arrow shows the path of integration for fixed t .

Since the integration requires 0 < x `` < t , if t < 1 , then x < 1 and Heaviside(t-1) = 0 . Hence, the integral yields the value 0 for t < 1 . For t*`>`*0 , the integral is

Int((t-x)^2,x = 1 .. t) = 1/3 (t-1)^3

so the convolution is again

1/3 t^2*`*`*Heaviside(t-1) = (t-1)^3*Heaviside(t-1)

The hard part of this computation is sketching Figure 6.31 which shows the region of integration. The tools Maple provides for this task are now illustrated.

The region of integration is that portion of the xt -plane satisfying the inequalities

0 < x `` < t

and

x-1*`>`*0

The first is from the meaning of the integral

L*[t^2*`*`*Heaviside(t-1)] = Int(Heaviside(x-1)*(t-...

and the second is from the Heaviside function in the integrand. Where this inequality is valid, the Heaviside function is 1.

To create Figure 6.31, execute the following Maple code, the essence of which is the inequal command which plots a region in the plane satisfying a set of linear inequalities.

> p1:=inequal({t>x,x-1>0}, x=0..3,t=0..3,
optionsfeasible=(color=yellow),
optionsexcluded=(color=white),
optionsopen=(color=black,thickness=3), xtickmarks=3,ytickmarks=3, labels=[x,t]):
p2:=arrow([1,2.5],[2.47,2.5],.07,.2,.1,color=black):
p3:=textplot({[1.2,.95,`(1,1)`],[2.3,2,`t = x`]},font=[TIMES,ROMAN,10]):
display([p||(1..3)], labels=[x,t],labelfont=[TIMES,ITALIC,12]);

[Maple Plot]

>

The integration requires 0 < x < t , so if t < 1, then x < 1 and Heaviside(x-1) = 0 . Hence, the integral yields the value 0 for t < 1. In fact,

t^2 * Heaviside(t-1) = Int((t-x)^2*Heaviside(x-1),x = 0 .. t) = PIECEWISE([0, t < 1],[Int((t-x)^2,x = 1 .. t), 1 <=...

Since, for 1 <= t ,

Int((t-x)^2,x = 1 .. t) = (t-1)^3/3

we have

t^2 * Heaviside(t-1) = PIECEWISE([0, t < 1],[(t-1)^3/3, 1 <= t])

= (t-1)^3/3 Heaviside(t-1)

Computing a convolution in which one of the factors is piecewise defined requires careful analysis of the inequalities involved. It is far simpler to use the convolution theorem.

>

Example 6.35

Obtain the convolution product

Heaviside(t-1) * Heaviside(t-2)

by using (a) the Convolution Theorem, and (b) the defining integral for convolution.

By the Convolution Theorem

To use the convolution theorem

L*[f*`*`*g] = F(s)*G(s)

or actually,

f*`*`*g = L^`-1`*[F(s)*G(s)]

obtain

> F := laplace(Heaviside(t-1),t,s);
G := laplace(Heaviside(t-2),t,s);

F := exp(-s)/s

G := exp(-2*s)/s

>

The resulting convolution

Heaviside(t-1)*`*`*Heaviside(t-2) = L^`-1`*[exp(-3*... = (t-3)*Heaviside(t-3)

is computed by applying the Second Shifting Law in reverse to the transform L*[t] = 1/(s^2) .

In Maple, the multiplication and inversion steps would be as follows.

> `f * g` := factor(invlaplace(F*G,s,t));

`f * g` := Heaviside(t-3)*(t-3)

>

By the Convolution Integral

The integrand of the convolution integral

Int(Heaviside(x-1)*Heaviside(t-x-2),x = 0 .. t)

is nonzero for that region in the xt -plane in which the inequalities

x-1*`>`*0

and

t-x-2*`>`*0

are satisfied. This region is shaded in Figure 6.32, created below. A representative arrow indicates a path of integration for a fixed value of t . The integrand is 0 if t < 3 . Hence, the integral is 0 for t < 3 . For t*`>`*0 the integrand is 1 for

1 < x `` < t-2

and the convolution integral is

Int(1,x = 1 .. t-2) = t-3

Consequently, the convolution is again

Heaviside(t-1)*`*`*Heaviside(t-2) = (t-3)*Heaviside(t-3)

In Maple, the integrand

> q := Heaviside(x-1)*Heaviside(t-x-2);

q := Heaviside(x-1)*Heaviside(t-x-2)

>

presents a significant challenge. Maple finds the integral

> `H1 * H2` := Int(q,x=0..t);

`H1 * H2` := Int(Heaviside(x-1)*Heaviside(t-x-2),x ...

>

difficult to interpret since it cannot easily unravel the tangled skein of conditionals hiding in this integral. Indeed,

> value(`H1 * H2`);

int(Heaviside(x-1)*Heaviside(t-x-2),x = 0 .. t)

>

returns unevaluated.

In the xt -plane, the region over which the integration takes place can be visualized via Figure 6.32, created by

> p1:=inequal({t-2>x,x-1>0}, x=0..5,t=0..7,
optionsfeasible=(color=yellow),
optionsexcluded=(color=white),
optionsopen=(color=black,thickness=3), xtickmarks=5,ytickmarks=7, labels=[x,t]):
p2:=arrow([1,5],[2.91,5],.07,.2,.1,color=black):
p3:=textplot({[1.4,2.8,`(1,3)`],[4.7,6,`x = t - 2`]},font=[TIMES,ROMAN,10]):
display([p||(1..3)], scaling=constrained, labels=[x,`t `],labelfont=[TIMES,ITALIC,12]);

[Maple Plot]

>

The convolution integral is evaluated by first fixing t , and then integrating along the line t = constant in the xt -plane.

The integrand is 0 if t < 3 . Hence, the integral is 0 for t < 3 . This is expressed by the function Heaviside(t-3) that appears in the solution

> `f * g`;

Heaviside(t-3)*(t-3)

>

For 3 < t the integrand is 1 between x = 1 and x = t-2 . Hence,

> int(1,x=1..t-2);

t-3

>

That's where the t-3 comes from in the answer.

>

Example 6.36

Obtain the convolution product of two unit pulses of duration tau = 1 , one starting at t = 1 and one starting at t = 3 . These pulses, graphed in Figure 6.33, below, are represented in terms of Heaviside functions as

> f := Heaviside(t-1) - Heaviside(t-2);
g := Heaviside(t-3) - Heaviside(t-4);

f := Heaviside(t-1)-Heaviside(t-2)

g := Heaviside(t-3)-Heaviside(t-4)

>

Figure 6.33 is generated by

> plot([f,g], t=0..6, discont=true, color=black, scaling=constrained, xtickmarks=6, ytickmarks=2, labels=[t,``],labelfont=[TIMES,ITALIC,12]);

[Maple Plot]

>

By the Convolution Theorem

To compute the convolution by Laplace transforms and the convolution theorem, obtain

L*[f(t)] = (exp(-s)-exp(-2*s))/s

and

L*[g(t)] = (exp(-3*s)-exp(-4*s))/s

by using Maple:

> F := laplace(f,t,s);
G := laplace(g,t,s);

F := exp(-s)/s-exp(-2*s)/s

G := exp(-3*s)/s-exp(-4*s)/s

>

Then, invert the product of transforms

L*[f(t)]*L*[g(t)] = (exp(-4*s)-2*exp(-5*s)+exp(-6*s...

The Second Shifting Law applied in reverse to the transform L*[t] = 1/(s^2) then gives the desired convolution.

In Maple, this is done via

> `f * g` := collect(invlaplace(F*G,s,t), Heaviside);

`f * g` := Heaviside(t-6)*(t-6)+Heaviside(t-4)*(t-4...

>

Moreover, by converting to a piecewise format we can see the convolution product defined by subintervals. Thus,

> convert(`f * g`, piecewise);

PIECEWISE([0, t <= 4],[t-4, t <= 5],[6-t, t <= 6],[...

>

A graph of the convolution f*`*`*g is found in Figure 6.34, produced in Maple by

> plot(`f * g`, t = 0..7, thickness=3, color = red, scaling=constrained, xtickmarks=7, ytickmarks=2, labels=[t,``],labelfont=[TIMES,ITALIC,12]);

[Maple Plot]

>

By the Convolution Integral

Evaluating the convolution integral

f*`*`*g = Int([Heaviside(x-1)-Heaviside(x-2)]*[Heav...

requires knowing where, in the xt -plane, both f(x) and g(t-x) are simultaneously nonzero. Hence, the inequalities

x*`>`*1

x < 2

t-x*`>`*3

t-x < 4

must all be satisfied. This region is shaded in Figure 6.35, generated below. Horizontal lines represent typical paths of integration along lines t = constant . Any such line for which t < 4 or t*`>`*6 yields a zero integrand, and a value of zero for the convolution. Any such line between t = 4 and t = 5 yields an integrand of 1 and a value for f*`*`*g which will be determined by the integral

Int(1,x = 1 .. t-3) = t-4

Any such line between t = 5 and t = 6 also yields an integrand of 1 and a value for f*`*`*g which will be determined by the integral

Int(1,x = t-4 .. 2) = 6-t

These values are consistent with the results from the convolution theorem.

To determine the region of integration shown in Figure 6.35, we again use Maple's inequal command to obtain

> inequal({x>1,x<2,t-x-3>0,t-x-4<0}, x=0..5, t=0..7, optionsfeasible=(color=red), optionsopen=(color=blue,thickness=3), optionsexcluded=(color=yellow), labels=[x,t], labelfont=[TIMES,ROMAN,12]);

[Maple Plot]

>

in which the support of the integrand is the red parallelogram whose bounding edges are the lines

x = 1, x = 2, x = t-3, x = t-4

and whose vertices are the points (1,4), (2,5), (2,6), and (1,5). The red parallelogram is the region where the integrand has the value 1. Outside this region, the integrand has the value 0.

We then embellish the figure to create Figure 6.35, as follows.

> p5 := polygon([[1,4],[2,5],[2,6],[1,5],[1,4]], color=yellow, thickness=3):
p7 := plot({[[0,4.5],[5,4.5]],[[0,5.5],[5,5.5]]},color=black):
p8 := plot([x,x+4,x=0..6.5],color=black, thickness=3):
p9 := plot([x,x+3,x=0..3.5],color=black, thickness=3):
p10:= plot([1,x,x=0..7],color=black, thickness=3):
p11:= plot([2,x,x=0..7],color=black, thickness=3):
p6 := textplot({[1.65,3.75,`(1,4)`], [2.7,4.9,`(2,5)`], [1.9,6.1,`(2,6)`], [.85,5.1,`(1,5)`], [4.5,5.7,`t = 5.5`], [4.5,4.2,`t = 4.5`]}, align=LEFT):
display([p||(5..11)], view=[0..5,0..7], labels=[x,t], labelfont = [TIMES,ITALIC,12], scaling=constrained, xtickmarks=5, ytickmarks=7);

[Maple Plot]

>

Integration takes place along a line t = constant . Any such line for which t < 4 or 6 < t yields a zero integrand, and a value of zero for the convolution. Any such line between t = 4 and t = 5 yields an integrand of 1 and a value for f*`*`*g which will be determined by the integral

> q1 := Int(1,x=1..t-3);

q1 := Int(1,x = 1 .. t-3)

>

which evaluates to

> q2 := value(q1);

q2 := t-4

>

Any such line between t = 5 and t = 6 also yields an integrand of 1 and a value for the convolution f*`*`*g which will be determined by the integral

> q3 := Int(1,x=t-4..2);

q3 := Int(1,x = t-4 .. 2)

>

which evaluates to

> q4 := value(q3);

q4 := 6-t

>

Hence, a piecewise definition of the convolution would be

> q3 := piecewise(t<=4,0, t<=5,q2, t<=6,q4, t>6,0);

q3 := PIECEWISE([0, t <= 4],[t-4, t <= 5],[6-t, t <...

>

which is precisely what we got by use of the convolution theorem.

>