backup save
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
import numpy as np
|
||||
import os
|
||||
import sys
|
||||
from astropy import units as u
|
||||
import matplotlib
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
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
|
||||
# =======================
|
||||
|
||||
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
|
||||
output_file = thesis_path+"/fig/Chapter5_ACRONYM/Validation/DebyeSheath/longitudinal_comparison.pdf"
|
||||
|
||||
# Calculation
|
||||
# =======================
|
||||
|
||||
z = np.linspace(0,1,20)
|
||||
|
||||
Ez_r0 = np.zeros_like(z)
|
||||
Ez_r0[0] = -1
|
||||
Ez_r0[19] = -1
|
||||
|
||||
Ez_2r = np.zeros_like(z)
|
||||
Ez_2r[0] = -0.5
|
||||
Ez_2r[19] = -0.5
|
||||
|
||||
Ez_dxhalf = Ez_r0 * 1.2
|
||||
Ez_dxhalf[1] = -0.25
|
||||
Ez_dxhalf[18] = -0.25
|
||||
|
||||
U_r0 = np.ones_like(z)
|
||||
U_r0[0] = 0
|
||||
U_r0[19] = 0
|
||||
|
||||
U_2r = np.ones_like(z)*0.5
|
||||
U_2r[0] = 0
|
||||
U_2r[19] = 0
|
||||
|
||||
U_dxhalf = np.ones_like(z)*0.7
|
||||
U_dxhalf[0] = 0
|
||||
U_dxhalf[19] = 0
|
||||
|
||||
# Plot
|
||||
# =======================
|
||||
|
||||
pltStd.setRcParams()
|
||||
prop_cycle = plt.rcParams['axes.prop_cycle']
|
||||
colors = prop_cycle.by_key()['color']
|
||||
|
||||
(width, height) = pltStd.set_size('thesis')
|
||||
fig, (ax0, ax1) = plt.subplots(2, 1, figsize=(width, height))
|
||||
|
||||
ax0.set_ylabel(r'Electric field $E_r$ $\left[\frac{V}{cm} \right]$')
|
||||
#ax0.set_xlabel(r'Relative radius $\frac{r}{R}$')
|
||||
ax0.set_xticklabels([])
|
||||
|
||||
ax0.plot(z, Ez_r0, '-', label=r'$R=r_0$')
|
||||
ax0.plot(z, Ez_2r, '--', label=r'$R=2 r_0$')
|
||||
ax0.plot(z, Ez_dxhalf, '-.', label=r'$dx = \frac{dx_0}{2}$')
|
||||
|
||||
|
||||
|
||||
ax1.plot(z, U_r0, '-', label=r'$R=r_0$')
|
||||
ax1.plot(z, U_2r, '--', label=r'$R=2 r_0$')
|
||||
ax1.plot(z, U_dxhalf, '-.', label=r'$dx = \frac{dx_0}{2}$')
|
||||
|
||||
ax1.set_ylabel(r'Potential $U$ $\left[V \right]$')
|
||||
ax1.set_xlabel(r'Relative position $\frac{z}{L}$')
|
||||
|
||||
|
||||
|
||||
ax0.legend()
|
||||
|
||||
plt.show()
|
||||
|
||||
fig.savefig(output_file,bbox_inches='tight')
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
import numpy as np
|
||||
import os
|
||||
import sys
|
||||
from astropy import units as u
|
||||
import matplotlib
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
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
|
||||
# =======================
|
||||
|
||||
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
|
||||
output_file = thesis_path+"/fig/Chapter5_ACRONYM/Validation/DebyeSheath/radial_comparison.pdf"
|
||||
|
||||
# Calculation
|
||||
# =======================
|
||||
|
||||
radius = np.linspace(-1,1,20)
|
||||
|
||||
Er_r0 = np.zeros_like(radius)
|
||||
Er_r0[0] = -1
|
||||
Er_r0[19] = -1
|
||||
|
||||
Er_2r = np.zeros_like(radius)
|
||||
Er_2r[0] = -0.5
|
||||
Er_2r[19] = -0.5
|
||||
|
||||
Er_dxhalf = Er_r0 * 1.2
|
||||
|
||||
U_r0 = np.ones_like(radius)
|
||||
U_r0[0] = 0
|
||||
U_r0[19] = 0
|
||||
|
||||
U_2r = np.ones_like(radius)*0.5
|
||||
U_2r[0] = 0
|
||||
U_2r[19] = 0
|
||||
|
||||
U_dxhalf = np.ones_like(radius)*0.7
|
||||
U_dxhalf[0] = 0
|
||||
U_dxhalf[19] = 0
|
||||
|
||||
# Plot
|
||||
# =======================
|
||||
|
||||
pltStd.setRcParams()
|
||||
prop_cycle = plt.rcParams['axes.prop_cycle']
|
||||
colors = prop_cycle.by_key()['color']
|
||||
|
||||
(width, height) = pltStd.set_size('thesis')
|
||||
fig, (ax0, ax1) = plt.subplots(2, 1, figsize=(width, height))
|
||||
|
||||
ax0.set_ylabel(r'Electric field $E_r$ $\left[\frac{V}{cm} \right]$')
|
||||
#ax0.set_xlabel(r'Relative radius $\frac{r}{R}$')
|
||||
ax0.set_xticklabels([])
|
||||
|
||||
ax0.plot(radius, Er_r0, '-', label=r'$R=r_0$')
|
||||
ax0.plot(radius, Er_2r, '--', label=r'$R=2 r_0$')
|
||||
ax0.plot(radius, Er_dxhalf, '-.', label=r'$dx = \frac{dx_0}{2}$')
|
||||
ax0.set_xlim((0,1))
|
||||
|
||||
|
||||
ax1.plot(radius, U_r0, '-', label=r'$R=r_0$')
|
||||
ax1.plot(radius, U_2r, '--', label=r'$R=2 r_0$')
|
||||
ax1.plot(radius, U_dxhalf, '-.', label=r'$dx = \frac{dx_0}{2}$')
|
||||
|
||||
ax1.set_ylabel(r'Potential $U$ $\left[V \right]$')
|
||||
ax1.set_xlabel(r'Relative radius $\frac{r}{R}$')
|
||||
ax1.set_xlim((0,1))
|
||||
|
||||
|
||||
ax0.legend()
|
||||
|
||||
plt.show()
|
||||
|
||||
fig.savefig(output_file,bbox_inches='tight')
|
||||
Reference in New Issue
Block a user