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

Edit detail for SandBoxDiracDelta revision 39 of 40

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
Editor: Bill page
Time: 2014/08/19 19:33:47 GMT+0
Note: Expression Integer

changed:
-abs(z)==sqrt(z*conjugate(z)); abs(z)
-abz(a)==sqrt((a+%i*b)*(a-%i*b)); abz(x)
abs(z:Expression Integer):Expression Integer == sqrt(z*conjugate(z)); abs(z)
abz(a:Expression Integer):Expression Integer == sqrt((a+%i*b)*(a-%i*b)); abz(x)

changed:
-realSignum:=eval(eval(abs',z=a+%i*b),[conjugate(a)=a,conjugate(b)=b])
realSignum:Expression Integer:=eval(eval(abs',z=a+%i*b),[conjugate(a)=a,conjugate(b)=b])

changed:
-realDirac:=eval(eval(abs'',z=a+%i*b),[conjugate(a)=a,conjugate(b)=b])
realDirac:Expression Integer:=eval(eval(abs'',z=a+%i*b),[conjugate(a)=a,conjugate(b)=b])

changed:
-realUnitDoublet:=eval(eval(abs''',z=a+%i*b),[conjugate(a)=a,conjugate(b)=b])
realUnitDoublet:Expression Integer:=eval(eval(abs''',z=a+%i*b),[conjugate(a)=a,conjugate(b)=b])

changed:
-We are interested in the behaviour of these functions in the limit as
We are interested in the behavior of these functions in the limit as

removed:
-complexNormalize complexExpand %

changed:
-diracDelta(x^2)
-limit(%,b=0)
limit(diracDelta(x^2), b=0)

changed:
-unitDoublet(x^2)
-limit(%,b=0)
limit( unitDoublet(x^2) ,b=0)

changed:
-realHeaviside:=integrate(diracDelta(a),a)::Expression Complex Integer
realHeaviside:=integrate(diracDelta(a),a)

changed:
-limit(d1,b=0)
-normalize(d1-diracDelta(x))
simplify(d1-diracDelta(x))

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)

\label{eq1}\sqrt{z \ {\overline z}}(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)

\label{eq2}\sqrt{{{x}^{2}}+{{b}^{2}}}(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)

\label{eq3}{{\overline z}+ z}\over{2 \ {\sqrt{z \ {\overline z}}}}(3)
Type: Expression(Integer)
fricas
abs'':=wirtingerD(abs',z)+wirtingerD(abs',conjugate z)

\label{eq4}{-{{\overline z}^{2}}+{2 \  z \ {\overline z}}-{{z}^{2}}}\over{4 \  z \ {\overline z}\ {\sqrt{z \ {\overline z}}}}(4)
Type: Expression(Integer)
fricas
abs''':=wirtingerD(abs'',z)+wirtingerD(abs'',conjugate z)

\label{eq5}{{3 \ {{\overline z}^{3}}}-{3 \  z \ {{\overline z}^{2}}}-{3 \ {{z}^{2}}\ {\overline z}}+{3 \ {{z}^{3}}}}\over{8 \ {{z}^{2}}\ {{\overline z}^{2}}\ {\sqrt{z \ {\overline z}}}}(5)
Type: Expression(Integer)

Consider these as complex functions of x + i b for real x and b.

fricas
realSignum:Expression Integer:=eval(eval(abs',z=a+%i*b),[conjugate(a)=a,conjugate(b)=b])

\label{eq6}a \over{\sqrt{{{b}^{2}}+{{a}^{2}}}}(6)
Type: Expression(Integer)
fricas
test(realSignum=D(abz(a),a))

\label{eq7} \mbox{\rm true} (7)
Type: Boolean
fricas
signum(x)==eval(realSignum,a=x); signum(x)
fricas
Compiling function signum with type Variable(x) -> Expression(
      Integer)

\label{eq8}x \over{\sqrt{{{x}^{2}}+{{b}^{2}}}}(8)
Type: Expression(Integer)
fricas
--
realDirac:Expression Integer:=eval(eval(abs'',z=a+%i*b),[conjugate(a)=a,conjugate(b)=b])

\label{eq9}{{b}^{2}}\over{{\left({{b}^{2}}+{{a}^{2}}\right)}\ {\sqrt{{{b}^{2}}+{{a}^{2}}}}}(9)
Type: Expression(Integer)
fricas
test(realDirac=D(abz(a),[a,a]))

\label{eq10} \mbox{\rm true} (10)
Type: Boolean
fricas
diracDelta(x)==eval(realDirac/2,a=x); diracDelta(x)
fricas
Compiling function diracDelta with type Variable(x) -> Expression(
      Integer)

\label{eq11}{{b}^{2}}\over{{\left({2 \ {{x}^{2}}}+{2 \ {{b}^{2}}}\right)}\ {\sqrt{{{x}^{2}}+{{b}^{2}}}}}(11)
Type: Expression(Integer)
fricas
--
realUnitDoublet:Expression Integer:=eval(eval(abs''',z=a+%i*b),[conjugate(a)=a,conjugate(b)=b])

\label{eq12}-{{3 \  a \ {{b}^{2}}}\over{{\left({{b}^{4}}+{2 \ {{a}^{2}}\ {{b}^{2}}}+{{a}^{4}}\right)}\ {\sqrt{{{b}^{2}}+{{a}^{2}}}}}}(12)
Type: Expression(Integer)
fricas
test(realUnitDoublet=D(abz(a),[a,a,a]))

\label{eq13} \mbox{\rm true} (13)
Type: Boolean
fricas
unitDoublet(x)==eval(-realUnitDoublet/2,a=x); unitDoublet(x)
fricas
Compiling function unitDoublet with type Variable(x) -> Expression(
      Integer)

\label{eq14}{3 \ {{b}^{2}}\  x}\over{{\left({2 \ {{x}^{4}}}+{4 \ {{b}^{2}}\ {{x}^{2}}}+{2 \ {{b}^{4}}}\right)}\ {\sqrt{{{x}^{2}}+{{b}^{2}}}}}(14)
Type: Expression(Integer)

We are interested in the behavior of these functions in the limit as b \to 0.

signum Properties

fricas
limit( signum(1) ,b=0)
fricas
Compiling function signum with type PositiveInteger -> Expression(
      Integer)

\label{eq15}1(15)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( signum(-1) ,b=0)
fricas
Compiling function signum with type Integer -> Expression(Integer)

\label{eq16}- 1(16)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( signum(0) ,b=0)
fricas
Compiling function signum with type NonNegativeInteger -> Expression
      (Integer)

\label{eq17}0(17)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( signum(x)^2 ,b=0)

\label{eq18}1(18)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
-- odd function
test( signum(x)=-signum(-x))
fricas
Compiling function signum with type Polynomial(Integer) -> 
      Expression(Integer)

\label{eq19} \mbox{\rm true} (19)
Type: Boolean

diracDelta Properties

fricas
limit( diracDelta(1) ,b=0)
fricas
Compiling function diracDelta with type PositiveInteger -> 
      Expression(Integer)

\label{eq20}0(20)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( diracDelta(-1) ,b=0)
fricas
Compiling function diracDelta with type Integer -> Expression(
      Integer)

\label{eq21}0(21)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( diracDelta(0) ,b=0)
fricas
Compiling function diracDelta with type NonNegativeInteger -> 
      Expression(Integer)

\label{eq22}+ \infty(22)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
-- even function
test( diracDelta(x)=diracDelta(-x) )
fricas
Compiling function diracDelta with type Polynomial(Integer) -> 
      Expression(Integer)

\label{eq23} \mbox{\rm true} (23)
Type: Boolean
fricas
limit( diracDelta(x)^2 ,b=0)

\label{eq24}0(24)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
integrate(diracDelta(x),x=%minusInfinity..%plusInfinity,"noPole")

\label{eq25}1(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)

\label{eq26} \mbox{\rm true} (26)
Type: Boolean
fricas
limit(integrate(log(x)*diracDelta(x-t),x=%minusInfinity..%plusInfinity,"noPole"), b=0)

\label{eq27}{\log \left({{t}^{2}}\right)}\over 2(27)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
eval(%,t=exp(x))

\label{eq28}x(28)
Type: Expression(Integer)
fricas
integrate(diracDelta(2*x),x=%minusInfinity..%plusInfinity,"noPole")

\label{eq29}1 \over 2(29)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)
fricas
--
limit( signum(x)*diracDelta(x) ,b=0)

