Load 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
fricas
%signum:=differentiate(abs(%x),%x)
Type: Expression(Integer)
fricas
signum(z)==eval(%signum,%x=z)
Type: Void
fricas
signum(x)
fricas
Compiling function signum with type Variable(x) -> Expression(
Integer)
Type: Expression(Integer)
fricas
%diracDelta:=differentiate(signum(%x),%x)
fricas
Compiling function signum with type Variable( ) -> Expression(
Integer)
Type: Expression(Integer)
fricas
diracDelta(z)==eval(%diracDelta/2,%x=z)
Type: Void
fricas
diracDelta(x)
fricas
Compiling function diracDelta with type Variable(x) -> Expression(
Integer)
Type: Expression(Integer)
fricas
realDirac:=(diracDelta(x+%i*y)+diracDelta(x-%i*y))/2
fricas
Compiling function diracDelta with type Polynomial(Complex(Integer))
-> Expression(Complex(Integer))
Type: Expression(Complex(Integer))
fricas
msqrt:=operator('msqrt)
fricas
conj1:Ruleset(Integer,Complex Integer,Expression Complex Integer) := ruleset([ _
rule sqrt(-1)*:a==msqrt(-1)*a, _
rule -sqrt(-1)*:a==-msqrt(-1)*a _
]$List RewriteRule(Integer,Complex Integer,Expression Complex Integer) )
Type: Ruleset(Integer,Complex(Integer),Expression(Complex(Integer)))
fricas
conj2:RewriteRule(Integer,Complex Integer,Expression(Complex Integer)):= rule msqrt(-1)==-sqrt(-1)
Type: RewriteRule
?(Integer,
Complex(Integer),
Expression(Complex(Integer)))
fricas
conj(z)==conj2 conj1 z
Type: Void
fricas
conj(a+%i*b)
fricas
Compiling function conj with type Polynomial(Complex(Integer)) ->
Expression(Complex(Integer))
Type: Expression(Complex(Integer))
fricas
abs2sqrt:RewriteRule(Integer,Complex Integer,Expression(Complex Integer)):= rule abs(x)==sqrt(x*conj(x))
Type: RewriteRule
?(Integer,
Complex(Integer),
Expression(Complex(Integer)))
fricas
abs2sqrt(abs(a+%i*b))
fricas
Compiling function conj with type Expression(Complex(Integer)) ->
Expression(Complex(Integer))
Type: Expression(Complex(Integer))
fricas
r1:=abs2sqrt realDirac
Type: Expression(Complex(Integer))
fricas
eval(realDirac,[x=0.1,y=1.0])::Float
Type: Float
fricas
eval(r1,[x=0.1,y=1.0])::Float
Type: Float
fricas
integrate(eval(r1,y=1),x=%minusInfinity..%plusInfinity,"noPole")
Type: Union(f1: OrderedCompletion
?(Expression(Complex(Integer))),
...)
fricas
limit(r1,y=0)
Type: Union(OrderedCompletion
?(Expression(Complex(Integer))),
...)
Properties
fricas
signum(x^2)
fricas
Compiling function signum with type Polynomial(Integer) ->
Expression(Integer)
Type: Expression(Integer)
fricas
diracDelta(x)^2
Type: Expression(Integer)
fricas
diracDelta(x^2)
fricas
Compiling function diracDelta with type Polynomial(Integer) ->
Expression(Integer)
Type: Expression(Integer)
fricas
signum(x)*diracDelta(x)
Type: Expression(Integer)
fricas
integrate(abs(x),x)
Type: Union(Expression(Integer),...)
fricas
-- expected x*abs(x)/2
integrate(signum(x),x)
Type: Union(Expression(Integer),...)
fricas
-- expected abs(x)
integrate(diracDelta(x),x)
Type: Union(Expression(Integer),...)
fricas
-- expected signum(x)/2
--
integrate(diracDelta(x),x=minusInfinity..plusInfinity,"noPole")
Type: Union(fail: failed,...)
fricas
integrate(x*diracDelta(x),x=minusInfinity..plusInfinity,"noPole")
Type: Union(fail: failed,...)
Bump function
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(r1,[x=x1,y=1.0])::DFLOAT for x1 in X];
fricas
gnuDraw(X,Y,"SandBoxDiracDelta1.dat")
Graph data being transmitted to the viewport manager...
FriCAS2D data being transmitted to the viewport manager...
Type: Void