X-Git-Url: http://git.tremily.us/?p=sawsim.git;a=blobdiff_plain;f=pysawsim%2Ftest%2Fconstant_rate.py;h=c71bdf596f87b75df0f614c24d40c496fb8aac5b;hp=63fd4f7690f68a9ba53c634566662b96f0653d89;hb=bf42840d814e46096ab9b3727d113ddea2335966;hpb=108ff450ddb8d49ce84fc898a4ae0559af57488b diff --git a/pysawsim/test/constant_rate.py b/pysawsim/test/constant_rate.py index 63fd4f7..c71bdf5 100644 --- a/pysawsim/test/constant_rate.py +++ b/pysawsim/test/constant_rate.py @@ -112,7 +112,7 @@ def constant_rate(sawsim_runner, num_domains=1, unfolding_rate=1, 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 @@ -124,8 +124,8 @@ def constant_rate(sawsim_runner, num_domains=1, unfolding_rate=1, 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 ' @@ -139,7 +139,8 @@ def constant_rate(sawsim_runner, num_domains=1, unfolding_rate=1, 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)