-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaper.py
executable file
·180 lines (131 loc) · 6.72 KB
/
paper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
######################################################
#
# Code to produce sensitivity plots
#
######################################################
def arguments(argv):
global pressure
global d
arg_help = "{0} -p <pressure [bar]> -d <diameter [m]>".format(argv[0])
try:
opts, args = getopt.getopt(argv[1:], "hp:d:", ["help", "pressure=", "diameter="])
except:
print(arg_help)
sys.exit(2)
for opt, arg in opts:
if opt in ("-h", "--help"):
print(arg_help) # print the help message
sys.exit(2)
elif opt in ("-p", "--pressure"):
pressure = float(arg)
elif opt in ("-d", "--diameter"):
d = float(arg)
def Width_from_Temperature(Temperature,PressureBar,_d):
"""
Calculates the resonance width [Hz] from the Temperature [K]
(from Samuli matlab scripts)
"""
gap = energy_gap_in_low_temp_limit(PressureBar)
width=np.power(Fermi_momentum(PressureBar),2)*Fermi_velocity(PressureBar)*density_of_states(PressureBar)/(2*density*np.pi*_d)*np.exp(-gap/(Boltzmann_const*Temperature))
return width
def Temperature_from_Width(Width,PressureBar):
"""
Calculates the Temperature [K] from the resonance width [Hz]
(from Samuli matlab scripts)
"""
gap = energy_gap_in_low_temp_limit(PressureBar)
temperature=-gap/(Boltzmann_const*np.log( Width*2*density*np.pi*d/(np.power(Fermi_momentum(PressureBar),2)*Fermi_velocity(PressureBar)*density_of_states(PressureBar))))
return temperature
############################################
if __name__ == "__main__":
# import Tsepelin code
#execfile("mod_helium3.py")
exec(open("mod_helium3.py").read())
import sys
import getopt
import matplotlib.pyplot as plt
plt.rcParams.update({'font.size': 12})
plt.rcParams.update({'lines.linewidth': 3})
####################################################################
pressure = 10 # [bar]
d = 200e-9; # [m] vibrating wire
density = 6.05e3; # [kg/m^3] Niobium-Titanium (NbTi)
volume = 1e-6 # [m^3] Helium-3 cell
####################################################################
arguments(sys.argv)
print('Pressure: ', pressure)
print('Diameter: ', d)
# =========================================================================
# Dependences on wire diameter, for a certain base temperature and pressure
t0 = 150e-6 # fix the temperature
Diameter = np.array([])
Sensitivity = np.array([])
for d in np.arange(50e-9, 2000e-9, 100e-9):
W0=Width_from_Temperature(t0,pressure,d) # base width
DQ = np.array([]) # delta energy [eV]
DW = np.array([]) # delta width [Hz]
for dw in np.arange(0,2.5,0.01): # Delta(Deltaf)
T2= Temperature_from_Width(W0+dw,pressure)
T1= Temperature_from_Width(W0,pressure)
DQ = np.append(DQ,(heat_capacity_Cv_B_phase_intergral_from_0(T2, pressure) - heat_capacity_Cv_B_phase_intergral_from_0(T1, pressure)) * volume * 6.242e+18) #[eV]#
DW = np.append(DW,dw)
alpha, _ = np.polyfit(DW, DQ, 1)
Sensitivity = np.append(Sensitivity,1/alpha) # Sensitivity as DeltaDeltaf/DW
Diameter = np.append(Diameter,d)
plt.plot(Diameter*1e9,Sensitivity*1e6,label='Sensitivity vs Diameter')
plt.title('Sensitivity vs Wire diameter ('+str(pressure)+' bar - '+str(t0*1e6)+' $\mu$K)')
plt.xlabel('diameter [nm]')
plt.ylabel('$\Delta(\Delta f)$/$\Delta$Q [mHz/keV]')
#plt.xlim([0, 10e3])
plt.savefig('output/Sensitivity_vs_diameter-'+str(int(pressure))+'bar.pdf')
plt.show()
# =========================================================================
# Dependences on T/Tc, for a certain pressure and wire diameter
d = 100e-9 # fix the wire diameter
TTc = np.array([])
Sensitivity = np.array([])
for ttc in np.arange(0.1, 0.3, 0.01):
W0=Width_from_Temperature(ttc*temperature_critical_superfluid(pressure),pressure,d) # base width
print("Temperature: ",ttc*temperature_critical_superfluid(pressure))
DQ = np.array([]) # delta energy [eV]
DW = np.array([]) # delta width [Hz]
for dw in np.arange(0,2.5,0.01): # Delta(Deltaf)
T2= Temperature_from_Width(W0+dw,pressure)
T1= Temperature_from_Width(W0,pressure)
DQ = np.append(DQ,(heat_capacity_Cv_B_phase_intergral_from_0(T2, pressure) - heat_capacity_Cv_B_phase_intergral_from_0(T1, pressure)) * volume * 6.242e+18) #[eV]#
DW = np.append(DW,dw)
alpha, _ = np.polyfit(DW, DQ, 1)
Sensitivity = np.append(Sensitivity,1/alpha) # Sensitivity as DeltaDeltaf/DW
TTc = np.append(TTc,ttc)
plt.plot(TTc,Sensitivity*1e6,label='Sensitivity vs T/T$_c$')
plt.title('Sensitivity vs T/T$_c$ ('+str(pressure)+' bar - '+str(d*1e9)+' nm)')
plt.xlabel('T/T$_c$')
plt.ylabel('$\Delta(\Delta f)$/$\Delta$Q [mHz/keV]')
#plt.xlim([0, 10e3])
plt.savefig('output/Sensitivity_vs_TTc-'+str(int(pressure))+'bar.pdf')
plt.show()
# =========================================================================
# Dependences on pressure, for a certain temperature and wire diameter
t0 = 150e-6 # fix the temperature
d = 100e-9 # fix the wire diameter
Pressure = np.array([])
Sensitivity = np.array([])
for pressure in np.arange(0, 30, 1):
W0=Width_from_Temperature(t0*temperature_critical_superfluid(pressure),pressure,d) # base width
DQ = np.array([]) # delta energy [eV]
DW = np.array([]) # delta width [Hz]
for dw in np.arange(0,2.5,0.01): # Delta(Deltaf)
T2= Temperature_from_Width(W0+dw,pressure)
T1= Temperature_from_Width(W0,pressure)
DQ = np.append(DQ,(heat_capacity_Cv_B_phase_intergral_from_0(T2, pressure) - heat_capacity_Cv_B_phase_intergral_from_0(T1, pressure)) * volume * 6.242e+18) #[eV]#
DW = np.append(DW,dw)
alpha, _ = np.polyfit(DW, DQ, 1)
Sensitivity = np.append(Sensitivity,1/alpha) # Sensitivity as DeltaDeltaf/DW
Pressure = np.append(Pressure,pressure)
plt.plot(Pressure,Sensitivity*1e6,label='Sensitivity vs Pressure')
plt.title('Sensitivity vs Pressure ('+str(t0*1e6)+' $\mu$K - '+str(d*1e9)+' nm)')
plt.xlabel('Pressure [bar]')
plt.ylabel('$\Delta(\Delta f)$/$\Delta$Q [mHz/keV]')
#plt.xlim([0, 10e3])
plt.savefig('output/Sensitivity_vs_Pressure.pdf')
plt.show()