Convolution

we know \( \mathcal{L}\{f + g\} = \mathcal{L}\{f\} + \mathcal{L}\{g\} \)

but \( \mathcal{L}\{fg\} \ne \mathcal{L}\{f\}\mathcal{L}\{g\} \)

for example,

\[ \begin{aligned} \mathcal{L}\{1 \cdot 1\} &= \mathcal{L}\{1\} = \frac{1}{s} \\ \mathcal{L}\{1\}\mathcal{L}\{1\} &= \frac{1}{s} \cdot \frac{1}{s} = \frac{1}{s^2} \quad \text{clearly wrong.} \end{aligned} \]

but what is it? \( \mathcal{L}^{-1}\{FG\} = \; ? \)

Impulse Response

to understand that, we need to talk about impulse response

using a 1st-order as a simple example:

\[ y' + ky = \delta(t-c) \qquad y(0) = 0 \]

take Laplace transform

\[ sY - y(0) + kY = e^{-cs} \]

\( y(0) = 0 \) we get \( (s + k)Y = e^{-cs} \)

\[ \begin{aligned} Y &= e^{-cs}\frac{1}{s+k} \\ y(t) &= u_c(t) e^{-k(t-c)} \end{aligned} \]
t y c e-k(t-c) → e-kt shifted to the time the impulse happened
Figure: Shifted impulse response \( y(t) = u_c(t)e^{-k(t-c)} \)
Detailed description
Coordinate axes with horizontal axis \( t \) and vertical axis \( y \). A tick mark at \( t = c \) marks the impulse time. For \( t < c \), \( y(t) = 0 \). A vertical dotted line rises at \( t = c \) to a positive peak, after which the curve decays exponentially toward the \( t \)-axis. An arrow points to the curve with the note: \( e^{-k(t-c)} \to e^{-kt} \) shifted to the time the impulse happened.

\( e^{-kt} \) is how the system responds to an impulse regardless when the impulse happened (just shift to that time)

\( h(t) = e^{-kt} \) is called the impulse response (for \( y' + ky = \delta(t-c) \))

add another impulse

\[ \begin{aligned} y' + ky &= \delta(t-c) + \delta(t-d) \qquad y(0) = 0 \\ y(t) &= u_c(t) e^{-k(t-c)} + u_d(t) e^{-k(t-d)} \end{aligned} \]
t y c d sum of responses to two impulses
Figure: Sum of responses to two impulses at \( t = c \) and \( t = d \)
Detailed description
Coordinate axes with horizontal axis \( t \) and vertical axis \( y \), with tick marks at \( c \) and \( d \) (\( 0 < c < d \)). From \( t = 0 \) to \( t = c \), the solution remains at \( y = 0 \). At \( t = c \), a vertical dotted jump occurs up to a positive peak, followed by exponential decay until \( t = d \). At \( t = d \), a second vertical dotted jump adds to the remaining height, reaching a higher peak and decaying exponentially afterward. An arrow points to the combined curve labeled "sum of responses to two impulses".

Multiple Impulses

the impulses can have different amplitudes/magnitudes

\[ y' + ky = A_1 \delta(t-a_1) + A_2 \delta(t-a_2) + A_3 \delta(t-a_3) + \dots \]

solution:

\[ \begin{aligned} y(t) &= A_1 u_{a_1}(t) e^{-k(t-a_1)} + A_2 u_{a_2}(t) e^{-k(t-a_2)} + \dots + A_i u_{a_i}(t) e^{-k(t-a_i)} + \dots \\ &= \sum_i A_i u_{a_i}(t) e^{-k(t-a_i)} \\ &= \sum_i A_i u_{a_i}(t) h(t-a_i) \end{aligned} \]

where:

  • \( e^{-k(t-a_i)} \): impulse response (\( e^{-kt} \) is just an example), call it \( h(t) \)

Approximating a Continuous Forcing Function

if \( a_i \le t \) (all the kicks up to current \( t \))

\[ y(t) = \sum_i A_i h(t-a_i) \]

where:

  • \( A_i \): magnitude of each impulse
  • \( h(t-a_i) \): response to impulse at \( t = a_i \)

but what if we have

\[ y' + ky = f(t) \qquad y(0) = 0 \quad ? \]

where \( f(t) \) is not just a bunch of impulses but some function?

we approximate \( f(t) \) as a series of impulses w/ magnitudes affected by \( f(t) \)

t f(t) f(t) Δτ f(τi) τi squeeze it into an impulse with magnitude f(τi)Δτ
Figure: Approximating \( f(t) \) by impulses of area \( f(\tau_i)\Delta\tau \)
Detailed description
Coordinate axes with horizontal axis \( t \) and vertical axis \( f(t) \), showing a smooth positive curve \( f(t) \). At \( t = \tau_i \), a narrow hatched vertical strip of width \( \Delta\tau \) and height \( f(\tau_i) \) spans from the \( t \)-axis up to the curve. An arrow points from the shaded strip to the note: "squeeze it into an impulse with magnitude \( f(\tau_i)\Delta\tau \)".

Substituting \( A_i \approx f(\tau_i)\Delta\tau \) and \( a_i = \tau_i \) into the sum above gives:

\[ y(t) = \sum_i f(\tau_i)\Delta\tau \, h(t-\tau_i) \]

The Convolution Integral

shrink \( \Delta\tau \): \( \Delta\tau \to d\tau \), \( f(\tau_i) \to f(\tau) \), \( \sum_i \to \int_0^t \)

we get

\[ y(t) = \int_0^t f(\tau) h(t-\tau)\,d\tau \]

solution to \( y' + ky = f(t) \quad y(0) = 0 \), with \( h(t) = e^{-kt} \)

that integral is called the convolution integral

\[ f * g = g * f = \int_0^t f(\tau) g(t-\tau)\,d\tau = \int_0^t f(t-\tau) g(\tau)\,d\tau \]

where:

  • \( f * g \): convolution of \( f \) and \( g \)

what is \( 1 * 1 \)

\[ 1 * 1 = \int_0^t 1 \cdot 1 \, d\tau = \int_0^t d\tau = \left. \tau \right|_0^t = t \]

let's now solve \( y' + ky = f(t) \quad y(0) = 0 \) in two ways

Solving \( y' + ky = f(t) \) in Two Ways

first, convolution:

\[ y(t) = \int_0^t f(\tau) e^{-k(t-\tau)}\,d\tau \]

second: Laplace transform

\[ \begin{aligned} y' + ky &= f(t) \qquad y(0) = 0 \\ (s + k)Y &= F \\ Y &= \frac{1}{s+k} \cdot F \end{aligned} \]

where:

  • \( \frac{1}{s+k} \): transform of \( e^{-kt} \)
  • \( F \): transform of \( f(t) \)
\[ y(t) = \mathcal{L}^{-1}\left\{\frac{1}{s+k} \cdot F\right\} \]

(inverse transform of product of transforms)

but that is also

\[ \int_0^t f(\tau) e^{-k(t-\tau)}\,d\tau \]

or, more generally

\[ \mathcal{L}^{-1}\{HF\} = \int_0^t f(\tau) h(t-\tau)\,d\tau \]

Convolution Theorem and Inverse Transforms

\[ \begin{aligned} \mathcal{L}\left\{\int_0^t f(\tau) g(t-\tau)\,d\tau\right\} &= FG \\ \mathcal{L}^{-1}\{FG\} &= \int_0^t f(\tau) g(t-\tau)\,d\tau \end{aligned} \]

convolution in \( t \longleftrightarrow \) product in \( s \)

can be used to speed up inverse transforms

Consider \( \mathcal{L}^{-1}\left\{\frac{1}{s(s^2+1)}\right\} \):

option 1:

\[ \frac{1}{s(s^2+1)} = \frac{A}{s} + \frac{Bs+C}{s^2+1} \]

option 2: convolution

\[ \frac{1}{s(s^2+1)} = \frac{1}{s} \cdot \frac{1}{s^2+1} \]

where:

  • \( F = \frac{1}{s} \), so \( f = 1 \)
  • \( G = \frac{1}{s^2+1} \), so \( g = \sin(t) \)
\[ \begin{aligned} \mathcal{L}^{-1}\left\{\frac{1}{s}\frac{1}{s^2+1}\right\} &= \int_0^t 1 \cdot \sin(t-\tau)\,d\tau = \int_0^t f(\tau) g(t-\tau)\,d\tau \\ &= \int_0^t f(t-\tau) g(\tau)\,d\tau = \int_0^t 1 \cdot \sin(\tau)\,d\tau \\ &= \left. -\cos(\tau) \right|_0^t = -\cos(t) + 1 \end{aligned} \]

General Solution for the Pendulum Problem

more broadly, convolution allows us to solve the problem once for all inputs

revisit the pendulum problem: \( x'' + x = f(t) \quad x(0) = 1, \; x'(0) = 0 \)

w/o specifying \( f(t) \)

\[ \begin{aligned} s^2 X - s x(0) - x'(0) + X &= F \\ (s^2 + 1) X &= s + F \\ X &= \frac{s}{s^2 + 1} + \frac{1}{s^2 + 1} \cdot F \end{aligned} \]
\[ x(t) = \cos(t) + \int_0^t f(\tau) \sin(t-\tau)\,d\tau \]