From ad539eea6e59c3aa7093590f8f6f1dc770890e1a Mon Sep 17 00:00:00 2001 From: AshganTaleb Date: Wed, 13 Jul 2022 14:35:10 -0400 Subject: [PATCH 1/4] add inital alfven speed function --- hack/alfven_speed.py | 13 +++++++++++++ hack/tmp8tdt783i | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 hack/alfven_speed.py create mode 100644 hack/tmp8tdt783i diff --git a/hack/alfven_speed.py b/hack/alfven_speed.py new file mode 100644 index 0000000..2811fb6 --- /dev/null +++ b/hack/alfven_speed.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +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) \ No newline at end of file diff --git a/hack/tmp8tdt783i b/hack/tmp8tdt783i new file mode 100644 index 0000000..033759b --- /dev/null +++ b/hack/tmp8tdt783i @@ -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) \ No newline at end of file From acd4c0adbc24ba07f9a32078715f6e210d43585d Mon Sep 17 00:00:00 2001 From: AshganTaleb Date: Wed, 13 Jul 2022 14:51:43 -0400 Subject: [PATCH 2/4] etting rid of uft-8 line --- hack/alfven_speed.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hack/alfven_speed.py b/hack/alfven_speed.py index 2811fb6..bb8003c 100644 --- a/hack/alfven_speed.py +++ b/hack/alfven_speed.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- + """ Created on Wed Jul 13 14:17:50 2022 From 873100d20ceedc7dc45969a5a639e1e4d11c55d2 Mon Sep 17 00:00:00 2001 From: AshganTaleb Date: Wed, 13 Jul 2022 15:01:33 -0400 Subject: [PATCH 3/4] Revert "etting rid of uft-8 line" This reverts commit acd4c0adbc24ba07f9a32078715f6e210d43585d. --- hack/alfven_speed.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hack/alfven_speed.py b/hack/alfven_speed.py index bb8003c..2811fb6 100644 --- a/hack/alfven_speed.py +++ b/hack/alfven_speed.py @@ -1,4 +1,5 @@ - +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- """ Created on Wed Jul 13 14:17:50 2022 From 75c881d54e0199b8358f3954ea2ea7356c8e9135 Mon Sep 17 00:00:00 2001 From: AshganTaleb Date: Wed, 13 Jul 2022 15:02:22 -0400 Subject: [PATCH 4/4] Revert "Revert "etting rid of uft-8 line"" This reverts commit 873100d20ceedc7dc45969a5a639e1e4d11c55d2. --- hack/alfven_speed.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hack/alfven_speed.py b/hack/alfven_speed.py index 2811fb6..bb8003c 100644 --- a/hack/alfven_speed.py +++ b/hack/alfven_speed.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- + """ Created on Wed Jul 13 14:17:50 2022