The function might be much more complicated than that so that symbolic 
differentiation won't scale unlike automatic differentiation.

It might also be that I can't write down the function as a symbolic 
expression without going through a lot of extra work. The application I 
have in mind is applying a bunch of functions, additions and 
multiplications on intervals assigned to vertices and edges of a 
triangulation. This would be really easy to do with automatic 
differentiation (in fact, I already did an ad-hoc implementation).

Symbolic integration and automatic differentiation are two different 
things! And there really are applications for the latter.

On Friday, June 22, 2018 at 1:14:17 PM UTC-7, Matthias Goerner wrote:
>
> I have a function such as cos(x/y) and values for x and y and want to use 
> automatic differentiation (a la wikipedia article 
> <https://en.wikipedia.org/wiki/Automatic_differentiation#Automatic_differentiation_using_dual_numbers>)
>  
> to find the value and derivatives with respect to x and y. Can this be done 
> easily in Sage, preferably using interval arithmetic?
>
> I was hoping for an object that I could use something like this:
>
> sage: A.<dx, dy> = AutomaticDifferentiationField(RDF, 2)
> sage: x = 2.0 + dx
> sage: y = 3.0 + dy
> sage: f = cos(x,y)
> sage: f
> 0.785887260776948 -0.303099142275227 * dx + 0.137415511793275 * dy
> sage: f.value()
> 0.785887260776948
> sage: f.derivatives()
> [-0.303099142275227, 0.137415511793275]
>
> And replacing RDF by RIF and setting x = RIF(1.99, 2.01) + dx, y = ... 
> would do it over interval arithmetic then.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to