On 5 August 2014 12:38, Waldek Hebisch <[email protected]> wrote: > > I wrote: > > > > If you mean support for derivatives of "jumpy" functions, this > > is reasonable easy. Namely, we need to add 'signum' and > > 'diracDelta' to standard operators and define new functions > > (this is very much like current definition of 'abs'). Then > > we need to define derivatives: > > > > D(abs(x), x) = signum(x) > > D(signum(x), x) = diracDelta(x) > > > > and derivatives of 'diracDelta' would remain in symbolic > > form. Such definitions are sound and cause no special > > trouble. > > In the attachement there is a patch in this direction. > Simple things work, but I did only very light testing. > Up to now I have noticed two problem. First, I used > name 'sign' to be consistent with other uses.
I think that signum is not really consistent with other uses of sign. > But > this means that 'sign' is heavily overloaded and > interpreter has problems with choosing correct > signature. In fact, there was also compilation > problem: in DoubleFloat there is implementation > of 'sign : % -> Integer'. But with the patch we > also have 'sign : % -> %' and compiler was picking > the second signature and report error. > I prefer signum rather than sign. In particular sign(0)=0 but signum(0) is undefined. > Second problem is that after changing definition of > derivative of 'abs' several integrals containing > 'abs' which used to work now fail. In a sense this > is trivial problem: our integrator can integrate > only derivatives of a few simple forms containg 'abs' > and changing derivative of 'abs' changed set of > "integrable" functions. But still, this is not > nice. I do not like to change the definition of the derivative of 'abs'. Or rather I would really like to change it to derivative(opabs, (x : F) : F +-> x*inv(abs(x)) And define signum by abs(x)*signum(x) = x > > I am thinking about including (possibly improved) > version of this patch. Comments? > Although I do greatly appreciate your work on this, in general I do not like this patch very much. It seems to me that it treats this problem in only a superficial symbolic way (like Maple, Mathematica and Maxima). I think it would be more in keeping with the algebraic approach to choose some theory of distributions and extend FriCAS by implementing it (or at least some parts of it) explicitly. In particular after reviewing what I could find on the subject I think I like the ideas of Shirokov best: http://en.wikisource.org/wiki/Algebra_of_generalized_functions_%28Shirokov%29 http://en.wikipedia.org/wiki/Signum_function#Generalized_signum_function where signum and diracDelta are generalized functions. signum(x)^2 = 1 diracDelta(x)^2 = 0 signum(x)*diracDelta(x) + diracDelta(x)*signum(x) = 0 etc. In FriCAS signum(x) and diracDelta(x) would be singular GeneralizedExpressions. An Expression could be coerced to a continuous GeneralizedExpression while derivatives of GeneralizedExpressions would in general also be GeneralizedExpressions having both a continuous and possibly a singular part. In Expression we should have D(x/abs(x), x) = (abs(x)^2 - x^2 ) / abs(x)^3 but D(x/abs(x),x)$GeneralizedExpression(Integer) = 2*diracDelta(x) D(signum(x),x) = 2*diracDelta(x) Is anyone else interested in this sort of approach? Regards, Bill Page. -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/fricas-devel. For more options, visit https://groups.google.com/d/optout.
