diff --git a/stat_langevin.py b/stat_langevin.py deleted file mode 100644 index 901e27f..0000000 --- a/stat_langevin.py +++ /dev/null @@ -1,165 +0,0 @@ - -# In[1]: - -import pylab as plt -import numpy as np -import time as tm -from sys import argv - -# In[2]: - -# Harmonic force - -def force(x, *args): - x0 = 0. - ks = args[0] - f = -ks*(x) - return f - -# Return the time lenght - -def Time_len(tMax, dt): - - t = 0 - L = [] - - while(t> 4*k overdamped -kBT = 1.0 - -dt = 0.01 -tMax = 50 - -# Sample conditions - -N = 10**4 #int(argv[1]) -x_init = 0.3 -v_init = 0. - -#################################### - -# Extras - -M_x = np.zeros(Time_len(tMax, dt)) -M_x2 = np.zeros(Time_len(tMax, dt)) - -######################################################### - -start = tm.time() - -# Stochastic evolution for each in the sample - -for ii in range(N): - - time, position = BAOAB_method(x_init, v_init, tMax, dt, gamma, kBT, ks) - - M_x = M_x + np.array(position) - M_x2 = M_x2 + np.power(position,2) - -t = np.array(time) - -### Statistics - -# Mean -M_x = M_x/N -M_x2 = M_x2/N - -# Variance -Var_x = M_x2 - M_x**2 - -######################################################### - -end = tm.time() -print(end-start) - -# In[6]: - -############ Plotting data ################ - -# Variance plot - -plt.plot(t, Var_x, label= 'num' ) - -plt.ylabel(r' $\left - \left^2$', fontsize = 12) -plt.xlabel(r' $t$', fontsize = 12) - -plt.legend(loc='lower center') -plt.figure() - -# Mean value plot - -plt.plot(t, M_x, label= 'num' ) - -plt.ylabel(r' $\left $', fontsize = 12) -plt.xlabel(r' $t$', fontsize = 12) -#plt.ylim(-0.07,0.07) - -plt.legend(loc='upper center') -plt.figure()