tags:

views:

148

answers:

2
+1  Q: 

Using Enthought

Hi,

I need to calculate the inverse of complementary error function (erfc^(1))for a problem.

I was looking into python tools for it and many threads said Enthought has most of the math tools needed, so I downloaded and installed in my local user account. But I am not very sure about how to use it?

Any ideas? Thanks

+7  A: 

scipy, which is included in the enthought python distribution, contains that special function.

In [1]: from scipy.special import erfcinv
In [2]: from numpy import linspace
In [3]: x = linspace(0, 1, 10)
In [4]: y = erfcinv(x)
In [5]: y
Out[5]: 
array([  1.27116101e+308,   1.12657583e+000,   8.63123068e-001,
         6.84070350e-001,   5.40731396e-001,   4.16808192e-001,
         3.04570194e-001,   1.99556951e-001,   9.87900997e-002,
         0.00000000e+000])
Autoplectic
+1  A: 

Here's a quick example of calculations in the Enthought Python Distribution (EPD) with the inverse of the complementary error function (erfcinv), which is included in the SciPy package that comes with the EPD:

C:\>c:\Python25\python
EPD Py25 (4.1.30101) -- http://www.enthought.com/epd

Python 2.5.2 |EPD Py25 4.1.30101| (r252:60911, Dec 19 2008, 13:49:12) [MSC v.131
0 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from scipy.special import erfcinv
>>> erfcinv(0.)
1.271161006153646e+308
>>> erfcinv(1.)
0.0
>>> erfcinv(2.)
-1.271161006153646e+308
>>> exit()

C:\>
las3rjock