scipy.special.hyp2f1#
- scipy.special.hyp2f1(a, b, c, z, out=None) = <ufunc 'hyp2f1'>#
Gaußsche hypergeometrische Funktion 2F1(a, b; c; z)
- Parameter:
- a, b, carray_like
Argumente, sollten reellwertig sein.
- zarray_like
Argument, reell oder komplex.
- outndarray, optional
Optionales Ausgabe-Array für die Funktionswerte
- Rückgabe:
- hyp2f1skalar oder ndarray
Die Werte der Gaußschen hypergeometrischen Funktion.
Siehe auch
Hinweise
Diese Funktion ist für \(|z| < 1\) definiert als
\[\mathrm{hyp2f1}(a, b, c, z) = \sum_{n=0}^\infty \frac{(a)_n (b)_n}{(c)_n}\frac{z^n}{n!},\]und auf dem Rest der komplexen z-Ebene durch analytische Fortsetzung [1] definiert. Hier ist \((\cdot)_n\) das Pochhammer-Symbol; siehe
poch. Wenn \(n\) eine ganze Zahl ist, ist das Ergebnis ein Polynom vom Grad \(n\).Die Implementierung für komplexe Werte von
zist in [2] beschrieben, außer fürzin dem Bereich, der definiert ist durch\[0.9 <= \left|z\right| < 1.1, \left|1 - z\right| >= 0.9, \mathrm{real}(z) >= 0\]in dem die Implementierung [4] folgt.
Referenzen
[1]NIST Digital Library of Mathematical Functions https://dlmf.nist.gov/15.2
[2]Zhang und J.M. Jin, „Computation of Special Functions“, Wiley 1996
[3]Cephes Mathematical Functions Library, http://www.netlib.org/cephes/
[4]J.L. Lopez und N.M. Temme, „New series expansions of the Gauss hypergeometric function“, Adv Comput Math 39, 349-365 (2013). https://doi.org/10.1007/s10444-012-9283-y
Beispiele
>>> import numpy as np >>> import scipy.special as sc
Sie hat Pole, wenn c eine negative ganze Zahl ist.
>>> sc.hyp2f1(1, 1, -2, 1) inf
Sie ist ein Polynom, wenn a oder b eine negative ganze Zahl ist.
>>> a, b, c = -1, 1, 1.5 >>> z = np.linspace(0, 1, 5) >>> sc.hyp2f1(a, b, c, z) array([1. , 0.83333333, 0.66666667, 0.5 , 0.33333333]) >>> 1 + a * b * z / c array([1. , 0.83333333, 0.66666667, 0.5 , 0.33333333])
Sie ist symmetrisch in a und b.
>>> a = np.linspace(0, 1, 5) >>> b = np.linspace(0, 1, 5) >>> sc.hyp2f1(a, b, 1, 0.5) array([1. , 1.03997334, 1.1803406 , 1.47074441, 2. ]) >>> sc.hyp2f1(b, a, 1, 0.5) array([1. , 1.03997334, 1.1803406 , 1.47074441, 2. ])
Sie enthält viele andere Funktionen als Spezialfälle.
>>> z = 0.5 >>> sc.hyp2f1(1, 1, 2, z) 1.3862943611198901 >>> -np.log(1 - z) / z 1.3862943611198906
>>> sc.hyp2f1(0.5, 1, 1.5, z**2) 1.098612288668109 >>> np.log((1 + z) / (1 - z)) / (2 * z) 1.0986122886681098
>>> sc.hyp2f1(0.5, 1, 1.5, -z**2) 0.9272952180016117 >>> np.arctan(z) / z 0.9272952180016122