On Fri, Apr 18, 2008 at 03:12:03PM +0200, Ondrej Certik wrote: > On Wed, Apr 16, 2008 at 4:16 PM, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote: > > > > On Wed, Apr 16, 2008 at 03:48:20PM +0200, Ondrej Certik wrote: > > > That's the automatic evaluation: > > > > > > In [1]: L, C = symbols("LC") > > > > > > In [2]: sqrt(L/C) > > > Out[2]: > > > ⎽⎽⎽ > > > ╲╱ L > > > ───── > > > ⎽⎽⎽ > > > ╲╱ C > > > > > > In [3]: print sqrt(L/C) > > > C**(-1/2)*L**(1/2) > > > > > > > > > Basically, it's the same problem as with: > > > > > > In [7]: f = (x*y)**2 > > > > > > In [8]: f > > > Out[8]: > > > 2 2 > > > x *y > > > > > > Should we do this be default? Or should we handle it like with log: > > > > > > In [1]: e=log(k*m) > > > > > > In [2]: e.expand() > > > Out[2]: log(k) + log(m) > > > > I prefer the expr.expand() variant. > > > > I have a big expr where sqrt(L/C) is only a tedious coefficiant. Then > > I want to derivate this big expr.diff(t) and when I read the > > result I want recogize fastly the old coefficiants. > > > > But have you an other example where is the automatic eval good for? > > Well, so far we considered this as part of what you'd do by hand and > thus it's useful. That's the only reason. Plus other CAS systems imho > do the same.
And thats why sympy exists. I want to controll what is going on with my expressions as I can do it by hand. I dont like the above because sometimes I want to substitute these expressions: In [1]: (x*y)**2 Out[1]: 2 2 x *y In [2]: f=(x*y)**2 In [3]: f.subs(x*y, z) Out[3]: 2 2 x *y I dont need to use sympy for small calculus which I can do by hand. But I need sympy for the calculus with _big_ expression. And I often substitute things in thuch big expressions. By, Friedrich --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---