Lesson 24 - Introduction to Discontinuous Functions (Heaviside Functions)

Let's introduce a concept that will be useful in physics or engineering. The Heaviside function describes the behavior of a switch graph, in which a switch might be turned on or off at a specific point in time. It is often denoted

u(t−a)=ua(t)=H(t−a)

Example

u(t−a)={0t<a1t>a

In this function, u(t) is "off" for t<a and is "on" for t>a. We can visualize this with a graph.

\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
    axis lines = middle,
    xlabel = {$t$},
    ylabel = {$u(t-a)$},
    grid = both,
    domain=-2:5,
    samples=100,
    legend style={at={(0.5,-0.15)}, anchor=north},
    title = {Step Function: $u(t-a)$},
    xtick=\empty,
    ytick=\empty,
]
% Step function with parameter a = 2
\addplot[blue, thick] {x < 2 ? 0 : 1}; 
\addlegendentry{$u(t-a)$}

\end{axis}
\end{tikzpicture}
\end{document}

Notice that the slope at t<a is constant at 0, while the slope at t>a is constant at 1.

Let's look at another.

tu(t−a)

To find the piecewise values that define this function, we know that when t<a, then u(t−a)=0, and when t>a, u(t−a)=1. So for tu(t−a), when t<a, we plug in 0 for u(t−a) and when t>a, we plug in 1 for u(t−a). We should get the following:

tu(t−a)={0t<att>a

We can describe this as a switch that is "off" for t<a and "on" with a slope of t for t>a. Here is the graph for this case.

\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
    axis lines = middle,
    xlabel = {$t$},
    ylabel = {$tu(t-a)$},
    grid = both,
    domain=-2:5,
    samples=100,
    legend style={at={(0.5,-0.15)}, anchor=north},
    title = {Step Function: $tu(t-a)$},
    xtick=\empty,
    ytick=\empty,
]
% Step function: tu(t-a) = 0 for t < 2, and tu(t-a) = t for t >= 2
\addplot[blue, thick] {x < 2 ? 0 : x}; 
\addlegendentry{$tu(t-a)$}

\end{axis}
\end{tikzpicture}
\end{document}

Try For Yourself

Find the piecewise definition and graph each of the functions.

  1. 1−u(t−a)
  2. u(t−a)−u(t−b)

We can also write a piecewise function in terms of a Heaviside function.

f(t)={3t<212<t<5t5<t<9t4t>9

We can simply multiple the function f(t) by the step function u(t−a). So we will have:

f(t)=3→3u(t−a)

Now, we know that f(t) is true for t<2, so we have to replace a with 2.

f(t)=3→3u(t−2)

In the next piece of the function, we will have a range of values for which t is true.

f(t)=1,   2<t<5→1[u(t−2)−u(t−5)]

Let's convert the remaining functions:

f(t)=t,   5<t<9→t[u(t−5)−u(t−9)]

f(t)=t4,   t>9→t4[u(t−9)]

Now we can combine these into one single equation.

H(t)=3u(t−2)+u(t−2)−u(t−5)+t[u(t−5)−u(t−9)]+t4u(t−9)

Try for Yourself

Write in terms of Heaviside functions:

\begin{cases} e^{-t} & 0 \leq 2 \ 3 & 2 < t < 3 \ 1 & t > 3
\end

2.

f(t) =
\begin{cases} 0 & 0 \leq t < 1 \ t & 1 < t < 3 \ 1 & t > 3
\end

Inthenextlesson,wewilllookattakingtheLaplacetransformofHeavisidefunctions.NextLesson:[[IntroductiontoDifferentialEquations/Lesson25−TransformsofHeavisideFunctions∥Lesson25−TransformsofHeavisideFunctions]]TableofContents:[[IntroductiontoDifferentialEquations/TableofContents∥TableofContents]]