I have a fix for the unevaluated derivatives bug at
http://code.google.com/p/sympy/issues/detail?id=1929.

In my branch:

In [1]: import sympy

In [2]: X, F, B = sympy.symbols('XFB')

In [3]: Y = X / F - B #eqn 1

In [4]: DY = sympy.Matrix(sympy.diff(Y, (X, F, B))).T

In [5]: print DY
[1/F, -X/F**2, -1]

If either of you want to review this, I can push this in.

Aaron Meurer

On May 4, 7:35 am, "Aaron S. Meurer" <asmeu...@gmail.com> wrote:
> On May 4, 2010, at 4:25 AM, Sebastian wrote:
>
> > On 05/04/2010 10:32 AM, janwillem wrote:
> >> I need some explanation on the workings of SymPy. As an example the
> >> following script:
> >> import sympy
> >> X, F, B = sympy.symbols('XFB')
> >> Y = X / F - B #eqn 1
> >> DY = sympy.Matrix(sympy.diff(Y, (X, F, B))).T
>
> > Do sympy.diff(Y, (X, F, B), evaluate=True) instead for now. But you're
> > right - this shouldn't be necessary. Somehow the vectorization of the
> > diff method seems to fail and set evaluate to False.
>
> I created issue 1929 for this.
>
> Aaron Meurer
>
>
>
>
>
> >> print DY
>
> >> I had expected (eqn 2): [1/F, -X/F**2, -1]
> >> But get: [D(-B + X/F, X), D(-B + X/F, F), D(-B + X/F, B)]
>
> >> Not after doing a trick of which I cannot remember why I tried it, I
> >> get the desired result
> >> DY = DY.subs({X:X, F:F, B:B})
>
> > This works because subs evaluates the expression in the end (which
> > wasn't done before).
> >> From the doc I had thought that DY.doin() would work but that gives
> >> "raise AttributeError()".
>
> > First, the name of the method is doit. Second, DY is a python tuple
> > which doesn't have this method.
> >> So there is obviously something I do not understand, please some help
> >> Janwillem
>
> > Sebastian
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "sympy" group.
> > To post to this group, send email to sy...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > sympy+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/sympy?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to 
> sympy+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/sympy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to