presumably just surrounding your expression with re() should do the job.

The error seems to be a bug in the adaptive sampling so switching off
(with a kwarg) should solve the problem.

Concerning the complex numbers, originally whenever a complex number
was encountered we plotted only the real part. Later it was changed to
not plotting anything in such cases. Anyway, the but seems to be
happening before we reach that part of the logic.

On 2 December 2012 19:07, Matthew Rocklin <mrock...@gmail.com> wrote:
> I'm trying to plot a statistical expression using the following code
>
> from sympy.stats import *
> X = StudentT("X", 50)
> t = Symbol('t', positive=True)
> plot(simplify(E(exp(I*t*X))), (t, 1e-6, 1e-2))
>
> and I get this error
>
> --> 455                 elif p[1] is None or q[1] is None or not flat(p,
> new_point, q):
> TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
> -> 1009     vector_a = x - y
>
> The expression I'm plotting is challenging (contains meijer-g functions) and
> produces little complex parts which I suspect are throwing off the plotting
> function
>
> In [48]: simplify(E(exp(I*t*X))).subs(t, .000001).evalf()
> Out[48]: 0.999999999999479 + 1.56564942264937e-29⋅ⅈ
>
> Is there a way to just plot the real part of this expression?
> Is there a way to avoid the small complex numbers?

-- 
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 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to