コード例 #1
0
def plot_walls(reduced_density, temps):
    num = 1
    sigma_over_R=2**(5/6)
    have_labelled_dft = False
    have_labelled_bh = False
    NUM=1
    for temp in temps:
        fname = 'figs/new-data/soft-wall-%.2f-%.2f.dat' % (reduced_density/100.0, temp)
        data = loadtxt(fname)
        z = -data[:, 0]
        z -= z.min()
        nreduced_density = data[:, 1]
        if have_labelled_dft:
            plot(z, nreduced_density, styles.new_dft_code(temp))
        else:
            plot(z, nreduced_density, styles.new_dft_code(temp), label = 'DFT $T^* = %g$' % temp)
            have_labelled_dft = True

        fname = 'figs/new-data/bh-soft-wall-%.2f-%.2f.dat' % (reduced_density/100.0, temp)
        data = loadtxt(fname)
        z = -data[:, 0]
        z -= z.min()
        nreduced_density = data[:, 1]
        if have_labelled_bh:
            plot(z, nreduced_density, styles.color[temp]+':')
        else:
            plot(z, nreduced_density, styles.color[temp]+':', label = 'BH $T^* = %g$' % temp)
            have_labelled_bh = True

        # fname = 'figs/mcfcc-walls-%04.4f-%.4f.dat' % (reduced_density/100.0, temp)
        # data = loadtxt(fname)
        # zmin = data[:, 0].min()
        # plot(smooth((data[:, 0]-zmin)/sigma_over_R, num), smooth(data[:, 1]*sigma_over_R**3, num),
        #      styles.mcwca(temp), label = 'WCA MC $T^*$ = %g' % temp)

        fname = 'figs/mc-soft-wall-%04.4f-%.4f.dat' % (reduced_density/100.0, temp)
        data = loadtxt(fname)
        z = -data[:,0]
        z -= z.min()
        smoothed = smooth(data[:, 1], NUM)
        print(reduced_density/100, temp, smoothed[len(smoothed)//2])
        plot(smooth(z, NUM), smooth(data[:, 1], NUM),
             styles.mcwca(temp), label = 'soft-walls-backwards WCA MC $T^*$ = %g' % temp)

    title('Hard walls with bulk $n^* = %g$' % (reduced_density/100))
    xlabel(r'$z/\sigma$')
    ylabel('$n^*(r)$')
    legend()
    plt.ylim(0)
    plt.xlim(0, 2.5)
コード例 #2
0
def plot_radial(reduced_density, temps):
    have_labelled_bh = False
    sigma_over_R = 2**(5 / 6)
    have_labelled_dft = False
    for temp in temps:
        fname = 'figs/new-data/radial-wca-%06.4f-%04.2f.dat' % (
            temp, reduced_density / 100.0)
        data = loadtxt(fname)
        r = data[:, 0]
        nreduced_density = data[:, 1]
        g = nreduced_density / (reduced_density / 100.0)
        if have_labelled_dft:
            plot(r, g, styles.new_dft_code(temp))
        else:
            plot(r,
                 g,
                 styles.new_dft_code(temp),
                 label='DFT $T^* = %g$' % temp)
            have_labelled_dft = True

        fname = 'figs/new-data/radial-bh-wca-%06.4f-%04.2f.dat' % (
            temp, reduced_density / 100.0)
        data = loadtxt(fname)
        r = data[:, 0]
        nreduced_density = data[:, 1]
        g = nreduced_density / (reduced_density / 100.0)
        if have_labelled_bh:
            plot(r, g, styles.color[temp] + ':')
        else:
            plot(r, g, styles.color[temp] + ':', label='BH $T^* = %g$' % temp)
            have_labelled_bh = True
        #plot(r, g, styles.bh_dft(temp))

        fname = 'figs/mcfcc-%04.4f-%.4f.dat.gradial' % (reduced_density /
                                                        100.0, temp)
        g = loadtxt(fname)
        plot(g[:, 0] / sigma_over_R,
             g[:, 1],
             styles.mcwca(temp),
             label='WCA MC $T^*$ = %g' % temp)

    title('Radial distribution function at $n^* = %g$' %
          (reduced_density / 100))
    xlabel(r'$r/\sigma$')
    ylabel('$g(r)$')
    legend()
    xlim(0, 3)
コード例 #3
0
def plot_soft_walls(reduced_density, temps):
    have_labelled_bh = False
    sigma_over_R=2**(5/6)
    have_labelled_dft = False
    NUM = 1
    for temp in temps:
        fname = 'figs/new-data/soft-wall-%.2f-%.2f.dat' % (reduced_density/100.0, temp)
        data = loadtxt(fname)
        z = data[:,0]
        nreduced_density = data[:,1]
        if have_labelled_dft:
            plot(z, nreduced_density, styles.new_dft_code(temp))
        else:
            plot(z, nreduced_density, styles.new_dft_code(temp), label = 'DFT $T^* = %g$' % temp)
            have_labelled_dft = True

        fname = 'figs/new-data/bh-soft-wall-%.2f-%.2f.dat' % (reduced_density/100.0, temp)
        data = loadtxt(fname)
        z = data[:,0]
        nreduced_density = data[:,1]
        if have_labelled_bh:
            plot(z, nreduced_density, styles.color[temp]+':')
        else:
            plot(z, nreduced_density, styles.color[temp]+':', label = 'BH $T^* = %g$' % temp)
            have_labelled_bh = True
        plot(z, nreduced_density, styles.bh_dft(temp))
        
        fname = 'figs/mc-soft-wall-%04.4f-%.4f.dat' % (reduced_density/100.0, temp)
        data = loadtxt(fname)
        zmin = data[:,0].min()
        plot(smooth(data[:,0]-zmin,NUM), smooth(data[:,1],NUM)/2**(-5.0/2.0),
             styles.mcwca(temp), label = 'WCA MC $T^*$ = %g' % temp)

    #plot(data[:,0], data[:,2]*0.1, 'r:', label='$V_{wall}$ (arbitrary units)')

    title('Soft walls with bulk $n^* = %g$' % (reduced_density/100))
    xlabel(r'$z/\sigma$')
    ylabel('$n^*(r)$')
    legend()
    xlim(-0.2, 6)
    outputname = 'figs/soft-walls-%02d.pdf' % (reduced_density)
    savefig(outputname, bbox_inches=0)
    print('figs/walls-%02d.pdf' % (reduced_density))
コード例 #4
0
ファイル: plot-walls.py プロジェクト: yidapa/deft
def plot_walls(reduced_density, temps):
    num = 1
    sigma_over_R = 2 ** (5 / 6)
    have_labelled_dft = False
    have_labelled_bh = False
    for temp in temps:
        fname = "figs/new-data/wall-%.2f-%.2f.dat" % (reduced_density / 100.0, temp)
        data = loadtxt(fname)
        z = data[:, 0]
        nreduced_density = data[:, 1]
        if have_labelled_dft:
            plot(z, nreduced_density, styles.new_dft_code(temp))
        else:
            plot(z, nreduced_density, styles.new_dft_code(temp), label="DFT $T^* = %g$" % temp)
            have_labelled_dft = True

        fname = "figs/new-data/bh-wall-%.2f-%.2f.dat" % (reduced_density / 100.0, temp)
        data = loadtxt(fname)
        z = data[:, 0]
        nreduced_density = data[:, 1]
        if have_labelled_bh:
            plot(z, nreduced_density, styles.color[temp] + ":")
        else:
            plot(z, nreduced_density, styles.color[temp] + ":", label="BH $T^* = %g$" % temp)
            have_labelled_bh = True

        fname = "figs/mcfcc-walls-%04.4f-%.4f.dat" % (reduced_density / 100.0, temp)
        data = loadtxt(fname)
        zmin = data[:, 0].min()
        plot(
            smooth((data[:, 0] - zmin) / sigma_over_R, num),
            smooth(data[:, 1] * sigma_over_R ** 3, num),
            styles.mcwca(temp),
            label="WCA MC $T^*$ = %g" % temp,
        )

    title("Hard walls with bulk $n^* = %g$" % (reduced_density / 100))
    xlabel(r"$z/\sigma$")
    ylabel("$n^*(r)$")
    legend()
    xlim(-0.2, 4)
コード例 #5
0
ファイル: radial-distribution.py プロジェクト: droundy/deft
def plot_radial(reduced_density, temps):
    have_labelled_bh = False
    sigma_over_R=2**(5/6)
    have_labelled_dft = False
    for temp in temps:
        fname = 'figs/new-data/radial-wca-%06.4f-%04.2f.dat' % (temp, reduced_density/100.0)
        data = loadtxt(fname)
        r = data[:,0]
        nreduced_density = data[:,1]
        g = nreduced_density/(reduced_density/100.0)
        if have_labelled_dft:
            plot(r, g, styles.new_dft_code(temp))
        else:
            plot(r, g, styles.new_dft_code(temp), label = 'DFT $T^* = %g$' % temp)
            have_labelled_dft = True

        fname = 'figs/new-data/radial-bh-wca-%06.4f-%04.2f.dat' % (temp, reduced_density/100.0)
        data = loadtxt(fname)
        r = data[:,0]
        nreduced_density = data[:,1]
        g = nreduced_density/(reduced_density/100.0)
        if have_labelled_bh:
            plot(r, g, styles.color[temp]+':')
        else:
            plot(r, g, styles.color[temp]+':', label = 'BH $T^* = %g$' % temp)
            have_labelled_bh = True
        #plot(r, g, styles.bh_dft(temp))
        
        fname = 'figs/mcfcc-%04.4f-%.4f.dat.gradial' % (reduced_density/100.0, temp)
        g = loadtxt(fname)
        plot(g[:,0]/sigma_over_R, g[:,1], styles.mcwca(temp), label = 'WCA MC $T^*$ = %g' % temp)
            
    title('Radial distribution function at $n^* = %g$' % (reduced_density/100))
    xlabel(r'$r/\sigma$')
    ylabel('$g(r)$')
    legend()
    xlim(0, 3)
コード例 #6
0
ファイル: plot-soft-walls.py プロジェクト: iCodeIN/deft
def plot_soft_walls(reduced_density, temps):
    have_labelled_bh = False
    sigma_over_R = 2**(5 / 6)
    have_labelled_dft = False
    NUM = 1
    zmax = 5
    for temp in temps:
        fname = 'figs/new-data/soft-wall-%.2f-%.2f.dat' % (reduced_density /
                                                           100.0, temp)
        data = loadtxt(fname)
        z = data[:, 0]
        Vext = data[:, 2]
        z_center = find_z_with_V(z, Vext, 10)
        z = z - z_center
        nreduced_density = data[:, 1]
        Vext = data[:, 2]
        if have_labelled_dft:
            plot(z[z <= zmax], nreduced_density[z <= zmax],
                 styles.new_dft_code(temp))
            # plot(z, Vext, 'r-')
        else:
            plot(z[z <= zmax],
                 nreduced_density[z <= zmax],
                 styles.new_dft_code(temp),
                 label='DFT $T^* = %g$' % temp)
            have_labelled_dft = True

        fname = 'figs/new-data/bh-soft-wall-%.2f-%.2f.dat' % (reduced_density /
                                                              100.0, temp)
        data = loadtxt(fname)
        z = data[:, 0]
        Vext = data[:, 2]
        z_center = find_z_with_V(z, Vext, 10)
        z = z - z_center
        nreduced_density = data[:, 1]
        if have_labelled_bh:
            plot(z[z <= zmax], nreduced_density[z <= zmax],
                 styles.color[temp] + ':')
        else:
            plot(z[z <= zmax],
                 nreduced_density[z <= zmax],
                 styles.color[temp] + ':',
                 label='BH $T^* = %g$' % temp)
            have_labelled_bh = True
        # plot(z-z_center, Vext, '--', label=f'Vext bh {temp}')

        fname = 'figs/mc-soft-wall-%04.4f-%.4f.dat' % (reduced_density / 100.0,
                                                       temp)
        data = loadtxt(fname)
        z = data[:, 0]
        zmin = z.min()
        smoothed = smooth(data[:, 1], NUM)
        Vext = data[:, 2]
        z_center = find_z_with_V(z, Vext, 10)
        print(reduced_density / 100, temp, smoothed[len(smoothed) // 2])
        smoothed_z = smooth(z - z_center, NUM)
        smoothed_n = smooth(data[:, 1], NUM)
        plot(smoothed_z[smoothed_z <= zmax],
             smoothed_n[smoothed_z <= zmax],
             styles.mcwca(temp),
             label='WCA MC $T^*$ = %g' % temp)
        # plot(z-z_center, Vext, '.', label=f'Vext mc {temp}')
        # plt.ylim(0,5)

    #plot(data[:,0], data[:,2]*0.1, 'r:', label='$V_{wall}$ (arbitrary units)')

    title('Soft walls with bulk $n^* = %g$' % (reduced_density / 100))
    xlabel(r'$z/\sigma$')
    ylabel('$n^*(r)$')
    legend()
    xlim(-0.3, zmax)
    outputname = 'figs/soft-walls-%02d.pdf' % (reduced_density)
    savefig(outputname, bbox_inches=0)
    print(('figs/walls-%02d.pdf' % (reduced_density)))