68 lines
1.5 KiB
Python
68 lines
1.5 KiB
Python
#!/bin/python3
|
|
import numpy as np
|
|
import os
|
|
import sys
|
|
from astropy import units as u
|
|
from astropy import constants as const
|
|
import matplotlib
|
|
import matplotlib.pyplot as plt
|
|
|
|
# Specific includes
|
|
# =======================
|
|
|
|
homebase = os.getenv('HOMEBASE')
|
|
if homebase == None:
|
|
homebase = "/home/jonas/new_workspace/Coding/ACRONYM/acronym"
|
|
|
|
includes = homebase + "/src/grpic/boundaries_3d"
|
|
|
|
sys.path.append(includes)
|
|
|
|
import precalculation.functions.plasmaFunctions as plasmaFuncs
|
|
import analysis.plotDataFromAcronym.plot_standards as pltStd
|
|
|
|
|
|
|
|
# Input
|
|
# =======================
|
|
|
|
n_e = 1E12 # 1/m^3
|
|
density_factor = 0.0
|
|
R = 0.045 # m
|
|
|
|
n_e = 1E15 # 1/cm^3
|
|
density_factor = 0.99
|
|
R = 1 # cm
|
|
|
|
q = 1.602E-19*3E9 # statC
|
|
|
|
# Calculation
|
|
# =======================
|
|
|
|
def retentionField(radius, n_e, density_factor):
|
|
|
|
return (-4./3 * np.pi* (1-density_factor)*radius * q * n_e)
|
|
|
|
ret_field = retentionField(R, n_e, density_factor)
|
|
|
|
print("Example")
|
|
print("Field: {:e} statV/cm".format(ret_field))
|
|
print("Field: {:e} V/cm".format(ret_field*3*1E2))
|
|
|
|
n_e = 1E6 # 1/cm^3
|
|
density_factor = 0.99
|
|
R = 4.5 # m
|
|
|
|
ret_field = retentionField(R, n_e, density_factor)
|
|
print("Katrin")
|
|
print("Field: {:e} statV/cm".format(ret_field))
|
|
print("Field: {:e} V/cm".format(ret_field*3*1E2))
|
|
|
|
n_e = 1E0 # 1/cm^3
|
|
density_factor = 0.
|
|
R = 0.45 # m
|
|
|
|
ret_field = retentionField(R, n_e, density_factor)
|
|
print("Katrin")
|
|
print("Field: {:e} statV/cm".format(ret_field))
|
|
print("Field: {:e} V/cm".format(ret_field*3*1E2)) |