Sage implements several generalized functions (also known as distributions) such as Dirac delta, Heaviside step functions. These generalized functions can be manipulated within Sage like any other symbolic functions.
AUTHORS:
EXAMPLES:
Dirac delta function:
sage: dirac_delta(x)
dirac_delta(x)
Heaviside step function:
sage: heaviside(x)
heaviside(x)
Unit step function:
sage: unit_step(x)
unit_step(x)
Signum (sgn) function:
sage: sgn(x)
sgn(x)
Kronecker delta function:
sage: m,n=var('m,n')
sage: kronecker_delta(m,n)
kronecker_delta(m, n)
Bases: sage.symbolic.function.BuiltinFunction
The Dirac delta (generalized) function, (dirac_delta(x)).
INPUT:
DEFINITION:
Dirac delta function , is defined in Sage as:
for real and
Its alternate definition with respect to an arbitrary test function is
EXAMPLES:
sage: dirac_delta(1)
0
sage: dirac_delta(0)
dirac_delta(0)
sage: dirac_delta(x)
dirac_delta(x)
REFERENCES:
Bases: sage.symbolic.function.BuiltinFunction
The Heaviside step function, (heaviside(x)).
INPUT:
DEFINITION:
The Heaviside step function, is defined in Sage as:
for and for
EXAMPLES:
sage: heaviside(-1)
0
sage: heaviside(1)
1
sage: heaviside(0)
heaviside(0)
sage: heaviside(x)
heaviside(x)
REFERENCES:
Bases: sage.symbolic.function.BuiltinFunction
The Kronecker delta function (kronecker_delta(m, n)).
INPUT:
DEFINITION:
Kronecker delta function is defined as:
for and for
EXAMPLES:
sage: kronecker_delta(1,2)
0
sage: kronecker_delta(1,1)
1
sage: m,n=var('m,n')
sage: kronecker_delta(m,n)
kronecker_delta(m, n)
REFERENCES:
Bases: sage.symbolic.function.BuiltinFunction
The signum or sgn function (sgn(x)).
INPUT:
DEFINITION:
The sgn function, is defined as:
for , for and for
EXAMPLES:
sage: sgn(-1)
-1
sage: sgn(1)
1
sage: sgn(0)
0
sage: sgn(x)
sgn(x)
We can also use sign:
sage: sign(1)
1
sage: sign(0)
0
sage: a = AA(-5).nth_root(7)
sage: sign(a)
-1
REFERENCES:
Bases: sage.symbolic.function.BuiltinFunction
The unit step function, (unit_step(x)).
INPUT:
DEFINITION:
The unit step function, is defined in Sage as:
for and for
EXAMPLES:
sage: unit_step(-1)
0
sage: unit_step(1)
1
sage: unit_step(0)
1
sage: unit_step(x)
unit_step(x)