Diff. Eqs. with Discontinuous Forcing Functions

last time:

\[ u_c(t) = \begin{cases} 0 & \text{if } t < c \\ 1 & \text{if } t \ge c \end{cases} \] \[ \mathcal{L}\bigl\{u_c(t) f(t - c)\bigr\} = e^{-cs}\mathcal{L}\bigl\{f(t)\bigr\} = e^{-cs}F(s) \]

where:

  • \( \mathcal{L}\{f(t)\} \): transform the function if it were activated at \( t = 0 \)

now we can solve something like

\[ y'' + 3y' + 2y = \begin{cases} 0 & 0 \le t < \pi \\ 1 & \pi \le t < 2\pi \\ 0 & t \ge 2\pi \end{cases} \qquad y(0) = 0,\; y'(0) = 1 \]

as mass-spring-damper: \( m = 1,\; c = 3,\; k = 2 \)

k c m f(t)
Figure: Mass-spring-damper system with forcing \( f(t) \)
Detailed description
A mechanical schematic showing a fixed overhead support from which a spring (with spring constant \( k \)) on the left and a damper/dashpot (with damping coefficient \( c \)) on the right hang in parallel. Both connect to a rectangular mass block labeled \( m \). Below the mass block, an upward-pointing arrow represents the external forcing function \( f(t) \) applied to the mass.

