Exemplo n.º 1
0
def update(val):
    """update state point from sliders, solve, and replot"""
    if tstar_slider:
        w.lb = 1 / tstar_slider.val
    w.sigma = args.sigma
    w.rpm_potential()
    rhoz = 10**rhoz_slider.val
    rhos = 10**rhos_slider.val if rhos_slider else rhos_init
    solve(rhoz, rhos)
    replot()
Exemplo n.º 2
0
def update(val):
    """update state point from sliders, solve, and replot"""
    if tstar_slider:
        w.lb = 1 / tstar_slider.val
    w.sigma = args.sigma
    w.rpm_potential()
    rhoz = 10**rhoz_slider.val
    rhos = 10**rhos_slider.val if rhos_slider else rhos_init
    solve(rhoz, rhos)
    replot()
Exemplo n.º 3
0
        w.rho[2] = rhos
    else: # add solvent to make up to total hard sphere density
        w.rho[2] = rho - rhoz

if args.exp:
    w.hs_potential()
    w.msa_solve()
    w.save_reference()
    if not args.dump:
        s = str(w.closure_name, 'utf-8').strip()
        print('rho = %g \thard spheres \t%s error = %g' % (np.sum(w.rho), s, w.error))
    args.msa = True

for i in range(args.nwarm):
    w.lb = (i + 1.0) / args.nwarm * (1.0 / eval(args.tstar))
    w.rpm_potential(args.ushort)
    if w.verbose: w.write_params()
    if args.msa:
        w.msa_solve()
    else:
        w.hnc_solve()
    if not args.dump:
        s = str(w.closure_name, 'utf-8').strip()
        print('rhoz = %g \trho = %g \tlb = %g \tkappa = %g \t%s error = %g' %
              (w.rho[0]+w.rho[1], np.sum(w.rho), w.lb, w.kappa, s, w.error))

if args.exp:
    w.exp_refine()
    if not args.dump:
        s = str(w.closure_name, 'utf-8').strip()
        print('rhoz = %g \trho = %g \tlb = %g \tkappa = %g \t%s error = %g' %
Exemplo n.º 4
0
if args.solvated:
    if len(diam) == 2: diam.append(0.5*(diam[0] + diam[1]))
    w.diam[0, 2] = 0.5*(diam[0] + diam[2])
    w.diam[1, 2] = 0.5*(diam[1] + diam[2])
    w.diam[2, 2] = diam[2]

# Over-write pairwise diameters for non-additivity

if len(diam) == 4: w.diam[0, 1] = diam[3]
if len(diam) == 5: w.diam[0, 2] = w.diam[1, 2] = diam[4]
if len(diam) == 6: w.diam[1, 2] = diam[5]

w.sigma = args.sigma

w.rpm_potential()

rhoz_init = eval(args.rhoz.replace('^', '**')) # total charged species density
rhos_init = eval(args.rhos.replace('^', '**')) # added solvent density

def solve(rhoz, rhos):
    """solve the structure at the given densities"""
    w.rho[0] = rhoz/2
    w.rho[1] = rhoz/2
    if args.solvated:
        w.rho[2] = rhos
    w.hnc_solve()
    if w.return_code: exit()

def selector(individual):
    """return a list according to  (hnn, hzz) and (h00, h01) representations"""
Exemplo n.º 5
0
ctcdat = list(data[i][3] for i in range(len(data)))
compdat = list(data[i][5] for i in range(len(data)))

from oz import wizard as w

w.ng = 8192
w.ncomp = 2
w.deltar = 0.01

w.initialise()

w.lb = lb = 0.71 / 0.425
w.sigma = 1.0
w.kappa = -1.0

w.rpm_potential()

w.write_params()

npt = 41

rholo = 0.0005 
rhohi = 0.2
lrlo = m.log(rholo)
lrhi = m.log(rhohi)

x = []
y = [[] for i in range(6)]

print('\nBe patient...this takes a while to run!\n\n')
Exemplo n.º 6
0
    else:  # use --rhos setting here if --add is selected
        w.rho[2] = rhos

if args.exp:
    w.hs_potential()
    w.msa_solve()
    w.save_reference()
    if not args.dump:
        s = str(w.closure_name, 'utf-8').strip()
        print('rho = %g \thard spheres \t%s error = %g' %
              (np.sum(w.rho), s, w.error))
    args.msa = True

for i in range(args.nwarm):
    w.lb = (i + 1.0) / args.nwarm * (1.0 / eval(args.tstar))
    w.rpm_potential(args.ushort)
    if w.verbose: w.write_params()
    if args.msa:
        w.msa_solve()
    else:
        w.hnc_solve()
    if not args.dump:
        s = str(w.closure_name, 'utf-8').strip()
        print('rhoz = %g \trho = %g \tlb = %g \tkappa = %g \t%s error = %g' %
              (w.rho[0] + w.rho[1], np.sum(w.rho), w.lb, w.kappa, s, w.error))

if args.exp:
    w.exp_refine()
    if not args.dump:
        s = str(w.closure_name, 'utf-8').strip()
        print('rhoz = %g \trho = %g \tlb = %g \tkappa = %g \t%s error = %g' %