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' % (w.rho[0]+w.rho[1], np.sum(w.rho), w.lb, w.kappa, s, w.error)) if w.return_code: exit() if not args.dump: w.write_params() w.write_thermodynamics() # density-density and charge-charge structure factor # (notice how elegant this is :-) snn = np.sum(np.sum(w.sk, axis=2), axis=1) / np.sum(w.rho) szz = np.dot(np.dot(w.z, w.sk), w.z) / np.sum(w.rho * w.z**2) if args.dump: for i in range(w.ng-1): print("%g\t%g\t%g\t%g\tL" % (w.r[i], w.ulong[i, 0], w.ulong[i, 1], w.ulong[i, 2])) for i in range(w.ng-1): print("%g\t%g\t%g\tC" % (w.r[i],
rho = 6.0 * args.eta / (w.pi * w.sigma**3) for i in range(args.ncomp): w.rho[i] = rho / args.ncomp eps = 1e-20 if args.verbose: w.write_params() w.verbose = True if args.msa: w.msa_solve() else: w.hnc_solve() if w.return_code: exit() if not args.dump: w.write_thermodynamics() if args.dump: for i in range(w.ng-1): print("%g\t%g\tC" % (w.r[i], w.c[i, 0, 0])) for i in range(w.ng-1): print("%g\t%g\tH" % (w.r[i], w.hr[i, 0, 0])) for i in range(w.ng-1): print("%g\t%g\tS" % (w.k[i], w.sk[i, 0, 0])) elif args.show: import math as m
w.z[1] = -1 w.dpd_potential() rho = 3.0 xc = 0.2 w.rho[0] = 0.5 * rho * xc w.rho[1] = 0.5 * rho * xc w.rho[2] = rho * (1 - xc) w.write_params() w.verbose = True w.hnc_solve() w.write_thermodynamics() # density-density structure factor ddsf = np.sum(np.sum(w.sk, axis=2), axis=1) / np.sum(w.rho) # charge-charge structure factor (notice how elegant this is :-) ccsf = np.dot(np.dot(w.z, w.sk), w.z) plt.figure(1) imax = int(5.0 / w.deltar) plt.plot(w.r[:imax], 1.0 + w.hr[:imax, 0, 0], label='$g_{11}$') plt.plot(w.r[:imax], 1.0 + w.hr[:imax, 0, 1], label='$g_{12} = g_{21}$') plt.plot(w.r[:imax], 1.0 + w.hr[:imax, 1, 1], label='$g_{22}$') plt.plot(w.r[:imax], 1.0 + w.hr[:imax, 1, 2], label='$g_{13} = g_{31}$')
for i in range(args.ncomp): w.rho[i] = rho / args.ncomp eps = 1e-20 if args.verbose: w.write_params() w.verbose = True if args.msa: w.msa_solve() else: w.hnc_solve() if w.return_code: exit() if not args.dump: w.write_thermodynamics() if args.dump: for i in range(w.ng - 1): print("%g\t%g\tC" % (w.r[i], w.c[i, 0, 0])) for i in range(w.ng - 1): print("%g\t%g\tH" % (w.r[i], w.hr[i, 0, 0])) for i in range(w.ng - 1): print("%g\t%g\tS" % (w.k[i], w.sk[i, 0, 0])) elif args.show: import math as m