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
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 +
Hi Jan,
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
> print DY
>
> I had expected (eqn 2): [1/F, -X/F**2, -1]
> But
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) i
janwillem wrote:
> Thanks for the explanation. I moved the doit()s to later in the script
> where everything boils down to scalars and that works.
>
> I had tried jacobean but sometimes that gives me AttributeError. Here
> is the real thing I was working on:
>
> def lpu_nonlin(Y, X, C):
> """
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