Esempio n. 1
0
def getDamping(E, phase) : 
    damping_in   = []
    damping_lz   = []
    for ii in range(2**NE) : 
        damping_in.append(abs(dmp.IonNeutral_Damping(E[ii], phase, nu_n = 0, theta = 0).get("wi")))
        damping_lz.append(abs(dmp.damping_lazarian_nopos(E[ii], phase)[0]))
    return [damping_in, damping_lz]
Esempio n. 2
0
def Kappa_zz(E, medium_props, mass = cst.mp, kmin = 1e-20, q = 5./3, I = 1e28) : 
    """
    

    Parameters
    ----------
    E : TYPE
        DESCRIPTION.
    medium_props : TYPE
        DESCRIPTION.
    mass : TYPE float, optional
        Mass of the diffusin particle. The defaut is m_proton
    kmin : TYPE float, optional
        Minimun length in cm^-1 for the turbulence spectra. The default is 1e-20.
    q : TYPE float, optional
        Spectral index of the Kolmogorov-like turbulence 
        spectrum. The default is 5./3.
    I : TYPE float, optional
        Diffusion coefficient normalization value for 1GeV particle and 5./3 spectrum. The default is 1e28.

    Returns
    -------
    TYPE
        DESCRIPTION.

    """
    
    # I = (2.2345649450772952e28*1e6/I)
    
    
    
    m = mass
    gamma = 1 + (E /(m*cst.c**2))
    v = cst.c*np.sqrt(1 - (1/(E/(m*cst.c**2) + 1))**2)
    p = gamma*m*v 
    Omega0 = cst.e*medium_props.get("B")/(m*cst.c)
    Omega  = Omega0/gamma 
    
    lz_damping = dp.damping_lazarian_nopos(E, medium_props)
    # print (lz_damping)
    kmax = (lz_damping[1])**(-1)
    # kmax = 1e-21
    
    # print (kmax)
    
    I = I*kmax
    
    k_zz = 0.
    mu = np.linspace(-1, 1, 100)
    for jj in range(1, len(mu)-1) : 
        dmumu = 0.5*(mu[jj+1] - mu[jj-1])
        k_zz += dmumu*(1 - mu[jj]**2)**2/Duu_Alfven_Slab_Linear_Undamped(mu[jj], E, medium_props, mass = m, kmin = kmin, q = q, I = I)
    
    return v**2/8*k_zz
def Kappa_zz(E,
             medium_props,
             mass=cst.mp,
             kmin=(50. * cst.pc)**(-1),
             q=5. / 3,
             I=1e-4):
    """
    

    Parameters
    ----------
    E : TYPE
        DESCRIPTION.
    medium_props : TYPE
        DESCRIPTION.
    mass : TYPE float, optional
        Mass of the diffusin particle. The defaut is m_proton
    kmin : TYPE float, optional
        Minimun length in cm^-1 for the turbulence spectra -> Injection length. The default is 50pc**(-1)
    q : TYPE float, optional
        Spectral index of the Kolmogorov-like turbulence 
        spectrum. The default is 5./3.
    I : TYPE float, optional
        Turbulence average level. Defaut is 10^-4

    Returns
    -------
    TYPE
        DESCRIPTION.

    """

    # I = (2.2345649450772952e28*1e6/I)

    m = mass
    gamma = 1 + (E / (m * cst.c**2))
    v = cst.c * np.sqrt(1 - (1 / (E / (m * cst.c**2) + 1))**2)
    p = gamma * m * v
    Omega0 = cst.e * medium_props.get("B") / (m * cst.c)
    Omega = Omega0 / gamma

    lz_damping = dp.damping_lazarian_nopos(E, medium_props)
    kmax = (lz_damping[1])**(-1)
    I = I * kmax

    k_zz = 0.
    mu = np.linspace(-1, 1, 100)
    for jj in range(1, len(mu) - 1):
        dmumu = 0.5 * (mu[jj + 1] - mu[jj - 1])
        k_zz += dmumu * (1 - mu[jj]**2)**2 / Duu_Alfven_Slab_Linear_Undamped(
            mu[jj], E, medium_props, mass=m, kmin=kmin, q=q, I=I)

    return v**2 / 8 * k_zz
Esempio n. 4
0
     if (pi == 0) : 
         wI_Alfven[e] = np.NaN
     
     
     in_damping = dp.IN_damping_approx_1(E[e], phases[pi], nu_n = 0, theta = 0)
     wR_Alfven_o1[e] = in_damping.get("wr")
     wI_Alfven_o1[e] = in_damping.get("wi")
     
     in_damping = dp.IN_damping_approx_2(E[e], phases[pi], theta = 0)
     wR_Alfven_o2[e] = in_damping.get("wr")
     wI_Alfven_o2[e] = in_damping.get("wi")
     Ep = in_damping.get("Ep")
     Em = in_damping.get("Em")
     
     if (pi > 1) : 
         lz_damping = dp.damping_lazarian_nopos(E[e], phases[pi])
         Gamma_lz[e] = lz_damping[0]
         lz_min      = lz_damping[1]
     
     Iinf = 1e-4 
     Isup = 1e-1
     Gamma_nlld_inf[e] = dp.non_linear_landau_damping(phases[pi].get("T"), Iinf, Iinf, 
                                                      phases[pi].get("mi"), cst.e, phases[pi].get("B"), E[e])
     Gamma_nlld_sup[e] = dp.non_linear_landau_damping(phases[pi].get("T"), Isup, Isup, 
                                                      phases[pi].get("mi"), cst.e, phases[pi].get("B"), E[e])
     
     
     
 
 # plt.figure(figsize = (12, 8))
 ax = fig.add_subplot(gs[pos_1[pi], pos_2[pi]])