login  home  contents  what's new  discussion  bug reports help  links  subscribe  changes  refresh  edit

## Distributions

We represent distributions as a complex function in the limit where the imaginary part goes to 0. Signum (sign), delta and doublet functions arise from the derivative of the absolute value function with respect to its real part.

Ref.

Use definition of conjugate and derivative of abs(x) from SandBoxFunctionalSpecialFunction

fricas
)lib FSPECX
FunctionalSpecialFunction is now explicitly exposed in frame initial
FunctionalSpecialFunction will be automatically loaded when needed
from /var/aw/var/LatexWiki/FSPECX.NRLIB/FSPECX
wirtingerD(ex,z) == eval(D(eval(ex,z=%conjugate),%conjugate),%conjugate=z)
Type: Void

Absolute value as a function of real or complex variables

fricas
abs(z:Expression Integer):Expression Integer == sqrt(z*conjugate(z)); abs(z)
Function declaration abs : Expression(Integer) -> Expression(Integer
) has been added to workspace.
fricas
Compiling function abs with type Expression(Integer) -> Expression(
Integer)
 (1)
Type: Expression(Integer)
fricas
abz(a:Expression Integer):Expression Integer == sqrt((a+%i*b)*(a-%i*b)); abz(x)
Function declaration abz : Expression(Integer) -> Expression(Integer
) has been added to workspace.
fricas
Compiling function abz with type Expression(Integer) -> Expression(
Integer)
 (2)
Type: Expression(Integer)

Total Wirtinger derivatives of this complex function (CR-calculus)

fricas
abs':=wirtingerD(abs(z),z)+wirtingerD(abs(z),conjugate z)
fricas
Compiling function wirtingerD with type (Expression(Integer),
Variable(z)) -> Expression(Integer)
fricas
Compiling function wirtingerD with type (Expression(Integer),
Expression(Integer)) -> Expression(Integer)
 (3)
Type: Expression(Integer)
fricas
abs'':=wirtingerD(abs',z)+wirtingerD(abs',conjugate z)
 (4)
Type: Expression(Integer)
fricas
abs''':=wirtingerD(abs'',z)+wirtingerD(abs'',conjugate z)
 (5)
Type: Expression(Integer)

Consider these as complex functions of for real and .

fricas
realSignum:Expression Integer:=eval(eval(abs',z=a+%i*b),[conjugate(a)=a,conjugate(b)=b])
 (6)
Type: Expression(Integer)
fricas
test(realSignum=D(abz(a),a))
 (7)
Type: Boolean
fricas
signum(x)==eval(realSignum,a=x); signum(x)
fricas
Compiling function signum with type Variable(x) -> Expression(
Integer)
 (8)
Type: Expression(Integer)
fricas
--
realDirac:Expression Integer:=eval(eval(abs'',z=a+%i*b),[conjugate(a)=a,conjugate(b)=b])
 (9)
Type: Expression(Integer)
fricas
test(realDirac=D(abz(a),[a,a]))
 (10)
Type: Boolean
fricas
diracDelta(x)==eval(realDirac/2,a=x); diracDelta(x)
fricas
Compiling function diracDelta with type Variable(x) -> Expression(
Integer)
 (11)
Type: Expression(Integer)
fricas
--
realUnitDoublet:Expression Integer:=eval(eval(abs''',z=a+%i*b),[conjugate(a)=a,conjugate(b)=b])
 (12)
Type: Expression(Integer)
fricas
test(realUnitDoublet=D(abz(a),[a,a,a]))
 (13)
Type: Boolean
fricas
unitDoublet(x)==eval(-realUnitDoublet/2,a=x); unitDoublet(x)
fricas
Compiling function unitDoublet with type Variable(x) -> Expression(
Integer)
 (14)
Type: Expression(Integer)

We are interested in the behavior of these functions in the limit as .

signum Properties

fricas
limit( signum(1) ,b=0)
fricas
Compiling function signum with type PositiveInteger -> Expression(
Integer)
 (15)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( signum(-1) ,b=0)
fricas
Compiling function signum with type Integer -> Expression(Integer)
 (16)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( signum(0) ,b=0)
fricas
Compiling function signum with type NonNegativeInteger -> Expression
(Integer)
 (17)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( signum(x)^2 ,b=0)
 (18)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
-- odd function
test( signum(x)=-signum(-x))
fricas
Compiling function signum with type Polynomial(Integer) ->
Expression(Integer)
 (19)
Type: Boolean

diracDelta Properties

