~ubuntu-branches/ubuntu/karmic/python-scipy/karmic

« back to all changes in this revision

Viewing changes to Lib/special/info_special.py

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T. Chen (new)
  • Date: 2005-03-16 02:15:29 UTC
  • Revision ID: james.westby@ubuntu.com-20050316021529-xrjlowsejs0cijig
Tags: upstream-0.3.2
ImportĀ upstreamĀ versionĀ 0.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
Special Functions
 
3
=================
 
4
 
 
5
  Airy Functions
 
6
 
 
7
    airy     -- Airy functions and their derivatives.
 
8
    airye    -- Exponentially scaled Airy functions
 
9
    ai_zeros -- **Zeros of Airy functions Ai(x) and Ai'(x)
 
10
    bi_zeros -- **Zeros of Airy functions Bi(x) and Bi'(x)
 
11
 
 
12
  Elliptic Functions and Integrals
 
13
 
 
14
    ellipj    -- Jacobian elliptic functions
 
15
    ellipk    -- Complete elliptic integral of the first kind.
 
16
    ellipkinc -- Incomplete elliptic integral of the first kind.
 
17
    ellipe    -- Complete elliptic integral of the second kind.
 
18
    ellipeinc -- Incomplete elliptic integral of the second kind.
 
19
 
 
20
  Bessel Functions
 
21
 
 
22
    jn       -- Bessel function of integer order and real argument.
 
23
    jv       -- Bessel function of real-valued order and complex argument.
 
24
    jve      -- Exponentially scaled Bessel function.
 
25
    yn       -- Bessel function of second kind (integer order).
 
26
    yv       -- Bessel function of the second kind (real-valued order).
 
27
    yve      -- Exponentially scaled Bessel function of the second kind.
 
28
    kn       -- Modified Bessel function of the third kind (integer order).
 
29
    kv       -- Modified Bessel function of the third kind (real order).
 
30
    kve      -- Exponentially scaled modified Bessel function of the
 
31
                  third kind.
 
32
    iv       -- Modified Bessel function.
 
33
    ive      -- Exponentially scaled modified Bessel function.
 
34
    hankel1  -- Hankel function of the first kind.
 
35
    hankel1e -- Exponentially scaled Hankel function of the first kind.
 
36
    hankel2  -- Hankel function of the second kind.
 
37
    hankel2e -- Exponentially scaled Hankel function of the second kind.
 
38
 
 
39
    lmbda       -- **Sequence of lambda functions with arbitrary order v.
 
40
 
 
41
  Zeros of Bessel Functions
 
42
 
 
43
    jnjnp_zeros -- **Zeros of integer-order Bessel functions and derivatives
 
44
                       sorted in order.
 
45
    jnyn_zeros  -- **Zeros of integer-order Bessel functions and derivatives
 
46
                       as separate arrays.
 
47
    jn_zeros    -- **Zeros of Jn(x)
 
48
    jnp_zeros   -- **Zeros of Jn'(x)
 
49
    yn_zeros    -- **Zeros of Yn(x)
 
50
    ynp_zeros   -- **Zeros of Yn'(x)
 
51
    y0_zeros    -- **Complex zeros: Y0(z0)=0 and values of Y0'(z0)
 
52
    y1_zeros    -- **Complex zeros: Y1(z1)=0 and values of Y1'(z1)
 
