def sigma_geon_n(y, n, RA, RB, rh, l, pm1, deltaphi, isP):
    if isP:
        return RA*RB/rh**2 * fp.mpf( mp.cosh(rh/l * (deltaphi-2*fp.pi*n)) ) - 1\
                + fp.sqrt(RA**2-rh**2)*fp.sqrt(RB**2-rh**2)/rh**2 \
                  * fp.mpf(mp.cosh(rh/l/mp.sqrt(RA*RB-rh**2) * y) )
    else:
        return RA*RB/rh**2 * fp.mpf( mp.cosh(rh/l * (deltaphi-2*fp.pi*n)) ) - 1\
                + fp.sqrt(RA**2-rh**2)*fp.sqrt(RB**2-rh**2)/rh**2 \
                  * fp.mpf(mp.cosh(rh/l**2 * y) )
예제 #2
0
def integrand_deltaPdot_n(s, tau, n, R, rh, l, pm1, Om, lam, sig, deltaphi):
    Zm = mp.mpf(rh**2/(R**2-rh**2)\
                *(R**2/rh**2 * fp.cosh(rh/l * (deltaphi - 2*fp.pi*(n+1/2))) - 1))
    Zp = mp.mpf(rh**2/(R**2-rh**2)\
                *(R**2/rh**2 * fp.cosh(rh/l * (deltaphi - 2*fp.pi*(n+1/2))) + 1))
    K = lam**2 * rh / (2 * fp.pi * fp.sqrt(2) * l *
                       fp.sqrt(R**2 - rh**2)) * fp.exp(-tau**2 / 2 / sig**2)
    return K * fp.exp(-(tau-s)**2/2/sig**2) * fp.exp(-fp.j*Om*s)\
             * ( 1/fp.sqrt(Zm + mp.cosh(rh/l/mp.sqrt(R**2-rh**2) * s))\
                - pm1*1/fp.sqrt(Zp + mp.cosh(rh/l/mp.sqrt(R**2-rh**2) * s)) )
def XGEON_denoms_n(y, n, RA, RB, rh, l, pm1, Om, lam, sig, deltaphi):
    bA = mp.sqrt(RA**2 - rh**2) / l
    bB = mp.sqrt(RB**2 - rh**2) / l
    Zm = rh**2 / l**2 / bA / bB * (
        RA * RB / rh**2 * mp.cosh(rh / l * (deltaphi - 2 * mp.pi *
                                            (n + 1 / 2))) - 1)
    # Z-minus
    Zp = rh**2 / l**2 / bA / bB * (
        RA * RB / rh**2 * mp.cosh(rh / l * (deltaphi - 2 * mp.pi *
                                            (n + 1 / 2))) + 1)
    # Z-plus
    return 1 / mp.sqrt(Zm + mp.cosh(y)) - pm1 / mp.sqrt(Zp + mp.cosh(y))
예제 #4
0
def f02(y, n, R, rh, l, pm1, Om, lam, sig):
    K = lam**2 * sig / 2 / fp.sqrt(2 * fp.pi)
    a = (R**2 - rh**2) * l**2 / 4 / sig**2 / rh**2
    b = fp.sqrt(R**2 - rh**2) * Om * l / rh
    Zp = mp.mpf((R**2 + rh**2) / (R**2 - rh**2))
    if Zp - mp.cosh(y) > 0:
        return fp.mpf(K * mp.exp(-a * y**2) * mp.cos(b * y) /
                      mp.sqrt(Zp - mp.cosh(y)))
    elif Zp - mp.cosh(y) < 0:
        return fp.mpf(-K * mp.exp(-a * y**2) * mp.sin(b * y) /
                      mp.sqrt(mp.cosh(y) - Zp))
    else:
        return 0
예제 #5
0
def fn1(y, n, R, rh, l, pm1, Om, lam, sig):
    K = lam**2 * sig / 2 / fp.sqrt(2 * fp.pi)
    a = (R**2 - rh**2) * l**2 / 4 / sig**2 / rh**2
    b = fp.sqrt(R**2 - rh**2) * Om * l / rh
    Zm = mp.mpf(rh**2 / (R**2 - rh**2) *
                (R**2 / rh**2 * fp.cosh(2 * fp.pi * rh / l * n) - 1))
    if Zm == mp.cosh(y):
        return 0
    elif Zm - fp.cosh(y) > 0:
        return fp.mpf(K * mp.exp(-a * y**2) * mp.cos(b * y) /
                      mp.sqrt(Zm - mp.cosh(y)))
    else:
        return fp.mpf(-K * mp.exp(-a * y**2) * mp.sin(b * y) /
                      mp.sqrt(mp.cosh(y) - Zm))