fricas
limit( diracDelta(1) ,b=0)
fricas
Compiling function diracDelta with type PositiveInteger ->
Expression(Integer)
 (20)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( diracDelta(-1) ,b=0)
fricas
Compiling function diracDelta with type Integer -> Expression(
Integer)
 (21)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( diracDelta(0) ,b=0)
fricas
Compiling function diracDelta with type NonNegativeInteger ->
Expression(Integer)
 (22)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
-- even function
test( diracDelta(x)=diracDelta(-x) )
fricas
Compiling function diracDelta with type Polynomial(Integer) ->
Expression(Integer)
 (23)
Type: Boolean
fricas
limit( diracDelta(x)^2 ,b=0)
 (24)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
integrate(diracDelta(x),x=%minusInfinity..%plusInfinity,"noPole")
 (25)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)
fricas
f(x)==c1*x+c2
Type: Void
fricas
test(integrate(f(x)*diracDelta(x-t),x=%minusInfinity..%plusInfinity,"noPole")=f(t))
fricas
Compiling function f with type Variable(x) -> Polynomial(Integer)
fricas
Compiling function f with type Variable(t) -> Polynomial(Integer)
 (26)
Type: Boolean
fricas
limit(integrate(log(x)*diracDelta(x-t),x=%minusInfinity..%plusInfinity,"noPole"), b=0)
 (27)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
eval(%,t=exp(x))
 (28)
Type: Expression(Integer)
fricas
integrate(diracDelta(2*x),x=%minusInfinity..%plusInfinity,"noPole")
 (29)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)
fricas
--
limit( signum(x)*diracDelta(x) ,b=0)
 (30)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit(diracDelta(x^2), b=0)
 (31)
Type: Union(OrderedCompletion?(Expression(Integer)),...)

The Unit Doublet function comes after diracDelta

fricas
test(unitDoublet(x)=3*diracDelta(x)*signum(x)/abz(x))
 (32)
Type: Boolean
fricas
limit( unitDoublet(1) ,b=0)
fricas
Compiling function unitDoublet with type PositiveInteger ->
Expression(Integer)
 (33)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( unitDoublet(-1) ,b=0)
fricas
Compiling function unitDoublet with type Integer -> Expression(
Integer)
 (34)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( unitDoublet(0) ,b=0)
fricas
Compiling function unitDoublet with type NonNegativeInteger ->
Expression(Integer)
 (35)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
-- odd function
test( unitDoublet(x)=-unitDoublet(-x) )
fricas
Compiling function unitDoublet with type Polynomial(Integer) ->
Expression(Integer)
 (36)
Type: Boolean
fricas
limit( unitDoublet(x)^2 ,b=0)
 (37)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
integrate(unitDoublet(x),x=%minusInfinity..%plusInfinity,"noPole")
 (38)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)
fricas
f(x)==c1*x^2+c2*x+c3
Compiled code for f has been cleared.
1 old definition(s) deleted for function or rule f
Type: Void
fricas
test(integrate(f(x)*unitDoublet(x-t),x=%minusInfinity..%plusInfinity,"noPole")=eval(D(f(x),x),x=t))
fricas
Compiling function f with type Variable(x) -> Polynomial(Integer)
 (39)
Type: Boolean
fricas
integrate(unitDoublet(2*x),x=%minusInfinity..%plusInfinity,"noPole")
 (40)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)
fricas
--
limit( signum(x)*unitDoublet(x) ,b=0)
 (41)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( diracDelta(x)*unitDoublet(x) ,b=0)
 (42)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( unitDoublet(x^2) ,b=0)
 (43)
Type: Union(OrderedCompletion?(Expression(Integer)),...)

Heaviside

fricas
realHeaviside:Expression Integer := integrate(diracDelta(a),a)
fricas
Compiling function diracDelta with type Variable(a) -> Expression(
Integer)
 (44)
Type: Expression(Integer)
fricas
heavisideStep(x)==eval(realHeaviside,a=x)
Type: Void
fricas
limit( heavisideStep(1), b=0)
fricas
Compiling function heavisideStep with type PositiveInteger ->
Expression(Integer)
 (45)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( heavisideStep(-1) ,b=0)
fricas
Compiling function heavisideStep with type Integer -> Expression(
Integer)
 (46)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( heavisideStep(0) ,b=0)
fricas
Compiling function heavisideStep with type NonNegativeInteger ->
Expression(Integer)
 (47)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( heavisideStep(x), x=0)
fricas
Compiling function heavisideStep with type Variable(x) -> Expression
(Integer)
 (48)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( heavisideStep(x) ,x=%plusInfinity)
 (49)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( heavisideStep(x) ,x=%minusInfinity)
 (50)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
