3 size(15cm,10cm,IgnoreAspect);
6 real k = infinity; /* spring constant in N/m, already accounted for (0.05) */
16 real kB = 1.3806504e-23;
19 real WLC(real x, real L, real p=p, real T=T, real kB=kB,
20 real xLmax=0.99, real fmax=fnmax) {
25 f = kB*T/p*(0.25*(1/(1-x/L)^2 - 1) + x/L);
31 void graphSawtooth(string file="datafile", real k,
32 int xcol=0, int fcol=1,
33 real xscale=1, real fscale=1, real dx=0, real df=0,
35 file fin=input(file).line();
36 real[][] a=fin.dimension(0,0);
40 x = x - f/k; /* Remove cantilever extension */
41 graphData(x=x, y=f, xscale=xscale, yscale=fscale,
42 dx=dx, dy=df, p=p, dots=false);
45 /* expt.dat already scaled to nm and pN */
46 graphSawtooth("expt.dat", k=k, p=psoft);
48 file fin = input('expt-Ls.dat').line();
49 real[][] a = fin.dimension(0,0);
53 for (i=0; i<Ls.length; ++i) {
55 real f = WLC(x / xscale, L=Ls[i]);
57 write(x, fnmax*fscale * 1.1);
58 return fnmax*fscale * 1.1;
63 draw(graph(fn, a=0, b=0.9*Ls[i]*xscale), p=phard);
66 xlimits(xmin*xscale, xmax*xscale, crop=true);
67 ylimits(fmin*fscale, fmax*fscale, crop=true);
69 xaxis(sLabel("Distance (nm)"), BottomTop, LeftTicks);
70 yaxis(sLabel("Force (pN)"), LeftRight, RightTicks);
71 label(sLabel("Poly-ubiquitin force curve"), point(N), N);