if we were to solve it the "old way" w/o Laplace transform

  1. solve \( y'' + 3y' + 2y = 0 \qquad y(0) = 0,\; y'(0) = 1 \quad \text{for } 0 \le t < \pi \)
  2. solve \( y'' + 3y' + 2y = 1 \qquad y(\pi) = \underline{\hspace{2em}},\; y'(\pi) = \underline{\hspace{2em}} \quad \text{for } \pi \le t < 2\pi \)
    (Note: initial values \( y(\pi) \) and \( y'(\pi) \) come from 1. at \( t = \pi \))
  3. solve \( y'' + 3y' + 2y = 0 \qquad y(2\pi) = \underline{\hspace{2em}},\; y'(2\pi) = \underline{\hspace{2em}} \quad \text{for } t \ge 2\pi \)
    (Note: initial values \( y(2\pi) \) and \( y'(2\pi) \) come from end of step 2)

but Laplace transform can handle all stages in one go.

\[ y'' + 3y' + 2y = \begin{cases} 0 & t < \pi \\ 1 & \pi < t < 2\pi \\ 0 & t > 2\pi \end{cases} \qquad y(0) = 0,\; y'(0) = 1 \]
\[ y'' + 3y' + 2y = u_{\pi} - u_{2\pi} \] \[ y(0) = 0,\; y'(0) = 1 \]

solve by taking Laplace transform

t 1 π 2π
Figure: Rectangular pulse \( u_{\pi}(t) - u_{2\pi}(t) \)
Detailed description
A coordinate graph with horizontal axis \( t \) and vertical axis labeled at \( 1 \). Two tick marks on the \( t \)-axis mark \( \pi \) and \( 2\pi \). The plotted function equals \( 0 \) from \( t = 0 \) to \( \pi \), steps vertically (shown with dashed transition lines) to a constant height of \( 1 \) on the interval \( (\pi, 2\pi) \), and steps back down to \( 0 \) for \( t > 2\pi \).
\[ \bigl[s^2 Y - s y(0) - y'(0)\bigr] + 3\bigl[s Y - y(0)\bigr] + 2\bigl[Y\bigr] = \frac{e^{-\pi s}}{s} - \frac{e^{-2\pi s}}{s} \]

where:

  • \( s y(0) = 0 \) (given)
  • \( y'(0) = 1 \)
  • \( y(0) = 0 \) in the second bracket
\[ (s^2 + 3s + 2) Y = 1 + e^{-\pi s}\frac{1}{s} - e^{-2\pi s}\frac{1}{s} \] \[ Y = \frac{1}{s^2 + 3s + 2} + e^{-\pi s}\frac{1}{s(s^2 + 3s + 2)} - e^{-2\pi s}\frac{1}{s(s^2 + 3s + 2)} \]

look at the pieces by themselves

\[ \frac{1}{s^2 + 3s + 2} = \frac{1}{(s+1)(s+2)} = \frac{A}{s+1} + \frac{B}{s+2} = \frac{1}{s+1} - \frac{1}{s+2} \] \[ \begin{aligned} \frac{1}{s(s^2 + 3s + 2)} = \frac{1}{s(s+1)(s+2)} &= \frac{A}{s} + \frac{B}{s+1} + \frac{C}{s+2} \\ &= \frac{1}{2}\frac{1}{s} - \frac{1}{s+1} + \frac{1}{2}\frac{1}{s+2} \end{aligned} \]
\[ Y = \frac{1}{s+1} - \frac{1}{s+2} + e^{-\pi s}\left(\frac{1}{2}\frac{1}{s} - \frac{1}{s+1} + \frac{1}{2}\frac{1}{s+2}\right) - e^{-2\pi s}\left(\frac{1}{2}\frac{1}{s} - \frac{1}{s+1} + \frac{1}{2}\frac{1}{s+2}\right) \]
\[ \mathcal{L}^{-1}\bigl\{e^{-cs} F(s)\bigr\} = u_c(t) f(t - c) \]

inverse transform of what we see then shift to \( t = c \) (the delay)

piece by piece:

  • \( \dfrac{1}{s+1} \to e^{-t} \)
  • \( \dfrac{1}{s+2} \to e^{-2t} \)
  • \( \dfrac{1}{s} \to 1 \)
\[ \begin{aligned} y(t) &= \left(e^{-t} - e^{-2t}\right) + u_{\pi}(t)\left(\frac{1}{2} - e^{-(t-\pi)} + \frac{1}{2}e^{-2(t-\pi)}\right) \\ &\quad - u_{2\pi}(t)\left(\frac{1}{2} - e^{-(t-2\pi)} + \frac{1}{2}e^{-2(t-2\pi)}\right) \\ &= \begin{cases} e^{-t} - e^{-2t} & 0 < t < \pi \\ e^{-t} - e^{-2t} + \dfrac{1}{2} - e^{-(t-\pi)} + \dfrac{1}{2}e^{-2(t-\pi)} & \pi < t < 2\pi \\ e^{-t} - e^{-2t} + \dfrac{1}{2} - e^{-(t-\pi)} + \dfrac{1}{2}e^{-2(t-\pi)} - \dfrac{1}{2} + e^{-(t-2\pi)} - \dfrac{1}{2}e^{-2(t-2\pi)} & t > 2\pi \end{cases} \end{aligned} \]
\[ y'' + 3y' + 2y = u_{\pi}(t) - u_{2\pi}(t), \qquad y(0) = 0,\; y'(0) = 1 \]

Response of an overdamped system to a rectangular pulse

0.0 0.1 0.2 0.3 0.4 0.5 y(t) 0.0 0.2 0.4 0.6 0.8 1.0 F(t) 0 2 4 6 8 10 t Solution y(t) Forcing F(t) = uπ(t) − u2π(t)
Figure: Overdamped response \( y(t) \) and forcing pulse \( F(t) \)
Detailed description
A dual-axis graph plotting time \( t \) from \( 0 \) to \( 10 \) along the horizontal axis. The left vertical axis measures the solution \( y(t) \) from \( 0.0 \) to \( 0.5 \) (in navy blue), and the right vertical axis measures the forcing function \( F(t) \) from \( 0.0 \) to \( 1.0 \) (in burnt orange). The forcing pulse \( F(t) = u_{\pi}(t) - u_{2\pi}(t) \) stays at \( 0.0 \) for \( 0 \le t < \pi \), jumps vertically to \( 1.0 \) for \( \pi \le t < 2\pi \), and drops back to \( 0.0 \) at \( t = 2\pi \) up to \( t = 3\pi \). Driven by the initial velocity \( y'(0) = 1 \), the solution \( y(t) \) starts at \( (0, 0) \), rises to a local peak of \( 0.25 \) at \( t = \ln 2 \approx 0.69 \), and decays toward \( 0.04 \) near \( t = \pi \). When the unit forcing turns on at \( t = \pi \), \( y(t) \) turns upward and climbs toward \( 0.46 \) just past \( t = 2\pi \). After the forcing shuts off at \( t = 2\pi \), \( y(t) \) decays smoothly toward zero, reaching approximately \( 0.04 \) at \( t = 3\pi \approx 9.42 \).

try \( y'' + 2y' + 2y = u_{\pi} - u_{2\pi} \qquad y(0) = 0,\; y'(0) = 1 \quad \) (now underdamped)

same steps

\[ \bigl[s^2 Y - s y(0) - y'(0)\bigr] + 2\bigl[s Y - y(0)\bigr] + 2\bigl[Y\bigr] = \frac{e^{-\pi s}}{s} - \frac{e^{-2\pi s}}{s} \]

where:

  • \( s y(0) = 0 \)
  • \( y'(0) = 1 \)
  • \( y(0) = 0 \) in the second bracket
\[ (s^2 + 2s + 2) Y = 1 + e^{-\pi s}\frac{1}{s} - e^{-2\pi s}\frac{1}{s} \] \[ \begin{aligned} Y &= \frac{1}{s^2 + 2s + 2} + e^{-\pi s}\frac{1}{s(s^2 + 2s + 2)} - e^{-2\pi s}\frac{1}{s(s^2 + 2s + 2)} \\ &= \frac{1}{(s+1)^2 + 1} + e^{-\pi s}\frac{1}{s\bigl[(s+1)^2 + 1\bigr]} - e^{-2\pi s}\frac{1}{s\bigl[(s+1)^2 + 1\bigr]} \end{aligned} \]

(Note: complete the square in the denominator \( s^2 + 2s + 2 = (s+1)^2 + 1 \).)

last two pieces individually:

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

(Note: comparing numerator \( s+2 \) and \( s+1 \) in \( (s+1)^2 + 1 \) — want them to match.)

\[ = \frac{1}{2}\frac{1}{s} - \frac{1}{2}\frac{s+1}{(s+1)^2 + 1} - \frac{1}{2}\frac{1}{(s+1)^2 + 1} \] \[ Y = \frac{1}{(s+1)^2 + 1} + e^{-\pi s}\left(\frac{1}{2}\frac{1}{s} - \frac{1}{2}\frac{s+1}{(s+1)^2 + 1} - \frac{1}{2}\frac{1}{(s+1)^2 + 1}\right) - e^{-2\pi s}\left(\frac{1}{2}\frac{1}{s} - \frac{1}{2}\frac{s+1}{(s+1)^2 + 1} - \frac{1}{2}\frac{1}{(s+1)^2 + 1}\right) \]

inverse of each

  • \( \dfrac{1}{s} \to 1 \)
  • \( \dfrac{s+1}{(s+1)^2 + 1} \to e^{-t}\cos(t) \)
  • \( \dfrac{1}{(s+1)^2 + 1} \to e^{-t}\sin(t) \)
\[ \begin{aligned} y(t) &= e^{-t}\sin(t) + u_{\pi}(t)\left(\frac{1}{2} - \frac{1}{2}e^{-(t-\pi)}\cos(t-\pi) - \frac{1}{2}e^{-(t-\pi)}\sin(t-\pi)\right) \\ &\quad - u_{2\pi}(t)\left(\frac{1}{2} - \frac{1}{2}e^{-(t-2\pi)}\cos(t-2\pi) - \frac{1}{2}e^{-(t-2\pi)}\sin(t-2\pi)\right) \end{aligned} \]

where:

  • \( \cos(t - \pi) = -\cos(t) \)
  • \( \sin(t - \pi) = -\sin(t) \)
  • \( \cos(t - 2\pi) = \cos(t) \)
  • \( \sin(t - 2\pi) = \sin(t) \)

Basic Laplace Transforms

\[ F(s) = \mathcal{L}\bigl\{f(t)\bigr\} = \int_{0}^{\infty} e^{-st} f(t)\,dt \]
Elementary Functions and Unit Step
\( f(t) \) \( F(s) \) valid for
\( 1 \) \( \dfrac{1}{s} \) \( s > 0 \)
\( e^{at} \) \( \dfrac{1}{s - a} \) \( s > a \)
\( t^n \; (n = 1, 2, \dots) \) \( \dfrac{n!}{s^{n+1}} \) \( s > 0 \)
\( \sin(bt) \) \( \dfrac{b}{s^2 + b^2} \) \( s > 0 \)
\( \cos(bt) \) \( \dfrac{s}{s^2 + b^2} \) \( s > 0 \)
\( \sinh(bt) \) \( \dfrac{b}{s^2 - b^2} \) \( s > |b| \)
\( \cosh(bt) \) \( \dfrac{s}{s^2 - b^2} \) \( s > |b| \)
\( u_c(t) \; (c \ge 0) \) \( \dfrac{e^{-cs}}{s} \) \( s > 0 \)
Exponentially Modulated Functions
\( f(t) \) \( F(s) \) valid for
\( e^{at}\sin(bt) \) \( \dfrac{b}{(s - a)^2 + b^2} \) \( s > a \)
\( e^{at}\cos(bt) \) \( \dfrac{s - a}{(s - a)^2 + b^2} \) \( s > a \)
\( t^n e^{at} \) \( \dfrac{n!}{(s - a)^{n+1}} \) \( s > a \)

Derivatives \( (Y = \mathcal{L}\{y\}) \)

\[ \mathcal{L}\{y'\} = sY - y(0) \qquad \mathcal{L}\{y''\} = s^2 Y - s y(0) - y'(0) \]

Linearity: \( \mathcal{L}\{c_1 f + c_2 g\} = c_1 F + c_2 G \)

First shifting: \( \mathcal{L}\{u_c(t) f(t - c)\} = e^{-cs} F(s) \)

Second shifting: \( \mathcal{L}\{e^{ct} f(t)\} = F(s - c) \)