Status: New Owner: ---- Labels: Type-Defect Priority-Medium
New issue 1816 by Yohumbus: Adding partial derivatives and taking derivatives with respect to functions
http://code.google.com/p/sympy/issues/detail?id=1816 What I have been trying to do is construct a lagrangian and perform the Euler-lagrange equations on it from within Sympy. http://en.wikipedia.org/wiki/Euler_lagrange The main change that needs to happen for this to work is to allow Functions to behave more like symbols in some instances, so that we can take derivatives with respect to them. There are some gotchas in taking total derivates i.e. g(x) = x+x**2 and f(x) symbolic then dg(x)/df(x) = dg/dx*dx/df = 2x+1*1/f'(x). and similar effects (this might get too hairy in multi dimentional cases). as it stands right now, the f' would be a derivative object Derivative(f,x). For symbolic functions, I also propose that symbolic functions replace their .fdiff function with one that creates a Partial derivative (also a symbolic function) that simply remembers which arguments have had derivatives on them, and it instantiates this function with its own argument list. This would also allow more consistent assumptions for mixed partials (http://code.google.com/p/sympy/issues/detail?id=1435). Having these partials would make something like Derivative(f(x**2),x, evaluate=True) -> 2*x*Derivative(f(x**2),x**2) be easier to compute since it would reduce to Derivative(f(x**2),x, evaluate=True) -> 2*x*Partial(f,1)(x**2) # where the 1 means a derivative in the first argument, just like fdiff this also allows intuitive substitution functionality Partial(f,1)(x**2).subs(f,sin) -> cos(x**2) #or we can add a doit step These changes would allow the Sympy core to do a lot more classical mechanics. Adding Partial would not be an extensive task, but adding derivatives of functions could be. Would this damage some of the simplifying or integrating capabilities? -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings -- You received this message because you are subscribed to the Google Groups "sympy-issues" 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-issues?hl=en.
