diff --git a/mrdna/config.py b/mrdna/config.py index ec7f2f266634f77c7ae152909487501e417ad524..4c8c40e33681463316a9a356dfc7643d0f37dc2a 100644 --- a/mrdna/config.py +++ b/mrdna/config.py @@ -47,11 +47,11 @@ Do you agree to allow the mrdna package can send the information described above to the Aksimentiev group webserver? [y/N]""") response = input() if response in 'y Y yes Yes YES'.split(): - print("Permission granted") + # print("Permission granted") config['reporting_allowed'] = True break elif response in 'n N no No NO'.split() + [""]: - print("Permission denied") + # print("Permission denied") config['reporting_allowed'] = False break with open(_USER_CONF,'w') as ch: diff --git a/mrdna/model/spring_from_lp.py b/mrdna/model/spring_from_lp.py new file mode 100644 index 0000000000000000000000000000000000000000..5702c963ed87c9e1f72f95d2873e11410c6093c1 --- /dev/null +++ b/mrdna/model/spring_from_lp.py @@ -0,0 +1,16 @@ +import numpy as np +_kT = 0.58622522 # kcal/mol +_k = np.logspace(-8,3,1000) + +def _integrate( fn ): + t = np.linspace(0,np.pi,10000) + return np.trapz( fn(t), t[np.newaxis,:], axis = -1 ) + +_integral = _integrate( lambda t: np.cos(t[np.newaxis,:])*np.sin(t[np.newaxis,:])* np.exp((-0.5*_k[:,np.newaxis]*(t[np.newaxis,:])**2 )/_kT) ) / \ + _integrate( lambda t: np.sin(t[np.newaxis,:]) * np.exp((-0.5*_k[:,np.newaxis]*(t[np.newaxis,:])**2 )/_kT) ) + + +assert( (np.diff(_integral) <= 0).sum() == 0 ) +def k_angle(sep,Lp): + val = np.exp(-sep/Lp) + return np.interp(val,_integral,_k) * 0.00030461742 # convert to degree^2