\label{eq30}0(30)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit(diracDelta(x^2), b=0)

\label{eq31}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))

\label{eq32} \mbox{\rm true} (32)
Type: Boolean
fricas
limit( unitDoublet(1) ,b=0)
fricas
Compiling function unitDoublet with type PositiveInteger -> 
      Expression(Integer)

\label{eq33}0(33)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( unitDoublet(-1) ,b=0)
fricas
Compiling function unitDoublet with type Integer -> Expression(
      Integer)

\label{eq34}0(34)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( unitDoublet(0) ,b=0)
fricas
Compiling function unitDoublet with type NonNegativeInteger -> 
      Expression(Integer)

\label{eq35}0(35)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
-- odd function
test( unitDoublet(x)=-unitDoublet(-x) )
fricas
Compiling function unitDoublet with type Polynomial(Integer) -> 
      Expression(Integer)

\label{eq36} \mbox{\rm true} (36)
Type: Boolean
fricas
limit( unitDoublet(x)^2 ,b=0)

\label{eq37}0(37)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
integrate(unitDoublet(x),x=%minusInfinity..%plusInfinity,"noPole")

\label{eq38}0(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)

\label{eq39} \mbox{\rm true} (39)
Type: Boolean
fricas
integrate(unitDoublet(2*x),x=%minusInfinity..%plusInfinity,"noPole")

