From 63da5b569af895a0db9431dcc3c007196053c0b7 Mon Sep 17 00:00:00 2001 From: "Carlos A. Cartagena-Sanchez" Date: Thu, 14 Jul 2022 13:19:37 -0500 Subject: [PATCH 1/3] Renaming file to contain frequency functions. --- .../{diocotron_frequency.py => frequencies.py} | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) rename hack/Frequency/{diocotron_frequency.py => frequencies.py} (73%) diff --git a/hack/Frequency/diocotron_frequency.py b/hack/Frequency/frequencies.py similarity index 73% rename from hack/Frequency/diocotron_frequency.py rename to hack/Frequency/frequencies.py index 253010a..85f3f55 100644 --- a/hack/Frequency/diocotron_frequency.py +++ b/hack/Frequency/frequencies.py @@ -1,11 +1,13 @@ -import numpy as np -import astropy.units as u -from astropy.constants.si import eps0 +import numpy as np +import astropy.units as u +from astropy.constants.si import eps0 # Frequency of Diocotron modes associated with non-neutral single species plasmas + + def Approx_diocotron_frequency(B: u.T, density: (u.kg/u.m**3), mass: u.kg, charge: u.C) -> u.rad/u.s: # Best thing to do is to use existing functions (plasma frequency, cyclotron frequency) but # since this is a demo I'm just going to write out the math w_pe_sq = density*charge/(epsn0*mass**2) - w_ce = charge*B/mass - return np.pi*w_pe_sq/w_ce \ No newline at end of file + w_ce = charge*B/mass + return np.pi*w_pe_sq/w_ce From a826538c00d746b70389399f5338798e6f008344 Mon Sep 17 00:00:00 2001 From: "Carlos A. Cartagena-Sanchez" Date: Thu, 14 Jul 2022 13:37:22 -0500 Subject: [PATCH 2/3] Adding a new frequency function: Cyclotron Frequency --- hack/Frequency/frequencies.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/hack/Frequency/frequencies.py b/hack/Frequency/frequencies.py index 85f3f55..c408908 100644 --- a/hack/Frequency/frequencies.py +++ b/hack/Frequency/frequencies.py @@ -2,12 +2,20 @@ import astropy.units as u from astropy.constants.si import eps0 -# Frequency of Diocotron modes associated with non-neutral single species plasmas + +def Cylotron_frequency(B: u.T, mass: u.kg, charge: u.C) -> u.rad/u.s: + """ + Cylotron frequency + """ + return charge*B/mass def Approx_diocotron_frequency(B: u.T, density: (u.kg/u.m**3), mass: u.kg, charge: u.C) -> u.rad/u.s: - # Best thing to do is to use existing functions (plasma frequency, cyclotron frequency) but - # since this is a demo I'm just going to write out the math - w_pe_sq = density*charge/(epsn0*mass**2) - w_ce = charge*B/mass + """ + Frequency of Diocotron modes associated with non-neutral single species plasmas + Best thing to do is to use existing functions (plasma frequency, cyclotron frequency) but + since this is a demo I'm just going to write out the mat + """ + w_pe_sq = density*charge/(eps0*mass**2) + w_ce = Cylotron_frequency(B, mass, charge) return np.pi*w_pe_sq/w_ce From 634c4f3626786f3acf344c780bb17a8657a18d76 Mon Sep 17 00:00:00 2001 From: "Carlos A. Cartagena-Sanchez" Date: Thu, 14 Jul 2022 14:02:03 -0500 Subject: [PATCH 3/3] Created new frequency function. --- hack/Frequency/frequencies.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hack/Frequency/frequencies.py b/hack/Frequency/frequencies.py index c408908..33e1cb7 100644 --- a/hack/Frequency/frequencies.py +++ b/hack/Frequency/frequencies.py @@ -10,12 +10,19 @@ def Cylotron_frequency(B: u.T, mass: u.kg, charge: u.C) -> u.rad/u.s: return charge*B/mass +def Plasma_frequency(density: (u.kg/u.m**3), mass: u.kg, charge: u.C) -> u.rad/u.s: + """ + Plasma frequency + """ + return np.sqrt(density*charge**2/(eps0*mass)) + + def Approx_diocotron_frequency(B: u.T, density: (u.kg/u.m**3), mass: u.kg, charge: u.C) -> u.rad/u.s: """ Frequency of Diocotron modes associated with non-neutral single species plasmas Best thing to do is to use existing functions (plasma frequency, cyclotron frequency) but since this is a demo I'm just going to write out the mat """ - w_pe_sq = density*charge/(eps0*mass**2) + w_pe_sq = Plasma_frequency(density, mass, charge) w_ce = Cylotron_frequency(B, mass, charge) return np.pi*w_pe_sq/w_ce