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?
On Apr 15, 12:36 am, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote: > On Tue, Apr 15, 2008 at 09:08:47AM +0200, Friedrich Hagedorn wrote: > > In [27]: f=Lambda(x, exp(x*x)*log(x*x)-x) > > In [29]: f(2.0) > > Out[29]: -2 + exp(4)*log(4) > > > I think this is not the expected behavior, but you can do > > > In [30]: f(2.0).evalf() > > Out[30]: 73.68910751852562519599736335 > > > The advantage from the Lambda() methode is that you can use your > > sympy expressions directly. But it is very slow compared to the python > > lambda. > > Ok. One more way is > > In [5]: F=lambdify(exp(x*x)*log(x*x)-x, [x]) > In [10]: F(2) > Out[10]: 73.6891075185 > > And this ist fast, but dont work with numpy arrays. This topic was > discussed in > > http://groups.google.com/group/sympy/browse_thread/thread/41d4a85323d... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---