\label{eq40}0(40)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)
fricas
--
limit( signum(x)*unitDoublet(x) ,b=0)

\label{eq41}0(41)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( diracDelta(x)*unitDoublet(x) ,b=0)

\label{eq42}0(42)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( unitDoublet(x^2) ,b=0)

\label{eq43}0(43)
Type: Union(OrderedCompletion?(Expression(Integer)),...)

Heaviside

fricas
realHeaviside:=integrate(diracDelta(a),a)
fricas
Compiling function diracDelta with type Variable(a) -> Expression(
      Integer)

\label{eq44}-{{{b}^{2}}\over{{2 \  a \ {\sqrt{{{b}^{2}}+{{a}^{2}}}}}-{2 \ {{b}^{2}}}-{2 \ {{a}^{2}}}}}(44)
Type: Union(Expression(Integer),...)
fricas
heavisideStep(x)==eval(realHeaviside,a=x)
Type: Void
fricas
limit( heavisideStep(1), b=0)
There are 12 exposed and 6 unexposed library operations named eval having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op eval to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named eval with argument type(s) Union(Expression(Integer),List(Expression(Integer))) Equation(Polynomial(Integer))
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. FriCAS will attempt to step through and interpret the code.

\label{eq45}1(45)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( heavisideStep(-1) ,b=0)

\label{eq46}0(46)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( heavisideStep(0) ,b=0)

\label{eq47}1 \over 2(47)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( heavisideStep(x), x=0)

\label{eq48}1 \over 2(48)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( heavisideStep(x) ,x=%plusInfinity)

\label{eq49}1(49)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
limit( heavisideStep(x) ,x=%minusInfinity)

\label{eq50}0(50)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
test(simplify( (1+signum(x))/2 - heavisideStep(x) ) = 0)

\label{eq51} \mbox{\rm true} (51)
Type: Boolean
fricas
test(limit( integrate(heavisideStep(t),t=%minusInfinity..x, "noPole") - x*heavisideStep(x), b=0) =0)

\label{eq52} \mbox{\rm true} (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)

\label{eq53}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
{{24}\ {{x}^{7}}}+ 
\
\
\displaystyle
{{66}\ {{b}^{2}}\ {{x}^{5}}}+ 
\
\
\displaystyle
{{60}\ {{b}^{4}}\ {{x}^{3}}}+ 
\
\
\displaystyle
{{18}\ {{b}^{6}}\  x}
(53)
Type: Union(f1: OrderedCompletion?(Expression(Integer)),...)
fricas
simplify(d1-diracDelta(x))

\label{eq54}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
{{24}\ {{x}^{6}}}+ 
\
\
\displaystyle
{{54}\ {{b}^{2}}\ {{x}^{4}}}+ 
\
\
\displaystyle
{{36}\ {{b}^{4}}\ {{x}^{2}}}+{6 \ {{b}^{6}}}
(54)
Type: Expression(Integer)

Problems?

fricas
-- expected 1/abs(c)
integrate(diracDelta(c*x),x=%minusInfinity..%plusInfinity,"noPole")

\label{eq55}1 \over c(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)

