New definition of derivative of abs(x)
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
abs2sqrt := rule abs(a+%i*b)==sqrt(a^2+b^2)
Type: RewriteRule
?(Integer,
Complex(Integer),
Expression(Complex(Integer)))
Derivatives
fricas
%signum:=differentiate(abs(%z),%z)
Type: Expression(Integer)
fricas
%diracDelta:=differentiate(%signum,%z)/2
Type: Expression(Integer)
Distributions
fricas
realSignum:=abs2sqrt(eval(%signum,%z=a+%i*b)+eval(%signum,%z=a-%i*b))/2
Type: Expression(Complex(Integer))
fricas
signum(x)==eval(realSignum,a=x)
Type: Void
fricas
signum(x)
fricas
Compiling function signum with type Variable(x) -> Expression(
Complex(Integer))
Type: Expression(Complex(Integer))
fricas
--
realDirac:=abs2sqrt(eval(%diracDelta,%z=a+%i*b)+eval(%diracDelta, %z=a-%i*b))/4
Type: Expression(Complex(Integer))
fricas
diracDelta(x)==eval(realDirac,a=x)
Type: Void
fricas
diracDelta(x)
fricas
Compiling function diracDelta with type Variable(x) -> Expression(
Complex(Integer))
Type: Expression(Complex(Integer))
Properties
fricas
diracDelta(1)
fricas
Compiling function diracDelta with type PositiveInteger ->
Expression(Complex(Integer))
Type: Expression(Complex(Integer))
fricas
limit(%,b=0)
Type: Union(OrderedCompletion
?(Expression(Complex(Integer))),
...)
fricas
diracDelta(-1)
fricas
Compiling function diracDelta with type Integer -> Expression(
Complex(Integer))
Type: Expression(Complex(Integer))
fricas
limit(%,b=0)
Type: Union(OrderedCompletion
?(Expression(Complex(Integer))),
...)
fricas
diracDelta(0)
fricas
Compiling function diracDelta with type NonNegativeInteger ->
Expression(Complex(Integer))
Type: Expression(Complex(Integer))
fricas
limit(%,b=0)
Type: Union(OrderedCompletion
?(Expression(Complex(Integer))),
...)
fricas
signum(1)
fricas
Compiling function signum with type PositiveInteger -> Expression(
Complex(Integer))
Type: Expression(Complex(Integer))
fricas
limit(%,b=0)
Type: Union(OrderedCompletion
?(Expression(Complex(Integer))),
...)
fricas
signum(-1)
fricas
Compiling function signum with type Integer -> Expression(Complex(
Integer))
Type: Expression(Complex(Integer))
fricas
limit(%,b=0)
Type: Union(OrderedCompletion
?(Expression(Complex(Integer))),
...)
fricas
signum(0)
fricas
Compiling function signum with type NonNegativeInteger -> Expression
(Complex(Integer))
Type: Expression(Complex(Integer))
fricas
limit(%,b=0)
Type: Union(OrderedCompletion
?(Expression(Complex(Integer))),
...)
fricas
--
signum(x)^2
Type: Expression(Complex(Integer))
fricas
limit(%,b=0)
Type: Union(OrderedCompletion
?(Expression(Complex(Integer))),
...)
fricas
diracDelta(x)^2
Type: Expression(Complex(Integer))
fricas
limit(%,b=0)
Type: Union(OrderedCompletion
?(Expression(Complex(Integer))),
...)
fricas
-- b disappears?
integrate(diracDelta(x),x=%minusInfinity..%plusInfinity,"noPole")
Type: Union(f1: OrderedCompletion
?(Expression(Complex(Integer))),
...)
fricas
limit(%,b=0)
Type: Union(OrderedCompletion
?(Expression(Integer)),
...)
fricas
-- generally
f(x)==x+c
Type: Void
fricas
f(x)*diracDelta(x)
fricas
Compiling function f with type Variable(x) -> Polynomial(Integer)
Type: Expression(Complex(Integer))
fricas
integrate(%,x=%minusInfinity..%plusInfinity,"noPole")
Type: Union(f1: OrderedCompletion
?(Expression(Complex(Integer))),
...)
fricas
--
signum(x)*diracDelta(x)
Type: Expression(Complex(Integer))
fricas
limit(%,b=0)
Type: Union(OrderedCompletion
?(Expression(Complex(Integer))),
...)
fricas
diracDelta(x^2)
fricas
Compiling function diracDelta with type Polynomial(Integer) ->
Expression(Complex(Integer))
Type: Expression(Complex(Integer))
fricas
limit(%,b=0)
Type: Union(OrderedCompletion
?(Expression(Complex(Integer))),
...)
Problems?
fricas
integrate(abs(x),x)
Type: Union(Expression(Integer),...)
fricas
-- expected x*abs(x)/2
eval(abs2sqrt(abs(a+%i*b)/2+abs(a-%i*b)/2),a=x)
Type: Expression(Complex(Integer))
fricas
integrate(%,x)
Type: Union(Expression(Complex(Integer)),...)
fricas
limit(%,b=0)
Type: Union(OrderedCompletion
?(Expression(Complex(Integer))),
...)
fricas
integrate(%signum,%z)
Type: Union(Expression(Integer),...)
fricas
-- expected abs(x)
integrate(signum(x),x)
Type: Union(Expression(Complex(Integer)),...)
fricas
limit(%,b=0)
Type: Union(OrderedCompletion
?(Expression(Complex(Integer))),
...)
fricas
integrate(%diracDelta,%z)
Type: Union(Expression(Integer),...)
fricas
-- expected
signum(x)/2
Type: Expression(Complex(Integer))
fricas
integrate(diracDelta(x),x)
Type: Union(Expression(Complex(Integer)),...)
fricas
limit(%,b=0)
Type: Union(OrderedCompletion
?(Expression(Complex(Integer))),
...)
Representing diracDelta 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 2];
fricas
Y:=[eval(diracDelta(x),b=1.0)::DFLOAT for x in X];
fricas
Compiling function diracDelta with type DoubleFloat -> Expression(
Complex(DoubleFloat))
fricas
gnuDraw(X,Y,"SandBoxDiracDelta1.dat")
Graph data being transmitted to the viewport manager...
FriCAS2D data being transmitted to the viewport manager...
Type: Void