sim_alpha = params[0]
sim_rho = abs(params[1])
for s,t,n in [(sim_alpha, alpha, 'alpha'), (sim_rho, rho, 'rho')]:
- assert (s - t)/w < 3, (
+ assert abs(s - t)/w < 3, (
'simulation %s = %g != %g = %s (bin width = %g)' % (n,s,t,n,w))
return sim.residual(theory)
spring_constant=1, velocity=1, N=100):
loading_rate = float(spring_constant * velocity)
tau = loading_rate / unfolding_rate
- w = 0.1 * tau # calculate bin width (in force)
+ w = 0.2 * tau # calculate bin width (in force)
A = w*num_domains*N / tau
theory = Histogram()
# A exp(-x/tau) = 0.001
theory.bin_centers, [tau])
theory.analyze()
- max_time_step = tau/10.0
- max_force_step = loading_rate * max_time_step
+ max_force_step = w/10.0
+ max_time_step = max_force_step / loading_rate
param_string = (
'-d %(max_time_step)g -F %(max_force_step)g -v %(velocity)g '
'-s cantilever,hooke,%(spring_constant)g -N1 '
params = e.fit()
sim_tau = abs(params[0])
for s,t,n in [(sim_tau, tau, 'tau')]:
- assert (s - t)/t < 0.1, 'simulation %s = %g != %g = %s' % (n,s,t,n)
+ assert abs(s - t)/w < 3, (
+ 'simulation %s = %g != %g = %s (bin width = %g)' % (n,s,t,n,w))
return sim.residual(theory)