projects
/
sawsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Standardize max step calculation and fit-parameter requirements in pysawsim.test.
[sawsim.git]
/
pysawsim
/
test
/
constant_rate.py
diff --git
a/pysawsim/test/constant_rate.py
b/pysawsim/test/constant_rate.py
index 63fd4f7690f68a9ba53c634566662b96f0653d89..c71bdf596f87b75df0f614c24d40c496fb8aac5b 100644
(file)
--- 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
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
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()
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 '
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')]:
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)
return sim.residual(theory)