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
Example
In this function,
\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
Let's look at another.
To find the piecewise values that define this function, we know that when
We can describe this as a switch that is "off" for
\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.
We can also write a piecewise function in terms of a Heaviside function.
We can simply multiple the function
Now, we know that
In the next piece of the function, we will have a range of values for which
Let's convert the remaining functions:
Now we can combine these into one single equation.
Try for Yourself
Write in terms of Heaviside functions:
\begin{cases} e^{-t} & 0 \leq 2 \ 3 & 2 < t < 3 \ 1 & t > 3
\end
f(t) =
\begin{cases} 0 & 0 \leq t < 1 \ t & 1 < t < 3 \ 1 & t > 3
\end