53
    y1p_zeros   -- **Complex zeros of Y1'(z1')=0 and values of Y1(z1')
 
54
 
 
55
  Faster versions of common Bessel Functions.
 
56
    
 
57
    j0       -- Bessel function of order 0.
 
58
    j1       -- Bessel function of order 1.
 
59
    y0       -- Bessel function of second kind of order 0.
 
60
    y1       -- Bessel function of second kind of order 1.
 
61
    i0       -- Modified Bessel function of order 0.
 
62
    i0e      -- Exponentially scaled modified Bessel function of order 0.
 
63
    i1       -- Modified Bessel function of order 1.
 
64
    i1e      -- Exponentially scaled modified Bessel function of order 1.
 
65
    k0       -- Modified Bessel function of the third kind of order 0.
 
66
    k0e      -- Exponentially scaled modified Bessel function of the
 
67
                  third kind of order 0.
 
68
    k1       -- Modified Bessel function of the third kind of order 1.
 
69
    k1e      -- Exponentially scaled modified Bessel function of the
 
70
                  third kind of order 1.
 
71
 
 
72
  Integrals of Bessel Functions.
 
73
 
 
74
    itj0y0     -- Basic integrals of j0 and y0 from 0 to x.
 
75
    it2j0y0    -- Integrals of (1-j0(t))/t from 0 to x and
 
76
                    y0(t)/t from x to inf.
 
77
    iti0k0     -- Basic integrals of i0 and k0 from 0 to x.
 
78
    it2i0k0    -- Integrals of (i0(t)-1)/t from 0 to x and
 
79
                    k0(t)/t from x to inf.
 
80
    besselpoly -- Integral of a bessel function: Jv(2*a*x) * x**lambda
 
81
                    from x=0 to 1.
 
82
 
 
83
  Derivatives of Bessel Functions.
 
84
 
 
85
    jvp     -- Nth derivative of Jv(v,z)
 
86
    yvp     -- Nth derivative of Yv(v,z)
 
87
    kvp     -- Nth derivative of Kv(v,z)
 
88
    ivp     -- Nth derivative of Iv(v,z)
 
89
    h1vp    -- Nth derivative of H1v(v,z)
 
90
    h2vp    -- Nth derivative of H2v(v,z)    
 
91
 
 
92
  Spherical Bessel Functions
 
93
 
 
94
    sph_jn   -- **Sequence of spherical Bessel functions, jn(z)
 
95
    sph_yn   -- **Sequence of spherical Bessel functions, yn(z)
 
96
    sph_jnyn -- **Sequence of spherical Bessel functions, jn(z) and yn(z)
 
97
    sph_in   -- **Sequence of spherical Bessel functions, in(z)
 
98
    sph_kn   -- **Sequence of spherical Bessel functions, kn(z)
 
99
    sph_inkn -- **Sequence of spherical Bessel functions, in(z) and kn(z)
 
100
 
 
101
  Ricatti-Bessel Functions
 
102
 
 
103
    ricatti_jn -- **Sequence of Ricatti-Bessel functions of first kind.
 
104
    ricatti_yn -- **Sequence of Ricatti-Bessel functions of second kind.
 
105
 
 
106
  Struve Functions
 
107
 
 
108
    struve       -- Struve function --- Hv(x)
 
109
    modstruve    -- Modified struve function --- Lv(x)
 
110
    itstruve0    -- Integral of H0(t) from 0 to x
 
111
    it2struve0   -- Integral of H0(t)/t from x to Inf.
 
112
    itmodstruve0 -- Integral of L0(t) from 0 to x.
 
113
    
 
114
        
 
115
  Raw Statistical Functions (Friendly versions in scipy.stats)
 
116
 
 
117
    bdtr       -- Sum of terms 0 through k of of the binomial pdf.
 
118
    bdtrc      -- Sum of terms k+1 through n of the binomial pdf.
 
119
    bdtri      -- Inverse of bdtr
 
120
    btdtr      -- Integral from 0 to x of beta pdf.
 
121
    btdtri     -- Quantiles of beta distribution
 
122
    fdtr       -- Integral from 0 to x of F pdf.
 
123
    fdtrc      -- Integral from x to infinity under F pdf.
 
124
    fdtri      -- Inverse of fdtrc
 
125
    gdtr       -- Integral from 0 to x of gamma pdf.
 
126
    gdtrc      -- Integral from x to infinity under gamma pdf.
 
127
    gdtri      -- Quantiles of gamma distribution
 
128
    nbdtr      -- Sum of terms 0 through k of the negative binomial pdf.
 
129
    nbdtrc     -- Sum of terms k+1 to infinity under negative binomial pdf.
 
130
    nbdtri     -- Inverse of nbdtr
 
131
    pdtr       -- Sum of terms 0 through k of the Poisson pdf.
 
132
    pdtrc      -- Sum of terms k+1 to infinity of the Poisson pdf.
 
133
    pdtri      -- Inverse of pdtr
 
134
    stdtr      -- Integral from -infinity to t of the Student-t pdf.
 
135
    stdtri     -- Inverse of stdtr (quantiles)
 
136
    chdtr      -- Integral from 0 to x of the Chi-square pdf.
 
137
    chdtrc     -- Integral from x to infnity of Chi-square pdf.
 
138
    chdtri     -- Inverse of chdtrc.
 
139
    ndtr       -- Integral from -infinity to x of standard normal pdf
 
140
    ndtri      -- Inverse of ndtr (quantiles)
 
141
    smirnov    -- Kolmogorov-Smirnov complementary CDF for one-sided
 
142
                    test statistic (Dn+ or Dn-)
 
143
    smirnovi   -- Inverse of smirnov.
 
144
    kolmogorov -- The complementary CDF of the (scaled) two-sided test
 
145
                          statistic (Kn*) valid for large n.
 
146
    kolmogi    -- Inverse of kolmogorov
 
147
    tklmbda    -- Tukey-Lambda CDF
 
148
      
 
149
  Gamma and Related Functions
 
150
 
 
151
    gamma        -- Gamma function.
 
152
    gammaln      -- Log of the absolute value of the gamma function.
 
153
    gammainc     -- Incomplete gamma integral.
 
154
    gammaincinv  -- Inverse of gammainc.
 
155
    gammaincc    -- Complemented incomplete gamma integral.
 
156
    gammainccinv -- Inverse of gammaincc.
 
157
    beta         -- Beta function.
 
158
    betaln       -- Log of the absolute value of the beta function.
 
159
    betainc      -- Incomplete beta integral.
 
160
    betaincinv   -- Inverse of betainc.
 
161
    betaincinva  -- Inverse (in first argument, a) of betainc
 
162
    betaincinvb  -- Inverse (in first argument, b) of betainc        
 
163
    psi(digamma) -- Logarithmic derivative of the gamma function.
 
164
    rgamma       -- One divided by the gamma function.
 
165
    polygamma    -- Nth derivative of psi function.
 
166
 
 
167
  Error Function and Fresnel Integrals
 
168
  
 
169
    erf           -- Error function.
 
170
    erfc          -- Complemented error function (1- erf(x))
 
171
    erfinv        -- Inverse of error function
 
172
    erfcinv       -- Inverse of erfc
 
173
    erf_zeros     -- **Complex zeros of erf(z)
 
174
    fresnel       -- Fresnel sine and cosine integrals.
 
175
    fresnel_zeros -- Complex zeros of both Fresnel integrals
 
176
    fresnelc_zeros -- **Complex zeros of fresnel cosine integrals
 
177
    fresnels_zeros -- **Complex zeros of fresnel sine integrals
 
178
    modfresnelp   -- Modified Fresnel integrals F_+(x) and K_+(x)
 
179
    modfresnelm   -- Modified Fresnel integrals F_-(x) and K_-(x)
 
180
 
 
181
  Legendre Functions
 
182
 
 
183
    lpn      -- **Legendre Functions (polynomials) of the first kind
 
184
    lqn      -- **Legendre Functions of the second kind.
 
185
    lpmn     -- **Associated Legendre Function of the first kind.
 
186
    lqmn     -- **Associated Legendre Function of the second kind.
 
187
    lpmv     -- Associated Legendre Function of arbitrary non-negative
 
188
                   degree v.
 
189
    sph_harm -- Spherical Harmonics (complex-valued) Y^m_n(theta,phi)
 
190
 
 
191
  Orthogonal polynomials  --- 15 types
 
192
   ** These functions all return a polynomial class which can then be
 
193
      evaluated:  vals = chebyt(n)(x)
 
194
      This class also has an attribute 'weights' which
 
195
      return the roots, weights, and total weights for the appropriate 
 
196
      form of Gaussian quadrature.  These are returned in an n x 3 array with roots
 
197
      in the first column, weights in the second column, and total weights in the final
 
198
      column
 
199
 
 
200
    legendre    -- **Legendre polynomial P_n(x) (lpn -- for function).
 
201
    chebyt      -- **Chebyshev polynomial T_n(x)
 
202
    chebyu      -- **Chebyshev polynomial U_n(x)
 
203
    chebyc      -- **Chebyshev polynomial C_n(x)
 
204
    chebys      -- **Chebyshev polynomial S_n(x)
 
205
    jacobi      -- **Jacobi polynomial P^(alpha,beta)_n(x)
 
206
    laguerre    -- **Laguerre polynomial, L_n(x)
 
207
    genlaguerre -- **Generalized (Associated) Laguerre polynomial, L^alpha_n(x)
 
208
    hermite     -- **Hermite polynomial H_n(x)
 
209
    hermitenorm -- **Normalized Hermite polynomial, He_n(x)
 
210
    gegenbauer  -- **Gegenbauer (Ultraspherical) polynomials, C^(alpha)_n(x)
 
211
    sh_legendre -- **shifted Legendre polynomial, P*_n(x)
 
212
    sh_chebyt   -- **shifted Chebyshev polynomial, T*_n(x)
 
213
    sh_chebyu   -- **shifted Chebyshev polynomial, U*_n(x)
 
214
    sh_jacobi   -- **shifted Jacobi polynomial, J*_n(x) = G^(p,q)_n(x)
 
215
      
 
216
  HyperGeometric Functions
 
217
 
 
218
    hyp2f1   -- Gauss hypergeometric function (2F1)
 
219
    hyp1f1   -- Confluent hypergeometric function (1F1)
 
220
    hyperu   -- Confluent hypergeometric function (U)
 
221
    hyp0f1   -- Confluent hypergeometric limit function (0F1)
 
222
    hyp2f0   -- Hypergeometric function (2F0) 
 
223
    hyp1f2   -- Hypergeometric function (1F2)
 
224
    hyp3f0   -- Hypergeometric function (3F0)
 
225
 
 
226
  Parabolic Cylinder Functions
 
227
 
 
228
    pbdv     -- Parabolic cylinder function Dv(x) and derivative.
 
229
    pbvv     -- Parabolic cylinder function Vv(x) and derivative. 
 
230
    pbwa     -- Parabolic cylinder function W(a,x) and derivative.
 
231
    pbdv_seq -- **Sequence of parabolic cylinder functions Dv(x)
 
232
    pbvv_seq -- **Sequence of parabolic cylinder functions Vv(x)
 
233
    pbdn_seq -- **Sequence of parabolic cylinder functions Dn(z), complex z
 
234
 
 
235
  mathieu and Related Functions (and derivatives)
 
236
 
 
237
    mathieu_a       -- Characteristic values for even solution (ce_m)
 
238
    mathieu_b       -- Characteristic values for odd solution (se_m)
 
239
    mathieu_even_coef -- **sequence of expansion coefficients for even solution
 
240
    mathieu_odd_coef  -- **sequence of expansion coefficients for odd solution
 
241
       ** All the following return both function and first derivative **
 
242
    mathieu_cem     -- Even mathieu function
 
243
    mathieu_sem     -- Odd mathieu function
 
244
    mathieu_modcem1 -- Even modified mathieu function of the first kind
 
245
    mathieu_modcem2 -- Even modified mathieu function of the second kind
 
246
    mathieu_modsem1 -- Odd modified mathieu function of the first kind
 
247
    mathieu_modsem2 -- Odd modified mathieu function of the second kind
 
248
 
 
249
  Spheroidal Wave Functions
 
250
 
 
251
    pro_ang1   -- Prolate spheroidal angular function of the first kind
 
252
    pro_rad1   -- Prolate spheroidal radial function of the first kind
 
253
    pro_rad2   -- Prolate spheroidal radial function of the second kind
 
254
    obl_ang1   -- Oblate spheroidal angluar function of the first kind
 
255
    obl_rad1   -- Oblate spheroidal radial function of the first kind
 
256
    obl_rad2   -- Oblate spheroidal radial function of the second kind
 
257
    pro_cv     -- Compute characteristic value for prolate functions
 
258
    obl_cv     -- Compute characteristic value for oblate functions
 
259
    pro_cv_seq -- Compute sequence of prolate characteristic values
 
260
    obl_cv_seq -- Compute sequence of oblate characteristic values    
 
261
     ** The following functions require pre-computed characteristic values **
 
262
    pro_ang1_cv -- Prolate spheroidal angular function of the first kind
 
263
    pro_rad1_cv -- Prolate spheroidal radial function of the first kind
 
264
    pro_rad2_cv -- Prolate spheroidal radial function of the second kind
 
265
    obl_ang1_cv -- Oblate spheroidal angluar function of the first kind
 
266
    obl_rad1_cv -- Oblate spheroidal radial function of the first kind
 
267
    obl_rad2_cv -- Oblate spheroidal radial function of the second kind
 
268
 
 
269
  Kelvin Functions
 
270
  
 
271
    kelvin       -- All Kelvin functions (order 0) and derivatives.
 
272
    kelvin_zeros -- **Zeros of All Kelvin functions (order 0) and derivatives
 
273
    ber          -- Kelvin function ber x
 
274
    bei          -- Kelvin function bei x
 
275
    berp         -- Derivative of Kelvin function ber x
 
276
    beip         -- Derivative of Kelvin function bei x
 
277
    ker          -- Kelvin function ker x
 
278
    kei          -- Kelvin function kei x
 
279
    kerp         -- Derivative of Kelvin function ker x
 
280
    keip         -- Derivative of Kelvin function kei x
 
281
    ber_zeros    -- **Zeros of Kelvin function bei x
 
282
    bei_zeros    -- **Zeros of Kelvin function ber x
 
283
    berp_zeros   -- **Zeros of derivative of Kelvin function ber x
 
284
    beip_zeros   -- **Zeros of derivative of Kelvin function bei x
 
285
    ker_zeros    -- **Zeros of Kelvin function kei x
 
286
    kei_zeros    -- **Zeros of Kelvin function ker x
 
287
    kerp_zeros   -- **Zeros of derivative of Kelvin function ker x
 
288
    keip_zeros   -- **Zeros of derivative of Kelvin function kei x
 
289
  
 
290
  Other Special Functions
 
291
 
 
292
    expn         -- Exponential integral.
 
293
    exp1         -- Exponential integral of order 1 (for complex argument)
 
294
    expi         -- Another exponential integral -- Ei(x)
 
295
    wofz         -- Fadeeva function.
 
296
    dawsn        -- Dawson's integral.
 
297
    shichi       -- Hyperbolic sine and cosine integrals.
 
298
    sici         -- Integral of the sinc and "cosinc" functions.
 
299
    spence       -- Dilogarithm integral.
 
300
    zeta         -- Riemann zeta function of two arguments.
 
301
    zetac        -- 1.0 - standard Riemann zeta function.
 
302
 
 
303
  Convenience Functions
 
304
 
 
305
    cbrt     -- Cube root.
 
306
    exp10    -- 10 raised to the x power.
 
307
    exp2     -- 2 raised to the x power.
 
308
    radian   -- radian angle given degrees, minutes, and seconds.
 
309
    cosdg    -- cosine of the angle given in degrees.
 
310
    sindg    -- sine of the angle given in degrees.
 
311
    tandg    -- tangent of the angle given in degrees.
 
312
    cotdg    -- cotangent of the angle given in degrees.
 
313
    log1p    -- log(1+x)
 
314
    expm1    -- exp(x)-1
 
315
    cosm1    -- cos(x)-1
 
316
    round    -- round the argument to the nearest integer. If argument
 
317
                 ends in 0.5 exactly, pick the nearest even integer.
 
318
 
 
319
  ** in the description indicates a function which is not a universal
 
320
  function and does not follow broadcasting and automatic
 
321
  array-looping rules.
 
322
 
 
323
   Error handling:
 
324
 
 
325
      Errors are handled by returning nans, or other appropriate values.
 
326
      Some of the special function routines will print an error message
 
327
      when an error occurs.  By default this printing
 
328
      is disabled.  To enable such messages use errprint(1)
 
329
      To disable such messages use errprint(0).
 
330
 
 
331
      Example:
 
332
      >>> print scipy.special.bdtr(-1,10,0.3)
 
333
      >>> scipy.special.errprint(1)
 
334
      >>> print scipy.special.bdtr(-1,10,0.3)
 
335
 
 
336
"""
 
337
 
 
338
postpone_import = 1
 
339
global_symbols = ['isinf','isfinite','isnan']