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(ta)=ua(t)=H(ta)

Example

u(ta)={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(ta)

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

tu(ta)={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. 1u(ta)
  2. u(ta)u(tb)

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(ta). So we will have:

f(t)=33u(ta)

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

f(t)=33u(t2)

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

f(t)=1,   2<t<51[u(t2)u(t5)]

Let's convert the remaining functions:

f(t)=t,   5<t<9t[u(t5)u(t9)]

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

Now we can combine these into one single equation.

H(t)=3u(t2)+u(t2)u(t5)+t[u(t5)u(t9)]+t4u(t9)

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/Lesson25TransformsofHeavisideFunctionsLesson25TransformsofHeavisideFunctions]]TableofContents:[[IntroductiontoDifferentialEquations/TableofContentsTableofContents]]