[GiNaC-devel] Implicit derivation of functions (re-submission)
Vladimir V. Kisil
kisilv at maths.leeds.ac.uk
Wed Oct 29 11:25:27 CET 2014
Dear All,
I am resending the patch for implicit derivation of
functions. Quote from the previous submission:
http://www.ginac.de/pipermail/ginac-devel/2013-November/002053.html
" I wish to propose another GiNaC extension. Consider function
abs(). Since it can be presented as abs(z)=sqrt(z*z.conjugate()), the
derivative of abs(f) may be calculated as
(abs(f))'=(f'*f.conjugate()+f*f'.conjugate())/2/abs(f)
However, this formula cannot be packed into the present GiNaC code,
since it only knows about the chain rule. Thus, the patch adds a
possibility to define derivatives of functions in some general
expression. In particular, the above derivative of abs() is
defined. Example:
cout << abs(log(z)).diff(z) << endl;
// (before) -> D[0](abs)(log(z))*z^(-1)
// (now) -> 1/2*(z^(-1)*conjugate(log(z))+log(z)*conjugate(z)^(-1))*abs(log(z))^(-1)
"
This issue independently appeared in this discussion:
http://www.ginac.de/pipermail/ginac-devel/2014-April/002106.html
If it is not included in the core code, then a user need to redefine
the entire GiNaC function class to have this feature.
Best wishes,
Vladimir
--
Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk
-- www: http://maths.leeds.ac.uk/~kisilv/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Implicit-derivation-of-functions.patch
Type: text/x-diff
Size: 8522 bytes
Desc: patch file
URL: <http://www.cebix.net/pipermail/ginac-devel/attachments/20141029/6c9c40e9/attachment.bin>
More information about the GiNaC-devel
mailing list