def f02(y,n,R,rh,l,pm1,Om,lam,sig):
    K = lam**2*sig/2/fp.sqrt(2*fp.pi)
    a = (R**2-rh**2)*l**2/4/sig**2/rh**2
    b = fp.sqrt(R**2-rh**2)*Om*l/rh
    Zp = mp.mpf((R**2+rh**2)/(R**2-rh**2))
    if Zp == mp.cosh(y):
        print("RIP MOM PLSSS")
    #print(Zp, y, fp.cosh(y))
    if Zp - mp.cosh(y) > 0:
        return K * fp.exp(-a*y**2) * fp.cos(b*y) / fp.mpf(mp.sqrt(Zp - mp.cosh(y)))
    elif Zp - mp.cosh(y) < 0:
        return -K * fp.exp(-a*y**2) * fp.sin(b*y) / fp.mpf(mp.sqrt(mp.cosh(y) - Zp))
    else:
        return 0
def T_P_int_geon(x, tau, tau0, n, R, rh, l, pm1, Om, lam, sig, deltaphi=0):
    K = lam**2 / (np.sqrt(2) * np.pi * l * Om) * rh / np.sqrt(R**2 - rh**2)
    Gm = rh**2 / (R**2 - rh**2) * (R**2 / rh**2 * fp.mpf(
        mp.cosh(rh / l * (deltaphi - 2 * np.pi * (n + 0.5)))) - 1)
    Gp = rh**2 / (R**2 - rh**2) * (R**2 / rh**2 * fp.mpf(
        mp.cosh(rh / l * (deltaphi - 2 * np.pi * (n + 0.5)))) + 1)

    if tau < tau0:
        return 0
    elif x < (tau + tau0):
        return K * fp.sin(Om*(2*tau0+x))\
                * (1/fp.sqrt(Gm + fp.mpf(mp.cosh(rh/l**2 * x))) - 1/fp.sqrt(Gp + fp.mpf(mp.cosh(rh/l**2 * x))))
    else:
        return K * fp.sin(Om*(2*tau-x))\
                * (1/fp.sqrt(Gm + fp.mpf(mp.cosh(rh/l**2 * x))) - 1/fp.sqrt(Gp + fp.mpf(mp.cosh(rh/l**2 * x))))
예제 #8
0
def z_Zolotarev(N, x, m):
    r"""
    Function to evaluate the Zolotarev polynomial (eq 1, [McNamara93]_).
    
    :param N:    Order of the Zolotarev polynomial
    :param x:    The argument at which one would like to evaluate the Zolotarev polynomial
    :param m:    m is the elliptic parameter (not the modulus k and not the nome q)
                  
    :rtype:      Returns a float, the value of Zolotarev polynomial at x
    """
    M = -ellipk(m) / N
    x3 = ellipfun('sn', u=-M, m=m)
    xbar = x3 * mp.sqrt(
        (x**2 - 1) / (x**2 - x3**2))  # rearranged eq 21, [Levy70]_
    u = ellipf(mp.asin(xbar),
               m)  # rearranged eq 20, [Levy70]_, asn(x) = F(asin(x)|m)
    f = mp.cosh((N / 2) * mp.log(z_eta(M + u, m) / z_eta(M - u, m)))
    if f.imag / f.real > 1e-10:
        print("imaginary part of the Zolotarev function is not negligible!")
        print("f_imaginary = ", f.imag)
    else:
        if (x > 0):  # no idea why I am doing this ... anyhow, it seems working
            f = -f.real
        else:
            f = f.real
    return f
