converting expression into function

18 views
Skip to first unread message

Ivica Nakić

unread,
Apr 22, 2014, 7:30:58 PM4/22/14
to sy...@googlegroups.com
Hi,

is there a simple way to convert an expression into a function?

For example, the solution of ODE by the function dsolve returns an expression, and I would like to define the corresponding function so I can write something like f(1) instead of f.subs(x,1).

Thanks,
Ivica

Aaron Meurer

unread,
Apr 22, 2014, 8:17:14 PM4/22/14
to sy...@googlegroups.com
If you are interested in numeric answers, use lambdify.

If you are doing things symbolically, use Lambda.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/cca3d20a-07cb-4a4d-9ed4-2cb162f9b1e8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages