3 size(6cm,4cm,IgnoreAspect);
14 real f_raw(real x) {return -(x-a)*(x-b)**2;}
15 real f_min = f_raw(x_min);
16 real f_max = f_raw(x_max);
17 real f(real x) {return (f_raw(x)-f_min)/(f_max-f_min);}
19 // df/dx = -(x-b)**2 - 2(x-a)(x-b)
20 // at the extremes, df/dx = 0, so
21 // (x-b)**2 = -2(x-a)(x-b)
29 real x_fold = (2*a+b)/3;
32 real const_force(real x) {return f(x_fold)-F*(x-x_fold);}
33 real force(real x) {return const_force(x)+1/2*k*(x-x_fold)**2;}
34 real f_force(real x) {return f(x)+(force(x)-f(x_fold));}
36 draw(graph(f, 0, 1, operator ..), blue);
37 draw(graph(const_force, 0, 1, operator ..), dashed);
38 draw(graph(force, 0, 1, operator ..), black);
39 draw(graph(f_force, 0, 1, operator ..), red);
41 dot(sLabel("folded",align=S),(x_fold, f(x_fold)));
42 dot(sLabel("barrier",align=N),(x_barrier, f(x_barrier)));
47 label(sLabel("Energy landscape schematic"), point(N), N);
48 xaxis(sLabel("End-to-end distance $x$"), BottomTop);
49 yaxis(sLabel("Free energy $E$"), LeftRight);