def P_BTZn(n,
           RA,
           RB,
           rh,
           l,
           pm1,
           Om,
           lam,
           tau0,
           width,
           deltaphi=0,
           eps=1e-8,
           isP=True):
    f = lambda y: integrandof_P_BTZn(y, n, RA, RB, rh, l, pm1, Om, lam, tau0,
                                     width, deltaphi, isP)

    if n == 0 and deltaphi == 0 and RA == RB:
        # P0m
        P0m = 2 * fp.quad(
            lambda x: integrandPBTZ_0m(x, RA, rh, l, pm1, Om, lam, tau0, width,
                                       eps), [0, width])

        intlim = l**2/rh * mp.acosh( (RA*RB/rh**2 * fp.mpf( mp.cosh(rh/l * (deltaphi-2*fp.pi*n)) ) + 1)\
                / fp.sqrt(RA**2-rh**2)/fp.sqrt(RB**2-rh**2)*rh**2)
        if intlim < width:
            return fp.quad(f, [0, intlim]) + fp.quad(f, [intlim, width]) + P0m
        else:
            return fp.quad(f, [0, width]) + P0m

    else:

        intlim1 = l**2/rh * mp.acosh( (RA*RB/rh**2 * fp.mpf( mp.cosh(rh/l * (deltaphi-2*fp.pi*n)) ) - 1)\
                / fp.sqrt(RA**2-rh**2)/fp.sqrt(RB**2-rh**2)*rh**2)
        intlim2 = l**2/rh * mp.acosh( (RA*RB/rh**2 * fp.mpf( mp.cosh(rh/l * (deltaphi-2*fp.pi*n)) ) + 1)\
                / fp.sqrt(RA**2-rh**2)/fp.sqrt(RB**2-rh**2)*rh**2)
        #print('%.4f, %.4f'%(intlim1,intlim2))
        if intlim2 < width:
            return fp.quad(f, [0, intlim1]) + fp.quad(
                f, [intlim1, intlim2]) + fp.quad(f, [intlim2, width])
        elif intlim1 < width:
            return fp.quad(f, [0, intlim1]) + fp.quad(f, [intlim1, width])
        else:
            return fp.quad(f, [0, width])
def Xn_plus(n, RA, RB, rh, l, pm1, Om, lam, tau0, width, deltaphi, isP):

    intlim2 = l**2/rh * mp.acosh( (RA*RB/rh**2 * fp.mpf( mp.cosh(rh/l * (deltaphi-2*fp.pi*n)) ) + 1)\
                / fp.sqrt(RA**2-rh**2)/fp.sqrt(RB**2-rh**2)*rh**2)
    #print('plus, %.4f ;'%intlim2)
    f = lambda y: integrandof_Xn_plus(y, n, RA, RB, rh, l, pm1, Om, lam, tau0,
                                      width, deltaphi, isP)

    if intlim2 < width:
        return fp.quad(f, [0, intlim2]) + fp.quad(f, [intlim2, width])
    else:
        return fp.quad(f, [0, width])
예제 #11
0
def wightman_btz_n(s, n, R, rh, l, pm1, Om, lam, sig, deltaphi=0, eps=1e-4):
    if n == 0:
        Bm = (R**2 - rh**2) / rh**2
        Bp = (R**2 + rh**2) / rh**2
    else:
        Bm = R**2 / rh**2 * fp.cosh(rh / l * (deltaphi - 2 * fp.pi * n)) - 1
        Bp = R**2 / rh**2 * fp.cosh(rh / l * (deltaphi - 2 * fp.pi * n)) + 1
    Scosh = (R**2 - rh**2) / rh**2 * mp.cosh(rh / l**2 * (s - fp.j * eps))

    #    if s == 0:
    #        return 0
    #    elif Bm == Scosh or Bp == Scosh:
    #        return 0
    #    else:
    return 1/(4*fp.sqrt(2)*fp.pi*l) * (-fp.j/fp.sqrt(2*Bm)/\
              mp.sinh(rh/2/l**2 * (s - fp.j*eps)) - pm1/fp.sqrt(Bp - Scosh))
예제 #12
0
def z_Zolotarev(N, x, m):
    """Function to evaluate the Zolotarev polynomial (eq 1, [McNamara93]_)."""
    M = -ellipk(m) / N
    x3 = ellipfun('sn', u= -M, m=m)  
    xbar = x3 * mp.sqrt((x ** 2 - 1) / (x ** 2 - x3 ** 2)) # rearranged eq 21, [Levy70]_
    u = ellipf(mp.asin(xbar), m) # rearranged eq 20, [Levy70]_, asn(x) = F(asin(x)|m)     
    f = mp.cosh((N / 2) * mp.log(z_eta(M + u, m) / z_eta(M - u, m)))
    if (f.imag / f.real > 1e-10):
        print "imaginary part of the Zolotarev function is not negligible!"
        print "f_imaginary = ", f.imag
    else:
        if (x > 0): # no idea why I am doing this ... anyhow, it seems working
            f = -f.real  
        else:
            f = f.real        
    return f
