Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to computing page for the fourth course APMA0360
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to Mathematica tutorial for the fourth course APMA0360
Return to the main page for the course APMA0330
Return to the main page for the course APMA0340
Return to the main page for the course APMA0360
Return to Part VI of the course APMA0330
The Heaviside function (also known as a unit step function) models the on/off behavior of a switch; e.g., when voltage is switched on or off in an electrical circuit, or when a neuron becomes active (fires). It is denote by H(t) according to the formula:
Mathematica has a built-in command for this function:
HeavisideTheta. However, Mathematica does not assign any value to the point t = 0 because its Laplace transform is not sensitive to particular values of a function at any discrete number of points.
Indeed, the command
Its Laplace transform is the same as for the Heaviside function:
LaplaceTransform[UnitStep[2 Sin[t]], t, lambda]
For the Laplace transformation \eqref{EqHeaviside.1}, it does not matter what is the value of the Heaviside function at t = 0. You can define the unit step function as
\[
u(t) = \begin{cases}
1 , & \ \mbox{ for }\ t > 0,
\\
\mbox{whatever you want}, & \ \mbox{ for }\ t=0,
\\
0, & \ \mbox{ for }\ t < 0.
\end{cases}
\]
independently on the value of these functions at t = 0.
However, the inverse Laplace transform restore only the Heaviside function, but not u(t). This is the reason why we use the definition of the Heaviside function, but any other unit step function.
Although Mathematica has a built-in function HeavisideTheta (which is 1 for t > 0 and 0 for
t < 0), it is convenient to define the Heaviside function directly:
In the next section, we will show how the Heaviside function can be used to determine the Laplace transforms of piecewise continuous functions. The main tool
to achieve this is the shifted Heaviside function H(t−𝑎), where 𝑎 is arbitrary positive number. We plot this function:
We present a property of the Heaviside function that is not immediately obvious:
\[
H\left( t^2 - a^2 \right) = 1- H(t-a) + H(t+a) = \begin{cases} 1, & \quad t < -a , \\
0, & \quad -a < t < a, \\
1, & \quad t > a > 0. \end{cases}
\]
The most important property of shifted Heaviside functions is that their difference, W(𝑎,b) = H(t-𝑎) - H(t-b), is actually a window over the interval (𝑎,b); this means that their difference is 1 over this interval and zero outside closed interval [𝑎,b]:
The delta function, δ(x), also called the Dirac delta function, is an object that is not a function according to the definition given in calculus. It is a useful device that behaves in many cases as a function. We show how to use it in a heuristic and non-rigorous manner because its justification would take us far beyond the scope of this tutorial.
Paul Adrien Maurice Dirac (1902--1984) was an English theoretical physicist who made fundamental contributions to the
early development of both quantum mechanics and quantum electrodynamics.
Paul Dirac was born in Bristol, England, to a Swiss father and an English mother. Paul admitted that he had an
unhappy childhood, but did not mention it for 50 years; he learned to speak French, German, and Russian. He received
his Ph.D. degree in 1926. Dirac's work concerned mathematical and theoretical
aspects of quantum mechanics. He began work on the new quantum mechanics as soon as it was introduced by Heisenberg
in 1925 -- independently producing a mathematical equivalent, which consisted essentially of a noncommutative algebra
for calculating atomic properties -- and wrote a series of papers on the subject. Among other discoveries, he
formulated the Dirac equation, which describes the behavior of fermions and predicted the existence of antimatter.
Dirac shared the 1933 Nobel Prize in physics with Erwin Schrödinger "for the discovery of new productive forms of
atomic theory."
Dirac had traveled extensively and studied at various foreign universities, including Copenhagen, Göttingen, Leyden, Wisconsin, Michigan, and Princeton.
In 1937 he married Margit Wigner, of Budapest. Dirac was regarded by his friends and colleagues as unusual in
character for his precise and taciturn nature. In a 1926 letter to Paul Ehrenfest, Albert Einstein wrote of Dirac,
"This balancing on the dizzying path between genius and madness is awful." Dirac openly criticized the political
purpose of religion. He said: "I cannot understand why we idle discussing religion. If we are honest---and
scientists have to be---we must admit that religion is a jumble of false assertions, with no basis in reality."
He spent the last decade of his life at Florida State University.
The Dirac delta function was introduced as a "convenient notation" by Paul Dirac in his
influential 1930 book, "The Principles of Quantum Mechanics," which was based on his most celebrated result on
relativistic equation for electron, published in 1928. He called it the "delta function" since he used it as a
continuous analogue of the discrete Kronecker delta\( \delta_{n,k} . \) Dirac predicted the existence of positron, which was first
observed in 1932. Historically, Paul Dirac used δ-function for modeling the density of an idealized point mass
or point charge, as a function that is equal to zero everywhere except for zero and whose integral over the entire
real line is equal to one.
As there is no function that has these properties, the computations that were done by the
theoretical physicists appeared to mathematicians as nonsense. It took a while for mathematicians to give strict
definition of this phenomenon. In 1938, the Russian mathematician Sergey Sobolev (1908--1989) showed that
the Dirac function is a derivative (in a generalized sense, also known as in a weak sense) of the Heaviside function. To define derivatives of
discontinuous functions, Sobolev introduced a new definition of differentiation and the corresponding set of generalized
functions that were later called distributions. The French mathematician Laurent-Moïse Schwartz (1915--2002) further
extended Sobolev's theory by pioneering the theory of distributions, and he was rewarded the Fields Medal in 1950 for
his work. Because of his sympathy for Trotskyism, Schwartz encountered serious problems trying to enter the United
States to receive the medal; however, he was ultimately successful. But it was news without major consequence,
for Schwartz’ work remained inaccessible to all but the most determined of mathematical physicists.
Many scientists refuse existence of the delta function and claim that all theoretical results can be obtained without it.
Dirac’s cautionary remarks (and the efficient simplicity of his idea)
notwithstanding, some mathematically well-bred people did from the outset
take strong exception to the δ-function. In the vanguard of this group was the American-Hungarian mathematician
John von Neumann (was born in Jewish family as János Neumann, 1903--1957), who dismissed the δ-function as a “fiction."
Although it is hard to argue against this point of view, applications of the Dirac delta-functions are so diverse and its convenience was shown in various examples that its usefulness is widely accepted.
Sergey Sobolev (left) and Laurent Schwartz (right).
In 1955,
the British applied mathematician George Frederick James Temple (1901--1992) published
what he called a “less cumbersome vulgarization” of Schwartz’ theory based on Jan Geniusz Mikusınski's (1913--1987)
sequential approach. However, the definition of δ-function can be traced back to the early 1820s due to the work
of Joseph Fourier on what we now know as the Fourier integrals. In 1828, the δ-function had intruded for a second time
into a physical theory by George Green who noticed that the solution to the nonhomogeneous Poisson equation
can be expressed through the solution of a special equation containing the delta function. The history of the theory
of distributions can be found in "The Prehistory of the Theory of Distributions" by Jesper Lützen (University of Copenhagen, Denmark), Springer-Verlag, 1982.
Outside of quantum mechanics the delta function is also known in engineering and signal processing as the unit
impulse symbol. Mechanical systems and electrical circuits are often acted upon by an external force of large magnitude
that acts only for a very short period of time. For example, all strike phenomenon (caused by either piano hammer or
tennis racket) involve impulse functions. Also, it is useful to consider discontinuous idealizations,
such as the mass density of a point mass, which has a finite amount of mass stuffed inside a single point of space.
Therefore, the density must be infinite at that point and zero everywhere else. Delta function can be defined as the derivative of the Heaviside function,
which (when formally evaluated) is zero for all \( t \ne 0 , \) and it is undefined at the
origin. Now time comes to explain what a generalized function or distribution means.
In our everyday life, we all use functions that we learn from school as a map or transformation of one set (usually
called input) into another set (called output, which is usually a set of numbers). For example, when we do our annual physical examinations,
the medical staff measure our blood pressure, height, and weight, which all are functions that can be described as nondestructive testing. However, not all functions
are as nice as previously mentioned. For instance, a biopsy is much less pleasant option and it is hard to call it a
function, unless we label it a destructive testing function. Before the procedure, we consider a patient as a probe function, but after biopsy when some tissue has been
taken from patient's body, we have a completely different person. Therefore, while we get biopsy laboratory results (usually represented in numeric digits), the biopsy represents destructive testing.
Now let us turn to another example. Suppose you visit a store and want to purchase a soft drink, i.e. a bottle of soda. You
observe that liquid levels in each bottle are different and you wonder whether they filled these bottles with different volumes
of soda or the dimensions of each bottle differ from one another. So you decide to measure the volume of soda in a particular bottle.
Of course, one can find outside dimensions of a bottle, but to measure the volume of soda inside, there is no
other option but to open the bottle. In other words, you have to destroy (modify) the product by opening the bottle. The function of measuring the soda by opening the bottle could represent destructive testing
Now consider an electron. Nobody has ever seen it and we do not know exactly what it looks like. However, we can make some measurements
regarding the electron. For example, we can determine its position by observing the point where electron strikes a
screen. By doing this we destroy the electron as a particle and convert its energy into visible light to determine its position in space.
Such operation would be another example of destructive testing function, because we actually transfer the electron into another matter, and we
actually lose it as a particle. Therefore, in the real world we have and use nondestructive testing functions that measure items without their
termination or modification (as we can measure velocity or voltage). On the other hand, we can measure some items only by completely destroying them or transferring them into another options as destructive testing functions. Mathematically, such measurement could be
done by integration (hope you remember the definition from calculus):
where f(x) is a nice (probe) function and g(x) can represent (bad or unpleasant) operation on our probe function.
As a set of probe functions, it is convenient to choose smooth functions on the line with compact support
(which means that they are zero outside some finite interval). As for an electron, we don't know what the multiple
g(x) looks like, all we know is the value of integral that represents a measurement. In this case, we say
that g(x) acts on the probe function and we call this operation the functional. Physicists denote it as
\[
\left. \left\vert g \right\vert f \right\rangle = \int_{-\infty}^{\infty} f(x)\,g(x)\,{\text d}x \qquad\mbox{or simply}
\qquad \langle g, f \rangle .
\]
(for simplicity, we consider only real-valued functions).
Mathematicians also follow these notations; however, the integral on the right-hand side is mostly a show of respect to
people who studied functions at school and it has no sense because we don't know what is the exact expression of
g(x)---all we know or measure is the result of integration. Such objects as g(x) are now called distributions,
or generalized functions, but actually they are all functionals: g acts on any probe function by mapping it into
a number (real or complex). So strictly speaking, instead of the integral
\( \int_{-\infty}^{\infty} f(x)\,g(x)\,{\text d}x \) we have to write the formula
\[
g\,:\, \mbox{set of probe functions } \mapsto \, \mbox{numbers}; \qquad g\,: \, f \, \mapsto \, \mathbb{R} \quad
\mbox{or}\quad \mathbb{C} .
\]
Therefore, the notation g(x) makes no sense because the value of g at any point x is undefined.
So x is a dummy variable or invitation to consider functions depending on x. It is
more appropriate to write \( g(f) \) because it is a number that
is assigned to a probe function f by distribution g. Nevertheless, it is a custom to say that a
generalized function g(x) is zero
for x from some interval [a,b] if, for every probe function f that is zero outside the given interval,
\[
\langle g , f \rangle = \int_a^b f(x)\, g(x)\, {\text d} x =0.
\]
However, it is completely inappropriate to say that a generalized function has a particular value at some point
(recall that the integral does not care about a particular value of integrable function).
Following Sobolev, we define a derivative g' of a distribution g by the equation
\[
\langle g' , f \rangle = -\int_a^b f'(x)\, g(x)\, {\text d} x ,
\]
which is valid for every smooth probe function f that is identically zero outside some finite interval.
Now we define the derivative of the Heaviside function using the new definition (because the old calculus definition of a
derivative is useless).
⁎ ✱ ✲ ✳ ✺ ✻ ✼
✽ ❋ ===================================
In many application, we come across functions that have a very large value over a very short interval. For example, the strike of a hammer exerts a relatively large force over a relatively short time and a heavy weight concentration at a spot on a suspended beam exerts a large force over a very small section of the beam. A typical example of the latter is the pressure of tran's wheel on rails. To deal with impulse functions (that represent violent forces of short duration), physicists and engineers use the special notation, introduced by Paul Dirac and is called the delta function.
Definition:
The Dirac delta function δ(t) is a functional that assigns to every smooth function f ∈ S from a set of test (probe) functions S of a real (or complex) number according to the formula
The right-hand side of Eq.\eqref{EqDirac.1} is also denoted as < δ , f > or simply (δ , f). The dimensions of δ(t) are the inverse of the dimensions of t because the quantity δ(t) dt must be dimensioness.
Now we give an explanation regarding notations.
Here we use bra–ket notation, <g | f>, that was effectively established in 1939 by Paul Dirac and is thus also known as the Dirac notation. In this notation, bra < g | represents a functional, and ket | f > stands for a probe function. Historically, functionals are usually identified with integrals because every quadrature
\[
F(f) = \int_a^b f(x)\,g(x)\,{\text d}x
\]
determines a functional by assigning to every integrable function f(x) a number F(f).
A set of probe (or test) functions is usually chosen as a subset of the set C∞ of infinitely differentiable functions that approach zero at infinity to ensure that \( \int_{-\infty}^{\infty} \left\vert f (x) \right\vert^2 {\text d}x \) converges. The set of all square integrable functions is denoted by 𝔏²(ℝ) or simply 𝔏² (notations L² or L2 are also widely used). This space becomes a Hilbert space with the inner product
The elements of the Hilbert space 𝔏² of square integrable functions aren’t functions. They are equivalence classes of functions, where two functions belong to the same class if they are equal almost everywhere (meaning, they are unequal merely on a set of measure 0). Therefore, the element f ∈ 𝔏²(ℝ)
doesn’t have a well-defined value anywhere: you can take any square-integrable function f, change its value at x=0 to be 17 or −100, and you still have the same element in 𝔏². Every functional on 𝔏² is generated by some function from itself:
for some function g∈𝔏². This is the reason why an action of the delta function on a probe function is denoted by the integral \eqref{EqDirac.1}. However, a probe function f must be at least continuous for relation \eqref{EqDirac.1} to be valid.
From the definition above, it follows that the delta function is a distribution. It turns out that the majority of usual operations of calculus are applicable to generalized functions; of course, they can be justified rigorously. Although ordinary functions can be canonically reinterpreted as acting on test functions, there are many distributions that do not arise in this way; and delta function is one of them.
>
There is no way to define the value of a distribution at a particular point. However, we can extend it and define, for instance, a generalized function to have zero values on some open interval. We demonstrate this concept on a particular example by calculating the derivative of the Heaviside function. To find the derivative of a distribution, we need a new definition that was first proposed by S. Sobolev, who called it weak or generalized derivative:
We see that this is exactly definition of the Dirac delta function and we claim that the derivative (in weak sense) of the Heaviside function is the delta function.
Although the delta function is a distribution (which is a functional on a set of probe functions) and the notation
\( \delta (x) \) makes no sense from a mathematical point of view,
it is a custom to say that the delta function δ(x) is zero outside the original. We can manipulate the delta function δ(x)
in exactly the same way as with a regular
function, keeping in mind that it should be applied to a probe function. Dirac remarks that “There are a
number of elementary equations which one can write down about δ-functions. These equations are essentially
rules of manipulation for algebraic work involving δ-functions. The meaning of any of these equations is that
its two sides give equivalent results [when used] as factors in an integrand.'' Examples of such equations are
where summation is extended over all simple roots of the equation \( g(x_n ) =0 . \)
Note that the formula above is valid subject that \( g' (x_n ) \ne 0 . \)
The Dirac delta function as a limit of a sequence
Operations with distributions can be made not plausible when they are represented as the limits (of couse, in weak sense) of ordinary well behaved functions. This approach allows one to develop an intuitive notion of a distribution, and the delta function in particular.
Next, we plot approximations of the Dirac function based on its generator
As it can be seen from figure, the amplitude of pulse becomes very large and its width becomes very small as
\( h \to \infty . \) Therefore, for any value of h, the integral of the rectangular
pulse
\[
\int_{\alpha}^{\beta} \delta_h (x,a)\, {\text d} x = 1
\]
if the interval of definition \( \left( a- \frac{1}{2h} , a+ \frac{1}{2h} \right) \) lies
in the interval (α , β), and zero if the range of integration does not contain the pulse. Now we can define
the delta function located at the point x=a as the limit (in generalized sense):
So we can establish all properties of the delta-function using its approximation and definition of weak convergence. For instance, let us show that the weak derivative of the Heaviside function is the delta-function.
Suppose that f(x) is a continuous function having antiderivative F(x). In other words, let F'(x) = f(x). We compute the integral
The delta function has many representations as limits (of course, in a generalized sense) of regular functions. For example,
one may want to use another approximation:
Actually, we have to multiply f(t-3) by a shifted Heaviside function, so the correct answer would be
\( f(t-3)\, H(t-3) \) because the original function was
\( \left[ t^2 -1 \right] H(t) . \) Now we apply the Laplace transform:
Example 4:
A spring-mass system with mass 1, damping 2, and spring
constant 10 is subject to a hammer blow at time t = 0. The blow imparts a total impulse of 1 to the system,
which is initially at rest. Find the response of the system.
The situation is modeled by
where \( y^L = {\cal L} \left[ y(t) \right] = \int_0^{\infty} e^{-\lambda\, t} y(t) \,{\text d}t \)
is the Laplace transform of the unknown function. Solving for yL, we obtain
In this problem, the unit delta impulse produces a jump of magnitude F0 (when mass is assumed to be 1) in the velocity
\( \dot{y}(0) \) at t = 0.
Thus, the function y(t) is continuous indeed, but not differentiable at t = 0.
Application of the Laplace transform yields the algebraic equation
where E is the elastic modulus and I is the second moment of area of the beam's cross-section. Note that I must be calculated with respect to the axis that passes through the centroid of the cross-section and which is perpendicular to the applied loading.
This equation, describing the deflection of a uniform, static beam, is used widely in engineering practice.
Also, we need to add the boundary conditions for a clamped beam of length ℓ (fixed at x = 0 and x = ℓ):
We plot the deflection curve (4.7) of a beam clamped at both ends in dimensionless coordinated for α = ½, ⅔, and ¼. These graphs show that the maximum deflection occurs when load is applied at the center.
Deflection curve (4.7) of a beam clamped at both ends.
Mathematica code
■
Return to Mathematica page
Return to the main page (APMA0330)
Return to the Part 1 (Plotting)
Return to the Part 2 (First Order ODEs)
Return to the Part 3 (Numerical Methods)
Return to the Part 4 (Second and Higher Order ODEs)
Return to the Part 5 (Series and Recurrences)
Return to the Part 6 (Laplace Transform)
Return to the Part 7 (Boundary Value Problems)