ass3: Task 12 code still does not work
This commit is contained in:
@ -19,9 +19,9 @@ def phi_dot(phi, t, I_DC, I_RF):
|
||||
# We need an initial value to phi
|
||||
phi_0 = 0
|
||||
|
||||
# Let's try it for 10 periods
|
||||
N_points = 1000
|
||||
t = np.linspace(0, 628, N_points)
|
||||
# Let's try it for a lot of periods
|
||||
N_points = 10000
|
||||
t = np.linspace(0, 100, N_points)
|
||||
|
||||
hbar = 1.0545718e-34 #m^2kg/s
|
||||
e = 1.60217662e-19 #C
|
||||
@ -33,10 +33,10 @@ df = pd.DataFrame(columns=['I_DC','I_RF','V_DC_bar'])
|
||||
for I_DC in np.arange(0, 1e-3, 1e-5):
|
||||
for I_RF in [0., .5e-3, 2.e-3]:
|
||||
phi = odeint(phi_dot, phi_0, t, (I_DC, I_RF))
|
||||
N_asymp = N_points//2
|
||||
#N_asymp = N_points//2
|
||||
I_DC_bar = np.mean(phi[N_asymp:]/t[N_asymp:])
|
||||
#V_DC_bar = hbar/(2*e)*I_DC_bar
|
||||
V_DC_bar = I_DC_bar
|
||||
V_DC_bar = hbar/(2*e)*phi[-1]/t[-1]
|
||||
#V_DC_bar = I_DC_bar
|
||||
print("For I_DC =", I_DC, "\t I_RF = ", I_RF, "\twe find V_DC_bar =", V_DC_bar)
|
||||
df = df.append({'I_DC': I_DC, 'I_RF': I_RF, 'V_DC_bar': V_DC_bar}, ignore_index = True)
|
||||
|
||||
@ -48,7 +48,7 @@ plt.ylabel("$I_{DC}$")
|
||||
|
||||
for I_RF in df.I_RF.unique():
|
||||
x, y = df[df.I_RF == I_RF][["V_DC_bar", "I_DC"]].to_numpy().T
|
||||
plt.plot(x[10:], y[10:], label="$I_{RF} = " + str(I_RF) + "$")
|
||||
plt.plot(x, y, label="$I_{RF} = " + str(I_RF) + "$")
|
||||
|
||||
plt.legend()
|
||||
plt.show()
|
||||
Reference in New Issue
Block a user