Heaviside - Maple Help

Heaviside

Heaviside step function

 Calling Sequence Heaviside(t)

Parameters

 t - algebraic expression understood to be real

Description

 • The Heaviside function is the step function,

$\left\{\begin{array}{cc}0& x<0\\ \mathrm{undefined}& x=0\\ 1& 0

 where x is understood to be real. Regarding the value of Heaviside at $0$, Maple implements the following convention: Heaviside(0) returns undefined and signals the invalid_operation numeric event. You can change this behavior by catching this event. For details, see NumericEvent and the Examples section below.
 • The Heaviside function is also the anti-derivative of Dirac in that

$\frac{ⅆ}{ⅆx}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}Heaviside\left(x\right)=\mathrm{Dirac}\left(x\right)$

 • The Heaviside and Dirac functions are frequently used in the context of integral transforms, for example, laplace, mellin, or fourier, or in formulations involving differential equation solutions. These functions are also particularly relevant in Theoretical Physics, for example in Quantum Mechanics.
 • When converting Heaviside to piecewise you may want to have the conversion performed taking Heaviside(0) = 1. For that purpose set the Environment Variable _EnvUseHeavisideAsUnitStep to true - see the example in the next section.

Examples

 > $\mathrm{diff}\left(\mathrm{Heaviside}\left(x\right),x\right)$
 ${\mathrm{Dirac}}{}\left({x}\right)$ (1)
 > $\mathrm{Heaviside}\left(4\right)$
 ${1}$ (2)
 > $\mathrm{Heaviside}\left(-24\right)$
 ${0}$ (3)

By default, the value of Heaviside at zero is undefined.

 > $\mathrm{Heaviside}\left(0\right)$
 ${\mathrm{undefined}}$ (4)

Convert the Heaviside function to a piecewise function.

 > $\mathrm{convert}\left(\mathrm{Heaviside}\left(x\right),\mathrm{piecewise}\right)$
 $\left\{\begin{array}{cc}{0}& {x}{<}{0}\\ {\mathrm{undefined}}& {x}{=}{0}\\ {1}& {0}{<}{x}\end{array}\right\$ (5)
 > $3\mathrm{Heaviside}\left(x\right)$
 ${3}{}{\mathrm{Heaviside}}{}\left({x}\right)$ (6)
 > $\mathrm{convert}\left(3\mathrm{Heaviside}\left(x\right),\mathrm{piecewise}\right)$
 $\left\{\begin{array}{cc}{0}& {x}{<}{0}\\ {\mathrm{undefined}}& {x}{=}{0}\\ {3}& {0}{<}{x}\end{array}\right\$ (7)
 > $\mathrm{convert}\left(\mathrm{int}\left(\mathrm{Heaviside}\left(x\right),x\right),\mathrm{piecewise}\right)$
 $\left\{\begin{array}{cc}{0}& {x}{<}{0}\\ {\mathrm{undefined}}& {x}{=}{0}\\ {x}& {0}{<}{x}\end{array}\right\$ (8)

To perform this conversion taking Heaviside(0) = 1 you can set a related handler.

 > $\mathrm{NumericEventHandler}\left(\mathrm{invalid_operation}=\mathrm{Heaviside/EventHandler}\left(\mathrm{value_at_zero}=1\right)\right):$
 > $\mathrm{Heaviside}\left(0\right)$
 ${1}$ (9)
 > $\mathrm{Heaviside}\left(x\right)=\mathrm{convert}\left(\mathrm{Heaviside}\left(x\right),\mathrm{piecewise}\right)$
 ${\mathrm{Heaviside}}{}\left({x}\right){=}\left\{\begin{array}{cc}{0}& {x}{<}{0}\\ {1}& {0}{\le }{x}\end{array}\right\$ (10)

To set the value of Heaviside(0) to $\frac{1}{2}$ or any other numerical value, replace $1$ by this value in the NumericEventHandler input line above. The invalid_operation event handler can be reset as follows.

 > $\mathrm{NumericEventHandler}\left(\mathrm{invalid_operation}=\mathrm{default}\right):$
 > $\mathrm{Heaviside}\left(0\right)$
 ${\mathrm{undefined}}$ (11)

For the particular case of computing with Heaviside representing a unit step, that is Heaviside(0) = 1, an alternative to setting a handler is to set the value of the Environment variable as seen below.

 > $\mathrm{_EnvUseHeavisideAsUnitStep}≔\mathrm{true}$
 ${\mathrm{_EnvUseHeavisideAsUnitStep}}{≔}{\mathrm{true}}$ (12)
 > $\mathrm{Heaviside}\left(0\right)$
 ${1}$ (13)
 > $\mathrm{_EnvUseHeavisideAsUnitStep}≔'\mathrm{_EnvUseHeavisideAsUnitStep}'$
 ${\mathrm{_EnvUseHeavisideAsUnitStep}}{≔}{\mathrm{_EnvUseHeavisideAsUnitStep}}$ (14)
 > $\mathrm{Heaviside}\left(0\right)$
 ${\mathrm{undefined}}$ (15)