Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions hack/alfven_speed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

"""
Created on Wed Jul 13 14:17:50 2022

@author: aaboutal
"""
import numpy as np
import astropy.units as u
from astropy.constants.si import k_B, mu0

def Alfven_sped(B: u.T, density: (u.kg / u.m**3)) -> u.m /u.s:
return np.abs(B)/ np.sqrt(mu0 * density)
14 changes: 14 additions & 0 deletions hack/tmp8tdt783i
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 13 14:17:50 2022

@author: aaboutal
"""
from astropy import units as u
from astropy.constants.si import m_p, m_e
B = 0.014*u.T
n = 5e19*u.m**-3
rho = n*(m_p+m_e)
ion = 'p'
Alfven_speed(B, n, ion=ion)