On Mon, Apr 16, 2012 at 6:31 AM, Andreas Kloeckner
<[email protected]> wrote:
> Hi all,
>
> When differentiating, can I have sympy call me back to ask about each
> partial derivative? Suppose I'm differentiating by t, and sympy
> encounters an x, can I get a callback asking for \partial x/partial t?
>
> A hacky way would be to express all dependencies explicitly as function
> symbols 'x(t)', and then re-traverse the result and substitute away the
> resulting partial derivatives... but I figure there must be a better
> way?
vweber may be interested in this, too: from geometry.util
```
def idiff(eq, y, x, dep=None):
"""Return dy/dx assuming that y and any other variables given in dep
depend on x.
>>> from sympy.abc import x, y, a
>>> from sympy.geometry.util import idiff
>>> idiff(x**2 + y**2 - 4, y, x)
-x/y
>>> idiff(x + a + y, y, x)
-1
>>> idiff(x + a + y, y, x, [a])
-Derivative(a, x) - 1
```
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.