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
and the "backward" version
Moreover, Sections6.8 showed that
, the convolution product of
and
could be obtained as the inverse Laplace transform of
, the product of the Laplace transforms of
and
. The present Sectionswill again demonstrate how to use the convolution theorem to compute the convolution product of two functions
and
. 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
to
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
, where
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
and
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
and
Thus,
so the desired convolution is
=
as determined by the Second Shifting Law applied in conjunction with the transform
.
To implement these calculations in Maple, enter the factors
>
f := t^2;
g := Heaviside(t - 1);
>
Then, obtain
, the product of the Laplace transforms of
and
, getting
> `L[f*g]` := laplace(f,t,s)*laplace(g,t,s);
>
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));
>
A graph of the ordinary product
and the convolution product
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]);
>
The ordinary product, namely,
, 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);
> q1 := value(q);
>
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);
>
The best way to deal with the signum function in our answer is to convert it to Heaviside functions.
> q2 := convert(q1, Heaviside);
>
Now, factoring yields the previous solution.
> factor(q2);
>
Using the Definition of Convolution
Direct evaluation of the convolution integral
requires a delicacy that starts with an analysis of the integrand. First, it is far easier to shift
to
in the function
than it is in the Heaviside function. Second, because of the Heaviside function, the integrand is nonzero for
. Third, the very definition of integration requires
throughout the interval of integration. The region in the
-plane satisfying both these constraints is shaded in Figure 6.31, obtained below. A representative arrow shows the path of integration for fixed
.
Since the integration requires
, if
, then
and
. Hence, the integral yields the value 0 for
. For
, the integral is
so the convolution is again
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
-plane satisfying the inequalities
and
The first is from the meaning of the integral
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]);
>
The integration requires 0 <
x
<
t
, so if
t
< 1, then
x
< 1 and
. Hence, the integral yields the value 0 for
t
< 1. In fact,
* Heaviside(t-1) =
=
Since, for
,
we have
*
=
=
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
*
by using (a) the Convolution Theorem, and (b) the defining integral for convolution.
By the Convolution Theorem
To use the convolution theorem
or actually,
obtain
>
F := laplace(Heaviside(t-1),t,s);
G := laplace(Heaviside(t-2),t,s);
>
The resulting convolution
=
is computed by applying the Second Shifting Law in reverse to the transform
.
In Maple, the multiplication and inversion steps would be as follows.
> `f * g` := factor(invlaplace(F*G,s,t));
>
By the Convolution Integral
The integrand of the convolution integral
is nonzero for that region in the
-plane in which the inequalities
and
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
. The integrand is 0 if
. Hence, the integral is 0 for
. For
the integrand is 1 for
and the convolution integral is
Consequently, the convolution is again
=
In Maple, the integrand
> q := Heaviside(x-1)*Heaviside(t-x-2);
>
presents a significant challenge. Maple finds the integral
> `H1 * H2` := Int(q,x=0..t);
>
difficult to interpret since it cannot easily unravel the tangled skein of conditionals hiding in this integral. Indeed,
> value(`H1 * H2`);
>
returns unevaluated.
In the
-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]);
>
The convolution integral is evaluated by first fixing
, and then integrating along the line
in the
-plane.
The integrand is 0 if
. Hence, the integral is 0 for
. This is expressed by the function
that appears in the solution
> `f * g`;
>
For
the integrand is 1 between
and
. Hence,
> int(1,x=1..t-2);
>
That's where the
comes from in the answer.
>
Example 6.36
Obtain the convolution product of two unit pulses of duration
, one starting at
and one starting at
. 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);
>
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]);
>
By the Convolution Theorem
To compute the convolution by Laplace transforms and the convolution theorem, obtain
and
by using Maple:
>
F := laplace(f,t,s);
G := laplace(g,t,s);
>
Then, invert the product of transforms
The Second Shifting Law applied in reverse to the transform
then gives the desired convolution.
In Maple, this is done via
> `f * g` := collect(invlaplace(F*G,s,t), Heaviside);
>
Moreover, by converting to a piecewise format we can see the convolution product defined by subintervals. Thus,
> convert(`f * g`, piecewise);
>
A graph of the convolution
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]);
>
By the Convolution Integral
Evaluating the convolution integral
requires knowing where, in the
-plane, both
and
are simultaneously nonzero. Hence, the inequalities
must all be satisfied. This region is shaded in Figure 6.35, generated below. Horizontal lines represent typical paths of integration along lines
. Any such line for which
or
yields a zero integrand, and a value of zero for the convolution. Any such line between
and
yields an integrand of 1 and a value for
which will be determined by the integral
Any such line between
and
also yields an integrand of 1 and a value for
which will be determined by the integral
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]);
>
in which the support of the integrand is the red parallelogram whose bounding edges are the lines
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);
>
Integration takes place along a line
. Any such line for which
or
yields a zero integrand, and a value of zero for the convolution. Any such line between
and
yields an integrand of 1 and a value for
which will be determined by the integral
> q1 := Int(1,x=1..t-3);
>
which evaluates to
> q2 := value(q1);
>
Any such line between
and
also yields an integrand of 1 and a value for the convolution
which will be determined by the integral
> q3 := Int(1,x=t-4..2);
>
which evaluates to
> q4 := value(q3);
>
Hence, a piecewise definition of the convolution would be
> q3 := piecewise(t<=4,0, t<=5,q2, t<=6,q4, t>6,0);
>
which is precisely what we got by use of the convolution theorem.
>