예제 #13
0
def z_Zolotarev(N, x, m):
    """Function to evaluate the Zolotarev polynomial (eq 1, [McNamara93]_)."""
    M = -ellipk(m) / N
    x3 = ellipfun('sn', u=-M, m=m)
    xbar = x3 * mp.sqrt(
        (x**2 - 1) / (x**2 - x3**2))  # rearranged eq 21, [Levy70]_
    u = ellipf(mp.asin(xbar),
               m)  # rearranged eq 20, [Levy70]_, asn(x) = F(asin(x)|m)
    f = mp.cosh((N / 2) * mp.log(z_eta(M + u, m) / z_eta(M - u, m)))
    if (f.imag / f.real > 1e-10):
        print("imaginary part of the Zolotarev function is not negligible!")
        print("f_imaginary = ", f.imag)
    else:
        if (x > 0):  # no idea why I am doing this ... anyhow, it seems working
            f = -f.real
        else:
            f = f.real
    return f
예제 #14
0
def z_Zolotarev(N, x, m):
    r"""
    Function to evaluate the Zolotarev polynomial (eq 1, [McNamara93]_).
    
    :param N:    Order of the Zolotarev polynomial
    :param x:    The argument at which one would like to evaluate the Zolotarev polynomial
    :param m:    m is the elliptic parameter (not the modulus k and not the nome q)
                  
    :rtype:      Returns a float, the value of Zolotarev polynomial at x
    """
    M = -ellipk(m) / N
    x3 = ellipfun('sn', u= -M, m=m)  
    xbar = x3 * mp.sqrt((x ** 2 - 1) / (x ** 2 - x3 ** 2)) # rearranged eq 21, [Levy70]_
    u = ellipf(mp.asin(xbar), m) # rearranged eq 20, [Levy70]_, asn(x) = F(asin(x)|m)     
    f = mp.cosh((N / 2) * mp.log(z_eta(M + u, m) / z_eta(M - u, m)))
    if (f.imag / f.real > 1e-10):
        print "imaginary part of the Zolotarev function is not negligible!"
        print "f_imaginary = ", f.imag
    else:
        if (x > 0): # no idea why I am doing this ... anyhow, it seems working
            f = -f.real  
        else:
            f = f.real        
    return f
예제 #15
0
파일: zad1.py 프로젝트: Enkelian/mownit
def f1(x):
    return mp.cos(x) * mp.cosh(x) - 1
예제 #16
0
파일: zad1.py 프로젝트: Enkelian/mownit
def df1(x):
    return mp.cos(x) * mp.sinh(x) - mp.sin(x) * mp.cosh(x)
예제 #17
0
def sigma_geon(x, n, R, rh, l):
    return R**2/rh**2 * fp.mpf(mp.cosh(2*mp.pi * rh/l * (n+1/2))) - 1 + (R**2-rh**2)/rh**2\
    * fp.mpf(mp.cosh(rh/l**2 * x))
예제 #18
0
def gammap_btz_n(s, n, R, rh, l, deltaphi, eps):
    Zp = mp.mpf(rh**2 / (R**2 - rh**2) *
                (R**2 / rh**2 * fp.cosh(rh / l *
                                        (deltaphi - 2 * fp.pi * n)) + 1))
    return Zp - mp.cosh(rh / l / mp.sqrt(R**2 - rh**2) * (s - fp.j * eps))
def integrandPBTZ_0m_GAUSS(y, R, rh, l, pm1, Om, lam, sig, eps):
    #print(mp.sqrt(1 - mp.cosh( y -fp.j*eps )))
    return fp.exp(-fp.j*fp.sqrt(R**2-rh**2)*Om*l/rh * y)\
            / mp.sqrt(1 - mp.cosh( y -fp.j*eps ))\
            * lam**2*sig/(2*fp.sqrt(2*fp.pi))\
            * fp.exp(-(R**2-rh**2)*l**2/(4*sig**2*rh**2) * y**2)