def tfps(beta=0.6, ca=1., de2=0.000545, theta=0., kk=1.):
"""
beta: Total plasma beta,
ca: Alfven speed based on mean field,
de2: me/mi,
theta: Angle of propagation in degrees
kk: Wavenumber of interest in units of kdi
Output is frequencies of the roots and the phase speeds w/k
The roots are w[0]:Fast/Whistler, w[1]:Alfven/KAW, w[2]: Slow/Cyclotron
"""
tht = theta*pi/180.
ct = np.cos(tht)
st = np.sin(tht)
tt = st/ct
cs=np.sqrt(beta/2.)*ca
di =1.
caksq=np.cos(tht)**2*ca**2
cmsq=ca**2 + cs**2
pcs=np.zeros(4)
D = 1 + kk**2*de2
# Find out the root of the quadratic dispersion relation
pcs[0] = 1.
pcs[1] = -(ca**2/D + cs**2 + caksq*(1+kk**2*di**2/D)/D)*kk**2
pcs[2] = caksq*kk**4*(ca**2/D + cs**2 + cs**2*(1+kk**2*di**2/D))/D
pcs[3] = -(cs**2*kk**6*caksq**2)/D**2
w2 = np.roots(pcs); w = np.sqrt(w2)
speeds= w/kk
return w,speeds
评论列表
文章目录