test(simplify( (1+signum(x))/2 - heavisideStep(x) ) = 0)
 (51)
Type: Boolean
fricas
test(limit( integrate(heavisideStep(t),t=%minusInfinity..x, "noPole") - x*heavisideStep(x), b=0) =0)
fricas
Compiling function heavisideStep with type Variable(t) -> Expression
(Integer)
 (52)
Type: Boolean
fricas
-- diracDelta?
d1:=integrate(heavisideStep(t)*unitDoublet(t),t=%minusInfinity..x, "noPole")
fricas
Compiling function unitDoublet with type Variable(t) -> Expression(
Integer)
 (53)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)
fricas
simplify(d1-diracDelta(x))
 (54)
Type: Expression(Integer)

Problems?

fricas
-- expected 1/abs(c)
integrate(diracDelta(c*x),x=%minusInfinity..%plusInfinity,"noPole")
 (55)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)
fricas
f(x)==c1*x^2+c2*x+c3
Compiled code for f has been cleared.
1 old definition(s) deleted for function or rule f
Type: Void
fricas
integrate(f(x)*diracDelta(x-t),x=%minusInfinity..%plusInfinity,"noPole")
fricas
Compiling function f with type Variable(x) -> Polynomial(Integer)
 (56)
Type: Union(fail: failed,...)
fricas
-- expected
f(t)
fricas
Compiling function f with type Variable(t) -> Polynomial(Integer)
 (57)
Type: Polynomial(Integer)
fricas
-- expected 1
integrate(exp(x)*diracDelta(x),x=%minusInfinity..%plusInfinity,"noPole")
 (58)
Type: Union(fail: failed,...)
fricas
-- expected 1
integrate(exp(x)*unitDoublet(x),x=%minusInfinity..%plusInfinity,"noPole")
 (59)
Type: Union(fail: failed,...)
fricas
-- loops forever on %plusInfinity limit of indefinite integral
--integrate(log(x)*unitDoublet(x-t),x=%minusInfinity..%plusInfinity,"noPole")
-- expected x*abs(x)/2
integrate(abs(x),x)
 (60)
Type: Union(Expression(Integer),...)
fricas
integrate(abz(x),x)
 (61)
Type: Union(Expression(Integer),...)
fricas
limit(%,b=0)
 (62)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
-- expected abs(x)
integrate(abs',z)
 (63)
Type: Union(Expression(Integer),...)
fricas
integrate(signum(x),x)
 (64)
Type: Union(Expression(Integer),...)
fricas
limit(%,b=0)
 (65)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
-- expected signum(x)/2
integrate(abs'',z)
 (66)
Type: Union(Expression(Integer),...)
fricas
integrate(diracDelta(x^2+y^2), x=%minusInfinity..%plusInfinity, "noPole")
 (67)
Type: Union(fail: failed,...)

Convolution

fricas
g(x)==abz(x)/2; g(y)
fricas
Compiling function g with type Variable(y) -> Expression(Integer)
 (68)
Type: Expression(Integer)
fricas
h(x)==heavisideStep(x+1/2)-heavisideStep(x-1/2); h(x)
fricas
Compiling function heavisideStep with type Polynomial(Fraction(
Integer)) -> Expression(Integer)
fricas
Compiling function h with type Variable(x) -> Expression(Integer)
 (69)
Type: Expression(Integer)
fricas
conv:=integrate(h(x-y)*g(y),y=%minusInfinity..%plusInfinity,"noPole")
fricas
Compiling function h with type Polynomial(Integer) -> Expression(
Integer)
 (70)
Type: Union(fail: failed,...)

Representing a distribution as a series of bump functions

fricas
)lib GDRAW
GnuDraw is now explicitly exposed in frame initial
GnuDraw will be automatically loaded when needed from
/var/aw/var/LatexWiki/GDRAW.NRLIB/GDRAW
X:=[(x/10)::DFLOAT for x in -100..100 by 1];
Type: List(DoubleFloat?)
fricas
Y:=[eval(unitDoublet(x),b=1.0)::DFLOAT for x in X];
fricas
Compiling function unitDoublet with type DoubleFloat -> Expression(
DoubleFloat)
Type: List(DoubleFloat?)
fricas
gnuDraw(X,Y,"SandBoxDiracDeltaX2.dat")
Graph data being transmitted to the viewport manager...
FriCAS2D data being transmitted to the viewport manager...
Type: Void

 Subject:   Be Bold !! ( 15 subscribers )