From 998a208f0f5410ee007e860b4e1407a870f83962 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 5 Nov 2010 10:43:33 -0700 Subject: [PATCH] Fixup pysawsim.test.constant_rate so it passes. --- pysawsim/test/constant_rate.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pysawsim/test/constant_rate.py b/pysawsim/test/constant_rate.py index bccf3f1..97f755a 100755 --- a/pysawsim/test/constant_rate.py +++ b/pysawsim/test/constant_rate.py @@ -111,8 +111,8 @@ class ExponentialModelFitter (HistogramModelFitter): def constant_rate(sawsim_runner, num_domains=1, unfolding_rate=1, - spring_constant=1, velocity=1, N=400): - loading_rate = spring_constant * velocity + 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) A = w*num_domains*N / tau @@ -126,10 +126,13 @@ 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 param_string = ( - '-v %(velocity)s -s cantilever,hooke,%(spring_constant)s -N1 ' - '-s folded,null -N%(num_domains)s -s unfolded,null ' - '-k folded,unfolded,const,%(unfolding_rate)s -q folded ' + '-d %(max_time_step)g -F %(max_force_step)g -v %(velocity)g ' + '-s cantilever,hooke,%(spring_constant)g -N1 ' + '-s folded,null -N%(num_domains)d -s unfolded,null ' + '-k folded,unfolded,const,%(unfolding_rate)g -q folded ' ) % locals() sim = sawsim_histogram(sawsim_runner, param_string, N=N, bin_edges=theory.bin_edges) @@ -143,7 +146,7 @@ def constant_rate(sawsim_runner, num_domains=1, unfolding_rate=1, def test(num_domains=[1,50], unfolding_rate=[1,2], spring_constant=[1,2], - velocity=[1,2], threshold=0.3): + velocity=[1,2], threshold=0.2): m = get_manager()() sr = SawsimRunner(manager=m) try: -- 2.26.2