Ref.
Derivative of abs
fricas
s1:=D(abs(x),x)
Type: Expression(Integer)
fricas
D(s1,x)
Type: Expression(Integer)
fricas
limit(abs(x)/x,x=0,"right")
Type: Union(OrderedCompletion
?(Expression(Integer)),
...)
fricas
limit(abs(x)/x,x=0,"left")
Type: Union(OrderedCompletion
?(Expression(Integer)),
...)
An approximation to signum
fricas
D(tanh(a*x),x)
Type: Expression(Integer)
fricas
limit(%,a=%plusInfinity)
Type: Union("failed",...)
Patterns for derivatives
fricas
Abs:=operator('Abs)
fricas
D(abs(x),x)
Type: Expression(Integer)
fricas
signum:=operator('signum)
fricas
diracDelta:=operator('diracDelta)
fricas
signum(x)
Type: Expression(Integer)
fricas
D(signum(x),[x,x])
Type: Expression(Integer)
fricas
diff1:=rule
signum(x) == Abs(x)/x
D(Abs(x),x) == signum(x) + 2*x*diracDelta(x)
D(signum(x),x) == 2*diracDelta(x)
Type: Ruleset(Integer,Integer,Expression(Integer))
fricas
diff(x,y)==diff1 D(x,y)
Type: Void
fricas
diff(Abs(x),x)
fricas
Compiling function diff with type (Expression(Integer), Variable(x))
-> Expression(Integer)
Type: Expression(Integer)
fricas
diff(Abs(x)/x,x)
Type: Expression(Integer)
Adding the singular part of the derivative
fricas
diff(f,x) == D(f,x)+(limit(f,x=0,"right")-limit(f,x=0,"left"))::EXPR(INT)*diracDelta(x)
Compiled code for diff has been cleared.
1 old definition(s) deleted for function or rule diff
Type: Void
fricas
diff(abs(x),x)
There are 9 exposed and 6 unexposed library operations named -
having 2 argument(s) but none was determined to be applicable.
Use HyperDoc Browse, or issue
)display op -
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 -
with argument type(s)
Union(OrderedCompletion(Expression(Integer)),"failed")
Union(OrderedCompletion(Expression(Integer)),"failed")
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.
Type: Expression(Integer)
fricas
diff(%,x)
Type: Expression(Integer)
fricas
signum(x)==abs(x)/x
Type: Void
fricas
diff(signum(x),x)
fricas
Compiling function signum with type Variable(x) -> Expression(
Integer)
Type: Expression(Integer)
fricas
integrate(signum(x),x)
Type: Union(Expression(Integer),...)
Heaviside
fricas
H(x)==(abs(x)+x)/2/x
Type: Void
fricas
H(-0.3),H(0.3)
fricas
Compiling function H with type Float -> Float
Type: Tuple(Float)
fricas
diff(H(x),x)
fricas
Compiling function H with type Variable(x) -> Expression(Integer)
Type: Expression(Integer)
abs and sqrt
fricas
-- for x real
real:=operator('real)
fricas
abs(real x)=sqrt(real(x)^2)
Type: Equation(Expression(Integer))
fricas
-- OK
D(sqrt(x^2),x)
Type: Expression(Integer)
fricas
integrate(%,x)
Type: Union(Expression(Integer),...)
fricas
-- Wrong
integrate(sqrt(x^2),x)
Type: Union(Expression(Integer),...)
fricas
D(%,x)
Type: Expression(Integer)
fricas
-- Expected
x*sqrt(x^2)/2
Type: Expression(Integer)
fricas
D(%,x)
Type: Expression(Integer)
fricas
integrate(sqrt(x^2),x=-2..2,"noPole")
Type: Union(f1: OrderedCompletion
?(Expression(Integer)),
...)
fricas
integrate(x,x=-2..2)
Type: Union(f1: OrderedCompletion
?(Expression(Integer)),
...)
fricas
integrate(abs(x),x=-2..2,"noPole")
Type: Union(fail: failed,...)
Solving differential equations, e.g.
fricas
-- differential Operator
L(f)==D(f,[x,x])
Type: Void
fricas
-- Green function
g(x)==abs(x)/2
Type: Void
fricas
-- pulse
c(x)==H(x+1/2)-H(x-1/2)
Type: Void
fricas
c(x)
fricas
Compiling function H with type Polynomial(Fraction(Integer)) ->
Expression(Integer)
fricas
Compiling function c with type Variable(x) -> Expression(Integer)
Type: Expression(Integer)
fricas
-- convolution
integrand:=c(x-y)*g(y)
fricas
Compiling function c with type Polynomial(Integer) -> Expression(
Integer)
fricas
Compiling function g with type Variable(y) -> Expression(Integer)
Type: Expression(Integer)
fricas
conv:=integrate(integrand,y=%minusInfinity..%plusInfinity)
Type: Union(pole: potentialPole,...)
fricas
conv:=integrate(integrand,y=%minusInfinity..%plusInfinity,"noPole")
Type: Union(fail: failed,...)
fricas
conv:=integrate(integrand,y)
Type: Union(Expression(Integer),...)
fricas
-- expected result
conv:=1/2*x^2*H(x+1/2)-1/2*x+1/2*x*H(x+1/2)+1/8*H(x+1/2)-1/2*x^2*H(x-1/2)+1/2*x*H(x-1/2)-1/8*H(x-1/2)
Type: Expression(Integer)
fricas
-- ramp
diff(conv,x)
Type: Expression(Integer)
fricas
test(L conv = c(x))
fricas
Compiling function L with type Expression(Integer) -> Expression(
Integer)
Type: Boolean
fricas
gnuDraw(H(x), x=-2..2, "SandBoxSignum1.dat")
fricas
Compiling function %R with type DoubleFloat -> DoubleFloat
Type: Void
fricas
gnuDraw(c(x), x=-2..2, "SandBoxSignum2.dat")
fricas
Compiling function %S with type DoubleFloat -> DoubleFloat
Type: Void
fricas
gnuDraw(conv, x=-3..3, "SandBoxSignum3.dat")
fricas
Compiling function %T with type DoubleFloat -> DoubleFloat
Type: Void