\label{eq56}\mbox{\tt "failed"}(56)
Type: Union(fail: failed,...)
fricas
-- expected
f(t)
fricas
Compiling function f with type Variable(t) -> Polynomial(Integer)

\label{eq57}{c 1 \ {{t}^{2}}}+{c 2 \  t}+ c 3(57)
Type: Polynomial(Integer)
fricas
-- expected 1
integrate(exp(x)*diracDelta(x),x=%minusInfinity..%plusInfinity,"noPole")

\label{eq58}\mbox{\tt "failed"}(58)
Type: Union(fail: failed,...)
fricas
-- expected 1
integrate(exp(x)*unitDoublet(x),x=%minusInfinity..%plusInfinity,"noPole")

\label{eq59}\mbox{\tt "failed"}(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)

\label{eq60}\int^{
\displaystyle
x}{{\sqrt{\%A \ {\overline \%A}}}\ {d \%A}}(60)
Type: Union(Expression(Integer),...)
fricas
integrate(abz(x),x)

\label{eq61}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left({
\begin{array}{@{}l}
\displaystyle
-{2 \ {{b}^{2}}\  x \ {\sqrt{{{x}^{2}}+{{b}^{2}}}}}+ 
\
\
\displaystyle
{2 \ {{b}^{2}}\ {{x}^{2}}}+{{b}^{4}}
(61)
Type: Union(Expression(Integer),...)
fricas
limit(%,b=0)

\label{eq62}{{x}^{2}}\over 2(62)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
-- expected abs(x)
integrate(abs',z)

\label{eq63}\int^{
\displaystyle
z}{{{{\overline \%A}+ \%A}\over{2 \ {\sqrt{\%A \ {\overline \%A}}}}}\ {d \%A}}(63)
Type: Union(Expression(Integer),...)
fricas
integrate(signum(x),x)

\label{eq64}{-{x \ {\sqrt{{{x}^{2}}+{{b}^{2}}}}}+{{x}^{2}}+{{b}^{2}}}\over{{\sqrt{{{x}^{2}}+{{b}^{2}}}}- x}(64)
Type: Union(Expression(Integer),...)
fricas
limit(%,b=0)

\label{eq65}x(65)
Type: Union(OrderedCompletion?(Expression(Integer)),...)
fricas
-- expected signum(x)/2
integrate(abs'',z)

\label{eq66}\int^{
\displaystyle
z}{{{-{{\overline \%A}^{2}}+{2 \  \%A \ {\overline \%A}}-{{\%A}^{2}}}\over{4 \  \%A \ {\overline \%A}\ {\sqrt{\%A \ {\overline \%A}}}}}\ {d \%A}}(66)
Type: Union(Expression(Integer),...)
fricas
integrate(diracDelta(x^2+y^2), x=%minusInfinity..%plusInfinity, "noPole")

\label{eq67}\mbox{\tt "failed"}(67)
Type: Union(fail: failed,...)

Convolution

fricas
g(x)==abz(x)/2; g(y)
fricas
Compiling function g with type Variable(y) -> Expression(Integer)

\label{eq68}{\sqrt{{{y}^{2}}+{{b}^{2}}}}\over 2(68)
Type: Expression(Integer)
fricas
h(x)==heavisideStep(x+1/2)-heavisideStep(x-1/2); h(x)
Cannot compile map: heavisideStep We will attempt to interpret the code.

\label{eq69}{\left(
\begin{array}{@{}l}
\displaystyle
{{\left({4 \ {{b}^{2}}\  x}+{2 \ {{b}^{2}}}\right)}\ {\sqrt{{4 \ {{x}^{2}}}+{4 \  x}+{4 \ {{b}^{2}}}+ 1}}}+ 
\
\
\displaystyle
{{\left(-{4 \ {{b}^{2}}\  x}+{2 \ {{b}^{2}}}\right)}\ {\sqrt{{4 \ {{x}^{2}}}-{4 \  x}+{4 \ {{b}^{2}}}+ 1}}}-{{16}\ {{b}^{2}}\  x}
(69)
Type: Expression(Integer)
fricas
conv:=integrate(h(x-y)*g(y),y=%minusInfinity..%plusInfinity,"noPole")

\label{eq70}\mbox{\tt "failed"}(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

[terminal=pslatex,terminaloptions=color,scale=1.3]
load "SandBoxDiracDeltaX2.dat"