For the function of two variables, the natural assumption is that f(0,1) means x=0 and y=1 because that's alphabetical order - that's how nearly everyone does it in the symbolic math world (just think back to algebra and calculus courses - it's ALWAYS written in that order, except for the occasional cases where Greek letters are mixed with the latin alphabet). But your point about the issue of "magic" is certainly valid... More important, it seems to me, is to find some way to use sympy functions in the numerical package... but as long as I'm not missing some underlying trick that's already been done that's supposed to make this easy, I can look into implementing it, myself.
On Apr 15, 10:46 am, Gael Varoquaux <[EMAIL PROTECTED]> wrote: > On Tue, Apr 15, 2008 at 09:06:45AM -0700, [EMAIL PROTECTED] wrote: > > I understand that there are other ways of doing this that may be > > numerically more efficient, but it seems to me that the expectation > > that you should be able to call a function of one variable in this > > fashion (or even a function of two variables as e.g. g=x*y+x/y ; > > g(4,2) ) seems like a reasonable assumption - is there any good reason > > why this has not been implemented? > > I am not sure what your expectations are, but: > g = x*y + x/y > is no way to define g as a function of x and y. When you call g(0, 1), > which is 0 and 1, x, or y? How is sympy supposed to guess? > > You could have something like g(x=0, y=1), but this involves a fair > amount of magic that the sympy developers do not want to put in there > code, I think (I suggested this a while ago). The reason being that the > more magic you put in a module, the harder it is to make it behave > consistantly (here for instance, everything has become a callable, so you > can introduce nasty bugs in your code, and have difficulties finding > them). > > Cheers, > > Gaƫl --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---