Add a PyMOL builder to SCons and generalize PYMOL_PATH setup.
[thesis.git] / tex / src / figures / schematic / landscape-cant.asy
1 import wtk_graph;
2
3 size(6cm,4cm,IgnoreAspect);
4
5 scale(Linear,Linear);
6
7 real a = 0.2;
8 real b = 0.7;
9 real F = 0.3;
10 real k = 0.5;
11 real x_min = 1;
12 real x_max = 0;
13
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);}
18
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)
22 //   so
23 //        x-b = 0
24 //          x = b
25 //   or
26 //    -2(x-a) = (x-b)
27 //          x = (2a + b)/3
28
29 real x_fold = (2*a+b)/3;
30 real x_barrier = b;
31
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));}
35
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);
40
41 dot(sLabel("folded",align=S),(x_fold, f(x_fold)));
42 dot(sLabel("barrier",align=N),(x_barrier, f(x_barrier)));
43
44 xlimits(0, 1, Crop);
45 ylimits(0, 1, Crop);
46
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);