Thanks!
On Dec 9, 5:17 pm, Jason Grout <[EMAIL PROTECTED]> wrote:
> Doug Bradshaw wrote:
> > Okay, here's the story: I wanted to plot a Fourier transform of a
> > Gaussian that is truncated (mulitplied by unit stepfunction). Using
> > "integral", I got an answer that looked nice, but contained anerror
> >functionwith an imaginary argument. Because thaterrorfunction
> > couldn't be evaluated, I couldn't plot. So, that brings up the
> > question: is there a nice way to evaluate theerrorfunctionof an
> > imaginary number (or more generally a complex number) in Sage?
>
> > sage: erf(1)
> > erf(1)
> > sage: erf(1).n()
> > 0.842700792949715
> > sage: erf(I)
> > erf(I)
> > sage: erf(I).n()
> > ---------------------------------------------------------------------------
> > TypeError Traceback (most recent call
> > last)
>
> I'm not sure about the Sage erf, but you could also use the scipy erf:
>
> sage: import scipy.special
> sage: scipy.special.erf(complex(I))
> 1.6504257587975433j
>
> You could also do scipy.special.<tab> (press tab) to see the other
> variants of erf that scipy has.
>
> Note that you need to do complex(I) or the equivalent, since scipy does
> not understand Sage complex numbers.
>
> Seehttp://docs.scipy.org/doc/scipy/reference/special.html#error-function...
>
> Jason
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---