methods = [ '-tmi', '-toe', '-tmmc', ] for i in range(len(methods)): method = methods[i] fbase = 'data/lv/ww%.2f-ff%.2f-%gx%g%s' % (ww, ff, lenx, lenyz, method) fname = fbase + '-density.dat' try: minT = readandcompute.minT(fname) convergedT = readandcompute.convergedT(fname) for T in Ts: if T >= minT and T >= convergedT * 0.8: density, x = readandcompute.density_x(fbase, T) plt.plot(x / 2, density, color(T) + lines[i]) if first_method or method == the_first_method: if first_temperature[i]: plt.plot(x / 2, density, color(T) + lines[i], label='T=%g %s (converged to %.2g)' % (T, method[1:], convergedT)) first_temperature[i] = False else: plt.plot(x / 2, density, color(T) + lines[i], label='T=%g' % T) the_first_method = method
matplotlib.rc("font", **{"family": "serif", "serif": ["Computer Modern"]}) matplotlib.rc("text", usetex=True) import readandcompute ww = float(sys.argv[1]) # arg ww = [1.3] ff = float(sys.argv[2]) # arg ff = [0.1] lenx = float(sys.argv[3]) # arg lenx = [50,100] lenyz = float(sys.argv[4]) # arg lenyz = [10] T = float(sys.argv[5]) # arg T = [1.0,10.0] plt.figure() density, x = readandcompute.density_x("data/lv/ww%.2f-ff%.2f-%gx%g" % (ww, ff, lenx, lenyz), T) plt.plot(x / 2, density) plt.ylim(0) plt.xlabel(r"$z/\sigma$") plt.ylabel(r"$\eta$") plt.title(r"$\eta(z)$ with $\lambda = %g$, $\eta=%g$, and $T/\epsilon = %g$" % (ww, ff, T)) plt.savefig("figs/liquid-vapor-ww%.2f-ff%.2f-%gx%g-T%.2g.pdf" % (ww, ff, lenx, lenyz, T)) plt.show()
first_method = True the_first_method = '' first_temperature = [True, True, True] methods = ['-tmi', '-toe', '-tmmc', ] for i in range(len(methods)): method = methods[i] fbase = 'data/lv/ww%.2f-ff%.2f-%gx%g%s' % (ww,ff,lenx,lenyz,method) fname = fbase + '-density.dat' try: minT = readandcompute.minT(fname) convergedT = readandcompute.convergedT(fname) for T in Ts: if T >= minT and T >= convergedT*0.8: density, x = readandcompute.density_x(fbase, T) plt.plot(x/2, density, color(T)+lines[i]) if first_method or method == the_first_method: if first_temperature[i]: plt.plot(x/2, density, color(T)+lines[i], label='T=%g %s (converged to %.2g)' % (T, method[1:], convergedT)) first_temperature[i] = False else: plt.plot(x/2, density, color(T)+lines[i], label='T=%g' % T) the_first_method = method first_method = False elif first_temperature[i]: plt.plot(x/2, density, color(T)+lines[i], label='T=%g %s (converged to %.2g)' % (T, method[1:], convergedT)) first_temperature[i] = False else: