Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-22 Thread sympy
Updates: Status: Fixed Labels: -NeedsBetterPatch PassedReview Comment #50 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 This was pushed in. -- You received this

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-15 Thread sympy
Comment #46 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 This was also explained before, but let me explain again. diff can only take derivatives with respect to objects that

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-15 Thread sympy
Comment #47 on issue 1816 by ronan.l...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 Yes, I know that the implementation uses ._diff_wrt, but the resulting behaviour appears completely arbitrary

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-15 Thread sympy
Comment #49 on issue 1816 by brad.froehle: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 Because cos(2*x) can unambiguously be replaced in the original expression with the simple rule of exact substitution

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-14 Thread sympy
Comment #37 on issue 1816 by Vinzent.Steinberg: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 I thing the most important thing is a clearly defined behavior. The docstring should mention that it does this

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-14 Thread sympy
Comment #38 on issue 1816 by brad.froehle: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 I'm really uncomfortable with this, for example: x = symbols('x') diff(1-cos(x)**2,sin(x)) 0

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-14 Thread sympy
Comment #39 on issue 1816 by elliso...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 We have already established that derivatives wrt to function does *not* commute with algebraic manipulations.

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-14 Thread sympy
Comment #40 on issue 1816 by brad.froehle: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 So then these are derivatives with respect to formal variables with no additional meaning like Frechet derivatives.

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-14 Thread sympy
Comment #41 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 Brad, Luke, Brian, Vinzent, Ronan, and others, what do you think of my description in comment 35? If you are OK with

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-14 Thread sympy
Comment #42 on issue 1816 by ronan.l...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 Brian: The Hamiltonian is a constant for any specific trajectory of the system, but it's not a constant over

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-14 Thread sympy
Comment #43 on issue 1816 by ronan.l...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 Aaron: it's a clear description of *some operation* (except that you didn't explain what kind of objects are

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-14 Thread sympy
Comment #44 on issue 1816 by hazelnu...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 Aaron: expr.subs(function, Dummy('x')).diff(Dummy('x')).subs(Dummy('x'), function) Makes perfect sense to

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-14 Thread sympy
Comment #45 on issue 1816 by ronan.l...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 What users should enter is rather something like: x, t = symbols('x, t') xfunc = Function('x') diff(2*x + 4,

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-13 Thread sympy
Comment #24 on issue 1816 by ronan.l...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 If we're talking about elementary calculus, then deriving wrt a function doesn't make sense. We already have

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-13 Thread sympy
Comment #25 on issue 1816 by elliso...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 I don't have any further time to put into arguing about the deep mathematics of these derivatives. I feel like

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-13 Thread sympy
Comment #26 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 OK, I think I get it now (after comment 23 it clicked for me). So I think I am +1 to this now, even with the strange

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-13 Thread sympy
Comment #27 on issue 1816 by Vinzent.Steinberg: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 Can you cite an example of somewhere where this is computed as so with the Lagrangian? The simplest possible

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-13 Thread sympy
Comment #28 on issue 1816 by elliso...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 The Falling Mass example here shows this, in that diff(L, x(t)) == mg, which assumes that the derivative you

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-13 Thread sympy
Comment #29 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 OK, that is evidence enough for me. And this would assumedly extend to diff(f(x), x, n).diff(diff(f(x), x, m)) ==

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-13 Thread sympy
Comment #30 on issue 1816 by ronan.l...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 There's absolutely no need here to compute diff(x', x) (whatever that means). x and x' are separate,

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-13 Thread sympy
Comment #31 on issue 1816 by Vinzent.Steinberg: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 Sorry, I don't get your point. Why can't we consider diff(x'(t), x(t)) as diff(x', x)? Let's say they are just

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-13 Thread sympy
Comment #32 on issue 1816 by ronan.l...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 The problem is that in the conventional presentation of Lagrangian mechanics, we use the same name for

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-13 Thread sympy
Comment #34 on issue 1816 by ronan.l...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 In formal mathematics, Lagrangian mechanics is presented in terms of stuff like differential manifolds and

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-13 Thread sympy
Comment #35 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 From that Wikipedia page you reference: However, all that is meant by this notation is the derivative of the function

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-11 Thread sympy
Comment #20 on issue 1816 by renato.c...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 I don't think what's being implemented is the Frechet derivative. For example:

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-11 Thread sympy
Comment #21 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 I don't think you're interpreting WolframAlpha's output correctly. See

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-11 Thread sympy
Comment #22 on issue 1816 by renato.c...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 Yeah, maybe you are right, but then I have no idea what it is actually computing. -- You received this

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-11 Thread sympy
Comment #23 on issue 1816 by elliso...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 The issue topic looks more like a simple partial derivative, as is very commonly used in mechanic Yes,

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-07 Thread sympy
Comment #19 on issue 1816 by Vinzent.Steinberg: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 In variational calculus, the first derivative of a functional is not that complicated. Acutally, it's definition

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-06 Thread sympy
Comment #10 on issue 1816 by Vinzent.Steinberg: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 As long as it does not introduce regressions I'm fine with merging it. People who don't like derivative wrt a

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-06 Thread sympy
Comment #11 on issue 1816 by ronan.l...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 I don't understand what Derivative(f(g(x)), g(x)) or diff(f(g(x)), g(x)) are supposed to mean, mathematically.

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-06 Thread sympy
Comment #12 on issue 1816 by elliso...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 The simplest way of thinking about derivatives wrt to function is that functions like f(x) and g(x) are *no

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-06 Thread sympy
Comment #13 on issue 1816 by elliso...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 I should also note that the wikipedia page on the chain rule explains a bit more about the notation, and also

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-06 Thread sympy
Comment #14 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 My last concern was to add some raises() tests, which it seems has been done, so I am +1 if the tests pass. Brian's

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-06 Thread sympy
Comment #15 on issue 1816 by ronan.l...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 @Brian: Could you please explain the intended meaning of diff(f(g(x)), g(x)) and Derivative(f(g(x)), g(x)) in

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-06 Thread sympy
Comment #16 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 I think the best way to explain it is to just assert that diff(f(g(x)), g(x)) is f'(g(x)). In other words, the derivative

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-06 Thread sympy
Comment #17 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 WolframAlpha gives 0: http://www.wolframalpha.com/input/?i=diff(diff(f(x),%20x),%20f(x)) Apparently it's a Fréchet

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-06 Thread sympy
Comment #18 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 By the way, the distributional derivative exists for any integrable function, even if it's continuous nowhere. I think

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-05 Thread sympy
Comment #9 on issue 1816 by elliso...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 I checked and Mathematica returns *exactly* what my Funcderiv branch does. Namely, it treats derivatives wrt

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-03 Thread sympy
Comment #8 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 I claim that the following is *now* correct even though this is different from what wsa given after 1620 was fixed. Hmm.

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-02 Thread sympy
Updates: Cc: asmeurer Comment #4 on issue 1816 by elliso...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 I have implemented the _diff_wrt approach in my pull request. It appears to

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-02 Thread sympy
Updates: Labels: -NeedsReview NeedsBetterPatch Comment #5 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 Tests and docs would be nice. So far, I get In [2]: diff(f(x),

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-02 Thread sympy
Comment #6 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 And this definitely needs to be fixed: In [7]: f(g(x)).diff(x) Out[7]: dd ─(f(g(x)))⋅──(g(x)) dg(x)

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2011-07-02 Thread sympy
Comment #7 on issue 1816 by elliso...@gmail.com: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 In my funcderiv branch the following now work: In [2]: diff(f(x), x).diff(f(x)) Out[2]: 0 In [3]: (sin(f(x)) -

Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2010-02-02 Thread sympy
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

Re: Issue 1816 in sympy: Adding partial derivatives and taking derivatives with respect to functions

2010-02-02 Thread sympy
Comment #1 on issue 1816 by asmeurer: Adding partial derivatives and taking derivatives with respect to functions http://code.google.com/p/sympy/issues/detail?id=1816 This is probably related to issue 1660. The solution posted there is just a quick fix though. I think we need issue 1620