I know this is an old post, but I found a way around it for the heaviside,
at least.
lambdify allows you to specify different libraries to use (such as 'numpy')
to look for functions, but you also give a dictionary specifying your own.
Just tried the following and it works:
Heavisidenew=lambda x: 1*(x>=0)
h=lambdify(x,sympy.special.delta_functions.Heaviside(x),({"Heaviside":Heavisidenew},'numpy')
and as a test:
h(-1)
h(1)
h(np.linspace(-2,2))
and no problems came up.
On Monday, March 4, 2013 at 1:35:11 AM UTC-8, G B wrote:
>
> As is probably becoming apparent, I've been busy lambdifying stuff...
>
> My latest runtime problem is trying to convolve things with DiracDeltas.
> The result comes back with a Heaviside function. A quick look through the
> numpy docs doesn't show a numpy equivalent function for either DiracDelta
> or Heaviside-- does it makes sense to print these as Piecewise functions?
>
--
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 [email protected].
To post to this group, send email to [email protected].
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/0760fec6-b05c-49f3-8668-03d2a7b1ea76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.