image0

Case Studies: Nanocomposites

There have been many PRISM-based theoretical studies focused on understanding how the design of the filler and matrix material in polymer nanocomposites (PNCs) lead to controlled morphologies and particle/filler dispersion in the matrix; much of this work is summarized in several recent reviews.[1-3] Traditional simulation methodologies are challenged to equilibrate large PNC systems with long matrix chains because the relaxation times of these systems are often much longer than comparable simulations at lower densities and/or short matrix chains. Results from PRISM calculations are, by definition, equilibrium predictions so that relaxation times and equilibration are not a problem. Furthermore, the problem of finite-size effects is not present in PRISM theory.

Concepts Used

  • Multicomponent PRISM
  • Phase space “hopping”
  • Heterogeneous interactions
  • Domain interpolation
  • Complex molecular structure
  • Simulation derived \(\hat{\omega}(k)\)

Tools Used

  • pyPRISM.calculate.pair_correlation
  • pyPRISM.calculate.pmf

References

  1. Ganesan, V. and A. Jayaraman, Theory and simulation studies of effective interactions, phase behavior and morphology in polymer nanocomposites. Soft Matter, 2014. 10(1): p. 13-38.
  2. Jayaraman, A. and N. Nair, Integrating PRISM theory and Monte Carlo simulation to study polymer-functionalised particles and polymer nanocomposites. Molecular Simulation, 2012. 38(8-9): p. 751-761.
  3. Hall, L.M., A. Jayaraman, and K.S. Schweizer, Molecular theories of polymer nanocomposites. Current Opinion in Solid State and Materials Science, 2010. 14(2): p. 38-48.
  4. Hooper, J.B.; Schweizer, K.S.; Contact Aggregation, Bridging, and Steric Stabilization in Dense Polymer Particle Mixtures, Macromolecules 2005, 38, 8858-8869
  5. Modica, K.J.; Martin, T.B.; Jayaraman, A.J.; Effect of Architecture on the Structure and Interactions of Polymer Grafted Particles: Theory and Simulation, Macromolecules, 2017, 50 (12), pp 4854-4866

Notebook Setup

To begin, please run Kernel-> Restart & Clear Output from the menu at the top of the notebook. It is a good idea to run this before starting any notebook so that the notebook is fresh for the user. Next, run the cell below (via the top menu-bar or <Shift-Enter>. If the cell throws an import error, there is likely something wrong with your environment.

If successful, you should see a set of logos appear below the cell. Which logos appear depend on what is inside the hv.extension() command at the bottom of the cell. If no logos appear and the cell throws an error, there is likely something wrong with your environment.

Troubleshooting:

  • Did you activate the correct conda environment before starting the jupyter notebook?
  • If not using anaconda, did you install all dependencies before starting the jupyter notebook?
  • Is pyPRISM installed in your current environment on your PYTHONPATH?

Holoviews + Bokeh Logos: Logos

[1]:
import pyPRISM
import numpy as np
import holoviews as hv
hv.extension('bokeh')


def interpolate_guess(domain_from,domain_to,rank,guess):
    '''Helper for upscaling the intial guesses'''
    guess = guess.reshape((domain_from.length,rank,rank))
    new_guess = np.zeros((domain_to.length,rank,rank))
    for i in range(rank):
        for j in range(rank):
            new_guess[:,i,j] = np.interp(domain_to.r,domain_from.r,guess[:,i,j])
    return new_guess.reshape((-1,))

Bare Particle Nanocomposite

image0

In this example, we use pyPRISM to study a polymer nanocomposite system in which polymer chains of length N = 100 are mixed with a bare nanoparticle.[4] The nanoparticle is of diameter D = 16d, where d is the diameter of one segment of the polymer chain (either a monomer or a coarse-grained bead). We plot the particle-particle pair correlations as a function of the range of the particle-polymer attraction.

As usual, we’ll define the plot aesthetics first.

[2]:
%opts Curve Scatter [width=500,height=400] Layout [shared_axes=False] Scatter (size=10,alpha=0.5)
%opts Curve Scatter [fontsize={'xlabel':14,'xlabel':14,'ylabel':14,'ticks':12}]
%opts Overlay [legend_position='bottom_left']
%opts Layout [shared_axes=False]


colors = {}
colors[1.0] = 'blue'
colors[0.5] = 'red'
colors[0.25] = 'green'

ls = {}
ls[1.0] = 'solid'
ls[0.5] = 'dashed'
ls[0.25] = 'dotted'

markers = {}
markers[1.0] = 'o'
markers[0.5] = '^'
markers[0.25] = 'd'

First, we load the reference data from Ref. 4

[3]:
gr_compare = []
for density in [1.0,0.5,0.25]:
    fname = '../data/BareComposite-Gr-alpha{}.csv'.format(density)
    x,y = np.loadtxt(fname,delimiter=',').T
    gr_compare.append([density,x,y])

Next, we need to solve the PRISM equations, but we can’t solve for the particle size we want (D=16d) directly. You can try it, but pyPRISM won’t be able to converge the equations. Instead, we sequentially solve the PRISM equations starting for a small diameter particle and progressively increase the particle size. Each successive loop (or particle diameter) uses the solution from the last loop as a starting guess, greatly increasing the ability of pyPRISM to converge. This process is the so-called “phase space hopping”.

[4]:
d = 1.0 #polymer segment diameter
phi = 0.001 #volume fraction of nanoparticles
eta = 0.4 #total occupied volume fraction

sys = pyPRISM.System(['particle','polymer'],kT=1.0)
sys.domain = pyPRISM.Domain(dr=0.1,length=1024)

guess = np.zeros(sys.rank*sys.rank*sys.domain.length)
for D in np.arange(1.0,16.5,0.5):
    print('==> Solving for nanoparticle diameter D=',D)

    sys.diameter['polymer'] = d
    sys.diameter['particle'] = D
    sys.density['polymer'] = (1-phi)*eta/sys.diameter.volume['polymer']
    sys.density['particle'] = phi*eta/sys.diameter.volume['particle']
    print('--> rho=',sys.density['polymer'],sys.density['particle'])

    sys.omega['polymer','polymer'] = pyPRISM.omega.FreelyJointedChain(length=100,l=4.0*d/3.0)
    sys.omega['polymer','particle'] = pyPRISM.omega.InterMolecular()
    sys.omega['particle','particle'] = pyPRISM.omega.SingleSite()


    sys.potential['polymer','polymer'] = pyPRISM.potential.HardSphere()
    sys.potential['polymer','particle'] = pyPRISM.potential.Exponential(alpha=0.5,epsilon=1.0)
    sys.potential['particle','particle'] = pyPRISM.potential.HardSphere()

    sys.closure['polymer','polymer'] = pyPRISM.closure.PercusYevick()
    sys.closure['polymer','particle'] = pyPRISM.closure.PercusYevick()
    sys.closure['particle','particle'] = pyPRISM.closure.HyperNettedChain()

    PRISM = sys.createPRISM()

    result = PRISM.solve(guess)

    guess = np.copy(PRISM.x)

    print('')

last_guess=guess
print('Done!')

==> Solving for nanoparticle diameter D= 1.0
--> rho= 0.7631797831142566 0.0007639437268410977
0:  |F(x)| = 3.35879; step 1; tol 0.476156
1:  |F(x)| = 0.752641; step 1; tol 0.204052
2:  |F(x)| = 0.189662; step 1; tol 0.0571517
3:  |F(x)| = 0.0163282; step 1; tol 0.00667045
4:  |F(x)| = 8.51675e-05; step 1; tol 2.44859e-05
5:  |F(x)| = 5.70769e-07; step 1; tol 4.04217e-05

==> Solving for nanoparticle diameter D= 1.5
--> rho= 0.7631797831142566 0.00022635369684180674
0:  |F(x)| = 2.51597; step 1; tol 0.291082
1:  |F(x)| = 0.0149118; step 1; tol 3.1615e-05
2:  |F(x)| = 1.30481e-06; step 1; tol 6.89089e-09

==> Solving for nanoparticle diameter D= 2.0
--> rho= 0.7631797831142566 9.549296585513722e-05
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 1.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 1.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
0:  |F(x)| = 4.36967; step 1; tol 0.268366
1:  |F(x)| = 0.0170008; step 1; tol 1.36234e-05
2:  |F(x)| = 3.64061e-06; step 1; tol 4.12714e-08

==> Solving for nanoparticle diameter D= 2.5
--> rho= 0.7631797831142566 4.889239851783025e-05
0:  |F(x)| = 13.3593; step 0.449922; tol 0.456306
1:  |F(x)| = 4.12463; step 1; tol 0.187394
2:  |F(x)| = 3.46116; step 0.183782; tol 0.633747
3:  |F(x)| = 2.87865; step 0.21045; tol 0.622555
4:  |F(x)| = 2.31803; step 0.340597; tol 0.583582
5:  |F(x)| = 1.22038; step 1; tol 0.306511
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 1.75 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 1.75 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
6:  |F(x)| = 0.844008; step 0.355097; tol 0.430475
7:  |F(x)| = 0.558075; step 1; tol 0.393491
8:  |F(x)| = 0.0332253; step 1; tol 0.139352
9:  |F(x)| = 0.00112344; step 1; tol 0.00102897
10:  |F(x)| = 0.000120797; step 1; tol 0.0104053
11:  |F(x)| = 5.73715e-07; step 1; tol 2.03013e-05

==> Solving for nanoparticle diameter D= 3.0
--> rho= 0.7631797831142566 2.8294212105225843e-05
0:  |F(x)| = 33.8126; step 1; tol 0.678155
1:  |F(x)| = 28.0988; step 1; tol 0.621528
2:  |F(x)| = 8.49318; step 1; tol 0.347667
3:  |F(x)| = 7.99288; step 0.0674904; tol 0.797092
4:  |F(x)| = 7.53265; step 0.0695425; tol 0.799339
5:  |F(x)| = 6.96739; step 0.107141; tol 0.769994
6:  |F(x)| = 6.09455; step 0.289239; tol 0.688628
7:  |F(x)| = 5.23117; step 0.400351; tol 0.663066
8:  |F(x)| = 4.61057; step 0.207589; tol 0.699124
9:  |F(x)| = 3.87016; step 0.465009; tol 0.634148
10:  |F(x)| = 2.38955; step 1; tol 0.361929
11:  |F(x)| = 0.493714; step 1; tol 0.117894
12:  |F(x)| = 0.0313452; step 1; tol 0.00362772
13:  |F(x)| = 0.000587425; step 1; tol 0.000316086
14:  |F(x)| = 1.01368e-06; step 1; tol 2.68003e-06

==> Solving for nanoparticle diameter D= 3.5
--> rho= 0.7631797831142566 1.7817929489005196e-05
0:  |F(x)| = 17.5377; step 1; tol 0.121571
1:  |F(x)| = 0.0765622; step 1; tol 1.71525e-05
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 2.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 2.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
2:  |F(x)| = 0.000193902; step 1; tol 5.77267e-06
3:  |F(x)| = 2.52679e-09; step 1; tol 1.52833e-10

==> Solving for nanoparticle diameter D= 4.0
--> rho= 0.7631797831142566 1.1936620731892152e-05
0:  |F(x)| = 22.5886; step 1; tol 0.102406
1:  |F(x)| = 0.105308; step 1; tol 1.95609e-05
2:  |F(x)| = 0.000304109; step 1; tol 7.50543e-06
3:  |F(x)| = 1.11149e-08; step 1; tol 1.20224e-09

==> Solving for nanoparticle diameter D= 4.5
--> rho= 0.7631797831142566 8.38347025340025e-06
0:  |F(x)| = 84.8999; step 1; tol 0.318629
1:  |F(x)| = 0.625624; step 1; tol 4.88714e-05
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 2.75 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 2.75 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
2:  |F(x)| = 0.00991608; step 1; tol 0.000226098
3:  |F(x)| = 1.58233e-06; step 1; tol 2.29169e-08

==> Solving for nanoparticle diameter D= 5.0
--> rho= 0.7631797831142566 6.1115498147287816e-06
0:  |F(x)| = 39.3476; step 1; tol 0.0665939
1:  |F(x)| = 0.147671; step 1; tol 1.26764e-05
2:  |F(x)| = 0.0014265; step 1; tol 8.39835e-05
3:  |F(x)| = 2.326e-08; step 1; tol 2.39286e-10

==> Solving for nanoparticle diameter D= 5.5
--> rho= 0.7631797831142566 4.591697832253028e-06
0:  |F(x)| = 141.56; step 1; tol 0.207739
1:  |F(x)| = 1.19746; step 1; tol 6.43995e-05
2:  |F(x)| = 0.0378919; step 1; tol 0.000901184
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 3.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 3.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
3:  |F(x)| = 7.66943e-06; step 1; tol 3.68703e-08

==> Solving for nanoparticle diameter D= 6.0
--> rho= 0.7631797831142566 3.5367765131532304e-06
0:  |F(x)| = 62.1156; step 1; tol 0.045593
1:  |F(x)| = 0.407947; step 1; tol 3.88193e-05
2:  |F(x)| = 0.00412423; step 1; tol 9.19861e-05
3:  |F(x)| = 4.59293e-08; step 1; tol 1.11619e-10

==> Solving for nanoparticle diameter D= 6.5
--> rho= 0.7631797831142566 2.7817705119384533e-06
0:  |F(x)| = 207.772; step 1; tol 0.132233
1:  |F(x)| = 15.1124; step 1; tol 0.0047614
2:  |F(x)| = 3.13; step 1; tol 0.0386067
3:  |F(x)| = 0.0577293; step 1; tol 0.000306159
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 3.75 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 3.75 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
4:  |F(x)| = 9.18447e-05; step 1; tol 2.27802e-06
5:  |F(x)| = 3.75471e-09; step 1; tol 1.50413e-09

==> Solving for nanoparticle diameter D= 7.0
--> rho= 0.7631797831142566 2.2272411861256494e-06
0:  |F(x)| = 277.284; step 1; tol 0.120386
1:  |F(x)| = 4.18104; step 1; tol 0.000204626
2:  |F(x)| = 0.160302; step 1; tol 0.00132297
3:  |F(x)| = 1.6376e-05; step 1; tol 9.39248e-09

==> Solving for nanoparticle diameter D= 7.5
--> rho= 0.7631797831142566 1.8108295747344538e-06
0:  |F(x)| = 117.836; step 1; tol 0.0286554
1:  |F(x)| = 2.76609; step 1; tol 0.000495926
2:  |F(x)| = 0.0152838; step 1; tol 2.74772e-05
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 4.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 4.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
3:  |F(x)| = 0.000112244; step 1; tol 4.85406e-05
4:  |F(x)| = 3.3387e-08; step 1; tol 7.96289e-08

==> Solving for nanoparticle diameter D= 8.0
--> rho= 0.7631797831142566 1.492077591486519e-06
0:  |F(x)| = 397.936; step 1; tol 0.0940404
1:  |F(x)| = 10.4781; step 1; tol 0.000623994
2:  |F(x)| = 0.8405; step 1; tol 0.00579099
3:  |F(x)| = 0.00383529; step 1; tol 1.87398e-05
4:  |F(x)| = 2.39322e-05; step 1; tol 3.50438e-05

==> Solving for nanoparticle diameter D= 8.5
--> rho= 0.7631797831142566 1.2439547760490093e-06
0:  |F(x)| = 176.473; step 1; tol 0.0261535
1:  |F(x)| = 3.76473; step 1; tol 0.000409592
2:  |F(x)| = 0.0324109; step 1; tol 6.67051e-05
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 4.75 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 4.75 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
3:  |F(x)| = 1.7509e-06; step 1; tol 2.62653e-09

==> Solving for nanoparticle diameter D= 9.0
--> rho= 0.7631797831142566 1.0479337816750313e-06
0:  |F(x)| = 574.84; step 1; tol 0.0829008
1:  |F(x)| = 15.9181; step 1; tol 0.00069013
2:  |F(x)| = 1.65015; step 1; tol 0.00967176
3:  |F(x)| = 0.00655294; step 1; tol 1.41928e-05
4:  |F(x)| = 0.000175832; step 1; tol 0.000647989
5:  |F(x)| = 3.67023e-08; step 1; tol 3.92132e-08

==> Solving for nanoparticle diameter D= 9.5
--> rho= 0.7631797831142566 8.910263616749937e-07
0:  |F(x)| = 239.797; step 1; tol 0.0215953
1:  |F(x)| = 11.0745; step 1; tol 0.00191958
2:  |F(x)| = 0.0434715; step 1; tol 1.38676e-05
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 5.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 5.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
3:  |F(x)| = 4.73801e-06; step 1; tol 1.06912e-08

==> Solving for nanoparticle diameter D= 10.0
--> rho= 0.7631797831142566 7.639437268410977e-07
0:  |F(x)| = 768.395; step 1; tol 0.068102
1:  |F(x)| = 30.3432; step 1; tol 0.00140345
2:  |F(x)| = 5.95924; step 1; tol 0.0347137
3:  |F(x)| = 0.0444734; step 1; tol 5.01257e-05
4:  |F(x)| = 0.000112389; step 1; tol 5.74763e-06
5:  |F(x)| = 2.26527e-09; step 1; tol 3.65626e-10

==> Solving for nanoparticle diameter D= 10.5
--> rho= 0.7631797831142566 6.599233144075998e-07
0:  |F(x)| = 314.242; step 1; tol 0.0178885
1:  |F(x)| = 16.4152; step 1; tol 0.00245587
2:  |F(x)| = 0.0876236; step 1; tol 2.56444e-05
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 5.75 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 5.75 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
3:  |F(x)| = 3.25965e-05; step 1; tol 1.24549e-07

==> Solving for nanoparticle diameter D= 11.0
--> rho= 0.7631797831142566 5.739622290316286e-07
0:  |F(x)| = 1220.51; step 1; tol 0.0845337
1:  |F(x)| = 81.7903; step 1; tol 0.00404171
2:  |F(x)| = 32.4461; step 1; tol 0.141633
3:  |F(x)| = 0.390322; step 1; tol 0.000130245
4:  |F(x)| = 0.0027524; step 1; tol 4.47528e-05
5:  |F(x)| = 2.15594e-07; step 1; tol 5.52194e-09

==> Solving for nanoparticle diameter D= 11.5
--> rho= 0.7631797831142566 5.023054010626105e-07
0:  |F(x)| = 493.505; step 1; tol 0.0226383
1:  |F(x)| = 26.7595; step 1; tol 0.00264615
2:  |F(x)| = 0.46914; step 1; tol 0.000276626
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 6.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 6.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
3:  |F(x)| = 7.8622e-05; step 1; tol 2.5277e-08
4:  |F(x)| = 8.88924e-07; step 1; tol 0.000115049

==> Solving for nanoparticle diameter D= 12.0
--> rho= 0.7631797831142566 4.420970641441538e-07
0:  |F(x)| = 1381.16; step 1; tol 0.0562768
1:  |F(x)| = 84.4891; step 1; tol 0.0033679
2:  |F(x)| = 16.6235; step 1; tol 0.0348407
3:  |F(x)| = 0.507236; step 1; tol 0.00083795
4:  |F(x)| = 0.0100824; step 1; tol 0.000355591
5:  |F(x)| = 1.30405e-05; step 1; tol 1.50557e-06

==> Solving for nanoparticle diameter D= 12.5
--> rho= 0.7631797831142566 3.9113918814264206e-07
0:  |F(x)| = 1243.82; step 1; tol 0.0776648
1:  |F(x)| = 595.175; step 1; tol 0.20607
2:  |F(x)| = 13.4545; step 1; tol 0.000459925
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 6.75 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 6.75 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
3:  |F(x)| = 1.86278; step 1; tol 0.0172518
4:  |F(x)| = 0.0079935; step 1; tol 1.65727e-05
5:  |F(x)| = 1.46836e-05; step 1; tol 3.03692e-06

==> Solving for nanoparticle diameter D= 13.0
--> rho= 0.7631797831142566 3.4772131399230666e-07
0:  |F(x)| = 1411.41; step 1; tol 0.0319697
1:  |F(x)| = 1254.36; step 1; tol 0.710853
2:  |F(x)| = 655.034; step 1; tol 0.454781
3:  |F(x)| = 438.233; step 1; tol 0.402833
4:  |F(x)| = 91.4749; step 1; tol 0.146047
5:  |F(x)| = 18.8725; step 1; tol 0.0383089
6:  |F(x)| = 16.4094; step 1; tol 0.680402
7:  |F(x)| = 9.49042; step 1; tol 0.416652
8:  |F(x)| = 3.13953; step 1; tol 0.156239
9:  |F(x)| = 0.510996; step 1; tol 0.0238423
10:  |F(x)| = 0.372683; step 1; tol 0.478725
11:  |F(x)| = 0.0599878; step 1; tol 0.20626
12:  |F(x)| = 0.00299102; step 1; tol 0.00223747
13:  |F(x)| = 9.10151e-05; step 1; tol 0.000833355
14:  |F(x)| = 1.37508e-06; step 1; tol 0.000205434

==> Solving for nanoparticle diameter D= 13.5
--> rho= 0.7631797831142566 3.1049889827408335e-07
0:  |F(x)| = 783.486; step 1; tol 0.0173718
1:  |F(x)| = 26.3862; step 1; tol 0.00102078
2:  |F(x)| = 0.155281; step 1; tol 3.11693e-05
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 7.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 7.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
3:  |F(x)| = 1.5596e-05; step 1; tol 9.07881e-09

==> Solving for nanoparticle diameter D= 14.0
--> rho= 0.7631797831142566 2.784051482657062e-07
0:  |F(x)| = 3193.67; step 1; tol 0.0924518
1:  |F(x)| = 243.267; step 1; tol 0.0052219
2:  |F(x)| = 195.62; step 1; tol 0.581975
3:  |F(x)| = 88.044; step 1; tol 0.304825
4:  |F(x)| = 39.5622; step 1; tol 0.181721
5:  |F(x)| = 7.02791; step 1; tol 0.0284009
6:  |F(x)| = 0.293198; step 1; tol 0.00156644
7:  |F(x)| = 0.000767776; step 1; tol 6.17146e-06
8:  |F(x)| = 3.03427e-05; step 1; tol 0.00140567

==> Solving for nanoparticle diameter D= 14.5
--> rho= 0.7631797831142566 2.505863223063177e-07
0:  |F(x)| = 1216.2; step 1; tol 0.0244694
1:  |F(x)| = 64.0155; step 1; tol 0.00249347
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/PRISM.py:225: UserWarning: Pair correlations are negative (value = -1.00e+00) for particle-particle pair!
  warnings.warn(warnstr.format(val,t1,t2))
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 7.75 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 7.75 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
2:  |F(x)| = 1.09273; step 1; tol 0.000262239
3:  |F(x)| = 0.000607714; step 1; tol 2.78366e-07
4:  |F(x)| = 2.20878e-06; step 1; tol 1.18891e-05

==> Solving for nanoparticle diameter D= 15.0
--> rho= 0.7631797831142566 2.2635369684180673e-07
0:  |F(x)| = 5007.95; step 1; tol 0.132471
1:  |F(x)| = 546.895; step 1; tol 0.0107333
2:  |F(x)| = 355.407; step 0.481231; tol 0.380089
3:  |F(x)| = 137.061; step 1; tol 0.13385
4:  |F(x)| = 17.7858; step 1; tol 0.0151552
5:  |F(x)| = 0.708749; step 1; tol 0.00142916
6:  |F(x)| = 0.000705166; step 1; tol 8.90922e-07
7:  |F(x)| = 3.59783e-07; step 1; tol 2.34283e-07

==> Solving for nanoparticle diameter D= 15.5
--> rho= 0.7631797831142566 2.0514752155781216e-07
0:  |F(x)| = 1670.91; step 1; tol 0.0278465
1:  |F(x)| = 378.977; step 1; tol 0.0462983
2:  |F(x)| = 16.4635; step 1; tol 0.00169848
3:  |F(x)| = 1.77287; step 1; tol 0.0104365
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 8.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 8.25 is not a multiple of domain grid spacing dr = 0.1. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
4:  |F(x)| = 0.0164307; step 1; tol 7.73032e-05
5:  |F(x)| = 5.5953e-06; step 1; tol 1.04371e-07

==> Solving for nanoparticle diameter D= 16.0
--> rho= 0.7631797831142566 1.8650969893581487e-07
0:  |F(x)| = 4820.11; step 1; tol 0.0733899
1:  |F(x)| = 558.632; step 1; tol 0.0120887
2:  |F(x)| = 141.735; step 1; tol 0.0579356
3:  |F(x)| = 7.23757; step 1; tol 0.00234678
4:  |F(x)| = 0.216905; step 1; tol 0.000808348
5:  |F(x)| = 3.50759e-05; step 1; tol 2.35353e-08
6:  |F(x)| = 7.48092e-08; step 1; tol 4.09387e-06

Done!

Now that we have the D=16d solution as a guess, we can use it to solve the PRISM equations for three interaction widths. Note also that we have changed the domain characteristics (grid spacing and length of arrays), thus we need to use the interpolate_guess function (defined above) to convert the results using our prevous domain into the new domain.

[5]:
sys = pyPRISM.System(['particle','polymer'],kT=1.0)
sys.domain = pyPRISM.Domain(dr=0.075,length=2048)

sys.diameter['polymer'] = d
sys.diameter['particle'] = D
sys.density['polymer'] = (1-phi)*eta/sys.diameter.volume['polymer']
sys.density['particle'] = phi*eta/sys.diameter.volume['particle']

sys.omega['polymer','polymer'] = pyPRISM.omega.FreelyJointedChain(length=100,l=4.0*d/3.0)
sys.omega['polymer','particle'] = pyPRISM.omega.NoIntra()
sys.omega['particle','particle'] = pyPRISM.omega.SingleSite()

sys.closure['polymer','polymer'] = pyPRISM.closure.PercusYevick()
sys.closure['polymer','particle'] = pyPRISM.closure.PercusYevick()
sys.closure['particle','particle'] = pyPRISM.closure.HyperNettedChain()

gr_results = []
guess = interpolate_guess(pyPRISM.Domain(dr=0.1,length=1024),sys.domain,sys.rank,last_guess)
for alpha in [0.25,0.5,1.0]:
    print('==> Solving for alpha=',alpha)
    sys.potential['polymer','polymer'] = pyPRISM.potential.HardSphere()
    sys.potential['polymer','particle'] = pyPRISM.potential.Exponential(alpha=alpha,epsilon=1.0)
    sys.potential['particle','particle'] = pyPRISM.potential.HardSphere()

    PRISM = sys.createPRISM()
    result = PRISM.solve(guess)

    x = sys.domain.r
    y = pyPRISM.calculate.pair_correlation(PRISM)['particle','particle']
    gr_results.append([alpha,x,y])

print('Done!')

==> Solving for alpha= 0.25
0:  |F(x)| = 5662.39; step 1; tol 0.0366116
1:  |F(x)| = 506.876; step 1; tol 0.00721186
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:141: UserWarning: Diameter for site particle = 16.0 is not a multiple of domain grid spacing dr = 0.075. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:141: UserWarning: Diameter for site polymer = 1.0 is not a multiple of domain grid spacing dr = 0.075. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-particle = 16.0 is not a multiple of domain grid spacing dr = 0.075. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair particle-polymer = 8.5 is not a multiple of domain grid spacing dr = 0.075. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-particle = 8.5 is not a multiple of domain grid spacing dr = 0.075. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
/home/tbm/software/pyPRISM/dev/src/pyPRISM/core/System.py:150: UserWarning: Sigma for pair polymer-polymer = 1.0 is not a multiple of domain grid spacing dr = 0.075. Rounding will occur in closures, potentials, and omega!
  warnings.warn(warn_text)
2:  |F(x)| = 484.693; step 0.0482191; tol 0.822948
3:  |F(x)| = 386.994; step 1; tol 0.60952
4:  |F(x)| = 181.28; step 1; tol 0.334363
5:  |F(x)| = 57.4303; step 1; tol 0.100619
6:  |F(x)| = 57.4266; step 6.28341e-05; tol 0.899883
7:  |F(x)| = 55.3488; step 1; tol 0.83605
8:  |F(x)| = 55.3217; step 1; tol 0.899118
9:  |F(x)| = 54.9051; step 0.0341534; tol 0.886497
10:  |F(x)| = 54.9045; step 1; tol 0.899981
11:  |F(x)| = 54.2824; step 0.0629851; tol 0.879722
12:  |F(x)| = 54.0923; step 0.00546448; tol 0.893705
13:  |F(x)| = 53.8822; step 0.00653873; tol 0.893024
14:  |F(x)| = 53.6781; step 0.0063891; tol 0.893192
15:  |F(x)| = 53.4702; step 0.00660002; tol 0.893042
16:  |F(x)| = 53.2445; step 0.00737255; tol 0.89242
17:  |F(x)| = 53.028; step 0.00714387; tol 0.892695
18:  |F(x)| = 52.7721; step 0.00869284; tol 0.891335
19:  |F(x)| = 52.4261; step 0.0123779; tol 0.888237
20:  |F(x)| = 51.9933; step 0.0181704; tol 0.885204
21:  |F(x)| = 48.7829; step 0.223636; tol 0.792286
22:  |F(x)| = 48.225; step 0.0311114; tol 0.879531
23:  |F(x)| = 46.8732; step 0.145401; tol 0.850254
24:  |F(x)| = 46.2001; step 0.0447723; tol 0.874337
25:  |F(x)| = 45.4206; step 0.0593008; tol 0.869887
26:  |F(x)| = 44.3289; step 0.101496; tol 0.857255
27:  |F(x)| = 42.7629; step 0.169827; tol 0.837535
28:  |F(x)| = 39.5406; step 0.18508; tol 0.769475
29:  |F(x)| = 39.1283; step 0.0207502; tol 0.881328
30:  |F(x)| = 37.6503; step 0.244255; tol 0.833291
31:  |F(x)| = 37.076; step 0.0283116; tol 0.872756
32:  |F(x)| = 34.9091; step 0.421424; tol 0.797871
33:  |F(x)| = 33.7516; step 0.119877; tol 0.841309
34:  |F(x)| = 32.3594; step 0.20191; tol 0.827282
35:  |F(x)| = 29.8944; step 0.216001; tol 0.768105
36:  |F(x)| = 27.571; step 0.256759; tol 0.765544
37:  |F(x)| = 27.2736; step 0.0158169; tol 0.880689
38:  |F(x)| = 26.9287; step 0.0191221; tol 0.877379
39:  |F(x)| = 26.5379; step 0.0223223; tol 0.874069
40:  |F(x)| = 26.0869; step 0.0268403; tol 0.86967
41:  |F(x)| = 25.2816; step 0.0612396; tol 0.845287
42:  |F(x)| = 23.7826; step 0.171257; tol 0.796441
43:  |F(x)| = 21.8223; step 0.280001; tol 0.757744
44:  |F(x)| = 21.2037; step 0.0651854; tol 0.849699
45:  |F(x)| = 19.4407; step 1; tol 0.756562
46:  |F(x)| = 19.0303; step 0.058792; tol 0.862404
47:  |F(x)| = 17.6025; step 0.413611; tol 0.770011
48:  |F(x)| = 17.4875; step 0.0129598; tol 0.888285
49:  |F(x)| = 15.9301; step 1; tol 0.74683
50:  |F(x)| = 15.7945; step 0.0136197; tol 0.884747
51:  |F(x)| = 15.197; step 0.239605; tol 0.833196
52:  |F(x)| = 14.2615; step 0.382576; tol 0.792602
53:  |F(x)| = 13.8855; step 0.123451; tol 0.853175
54:  |F(x)| = 13.2629; step 0.0746045; tol 0.821092
55:  |F(x)| = 13.0066; step 0.0465958; tol 0.865558
56:  |F(x)| = 11.4684; step 0.356923; tol 0.699713
57:  |F(x)| = 9.90548; step 1; tol 0.67141
58:  |F(x)| = 8.39992; step 0.286561; tol 0.647206
59:  |F(x)| = 7.99417; step 0.0713259; tol 0.815153
60:  |F(x)| = 6.71961; step 1; tol 0.635892
61:  |F(x)| = 6.56528; step 0.0403031; tol 0.859135
62:  |F(x)| = 5.78488; step 1; tol 0.698756
63:  |F(x)| = 5.6753; step 0.0449467; tol 0.866227
64:  |F(x)| = 5.38428; step 0.259107; tol 0.810063
65:  |F(x)| = 4.99153; step 0.282899; tol 0.773492
66:  |F(x)| = 4.54696; step 0.293414; tol 0.746822
67:  |F(x)| = 4.35788; step 0.144591; tol 0.826703
68:  |F(x)| = 115.882; step 1; tol 0.9999
69:  |F(x)| = 111.255; step 1; tol 0.89982
70:  |F(x)| = 5.38899; step 1; tol 0.728708
71:  |F(x)| = 4.28912; step 1; tol 0.570117
72:  |F(x)| = 4.25354; step 0.0107603; tol 0.885131
73:  |F(x)| = 3.74899; step 1; tol 0.705112
74:  |F(x)| = 3.64651; step 0.0369959; tol 0.851471
75:  |F(x)| = 3.49717; step 0.308434; tol 0.82779
76:  |F(x)| = 3.47186; step 0.0175346; tol 0.887022
77:  |F(x)| = 3.10644; step 0.452557; tol 0.720516
78:  |F(x)| = 2.70975; step 0.180118; tol 0.684819
79:  |F(x)| = 2.69391; step 1; tol 0.889504
80:  |F(x)| = 2.09303; step 1; tol 0.712095
81:  |F(x)| = 1.57302; step 1; tol 0.508347
82:  |F(x)| = 1.29932; step 1; tol 0.614057
83:  |F(x)| = 0.734189; step 1; tol 0.33936
84:  |F(x)| = 0.154052; step 1; tol 0.103648
85:  |F(x)| = 0.0124538; step 1; tol 0.00588186
86:  |F(x)| = 0.000443185; step 1; tol 0.00113974
87:  |F(x)| = 2.86368e-05; step 1; tol 0.0037577
==> Solving for alpha= 0.5
0:  |F(x)| = 6746.45; step 1; tol 0.183588
1:  |F(x)| = 899.268; step 1; tol 0.0159908
2:  |F(x)| = 883.065; step 0.0182703; tol 0.86786
3:  |F(x)| = 866.116; step 0.0196403; tol 0.865783
4:  |F(x)| = 848.79; step 0.0205053; tol 0.864353
5:  |F(x)| = 830.828; step 0.0218293; tol 0.862312
6:  |F(x)| = 811.965; step 0.0236937; tol 0.859597
7:  |F(x)| = 791.936; step 0.0261192; tol 0.856148
8:  |F(x)| = 770.518; step 0.029187; tol 0.851977
9:  |F(x)| = 747.724; step 0.0324992; tol 0.847537
10:  |F(x)| = 722.348; step 0.0386579; tol 0.839951
11:  |F(x)| = 685.311; step 0.0675702; tol 0.810074
12:  |F(x)| = 622.59; step 0.176722; tol 0.7428
13:  |F(x)| = 545.469; step 0.356716; tol 0.690842
14:  |F(x)| = 419.857; step 0.463427; tol 0.533219
15:  |F(x)| = 364.86; step 1; tol 0.679659
16:  |F(x)| = 162.208; step 1; tol 0.415743
17:  |F(x)| = 118.493; step 1; tol 0.480267
18:  |F(x)| = 43.0135; step 1; tol 0.207591
19:  |F(x)| = 42.4792; step 0.0127218; tol 0.87778
20:  |F(x)| = 34.6238; step 1; tol 0.693449
21:  |F(x)| = 18.1081; step 1; tol 0.432784
22:  |F(x)| = 18.096; step 0.00148958; tol 0.898802
23:  |F(x)| = 16.7957; step 1; tol 0.77531
24:  |F(x)| = 16.7661; step 0.00236339; tol 0.896826
25:  |F(x)| = 14.6038; step 1; tol 0.723867
26:  |F(x)| = 14.5857; step 0.00234181; tol 0.89777
27:  |F(x)| = 14.5659; step 0.00268224; tol 0.897558
28:  |F(x)| = 14.5451; step 0.00291978; tol 0.897434
29:  |F(x)| = 14.5226; step 0.0033461; tol 0.897211
30:  |F(x)| = 14.4924; step 0.00501023; tol 0.896268
31:  |F(x)| = 14.4244; step 0.0150729; tol 0.891573
32:  |F(x)| = 14.3701; step 0.0156674; tol 0.893232
33:  |F(x)| = 14.3295; step 0.00941524; tol 0.89492
34:  |F(x)| = 14.2789; step 0.0137285; tol 0.893656
35:  |F(x)| = 14.2088; step 0.0237725; tol 0.891192
36:  |F(x)| = 14.1776; step 0.00347429; tol 0.896049
37:  |F(x)| = 14.1468; step 0.00338865; tol 0.896086
38:  |F(x)| = 14.1154; step 0.00345969; tol 0.896019
39:  |F(x)| = 14.0828; step 0.00362123; tol 0.895848
40:  |F(x)| = 14.0497; step 0.0037036; tol 0.895763
41:  |F(x)| = 14.0159; step 0.0037831; tol 0.895676
42:  |F(x)| = 13.9763; step 0.0045277; tol 0.894933
43:  |F(x)| = 13.936; step 0.0046499; tol 0.894809
44:  |F(x)| = 13.8757; step 0.00739434; tol 0.892228
45:  |F(x)| = 13.6452; step 0.038678; tol 0.87035
46:  |F(x)| = 13.3834; step 0.0828193; tol 0.865797
47:  |F(x)| = 13.0434; step 0.10834; tol 0.854847
48:  |F(x)| = 12.5624; step 0.12922; tol 0.834849
49:  |F(x)| = 12.3856; step 0.0349655; tol 0.874842
50:  |F(x)| = 11.98; step 0.110287; tol 0.842021
51:  |F(x)| = 11.4691; step 0.178552; tol 0.824871
52:  |F(x)| = 11.1469; step 0.103842; tol 0.850144
53:  |F(x)| = 10.8327; step 0.113741; tol 0.849987
54:  |F(x)| = 10.5114; step 0.143656; tol 0.847405
55:  |F(x)| = 10.4234; step 0.0233655; tol 0.884981
56:  |F(x)| = 10.0591; step 0.27104; tol 0.83819
57:  |F(x)| = 9.93552; step 0.0421546; tol 0.878025
58:  |F(x)| = 9.8003; step 0.0503998; tol 0.87567
59:  |F(x)| = 9.65847; step 0.0582761; tol 0.874138
60:  |F(x)| = 9.51607; step 0.0717795; tol 0.873658
61:  |F(x)| = 9.30839; step 0.126937; tol 0.861146
62:  |F(x)| = 9.14466; step 0.088775; tol 0.868617
63:  |F(x)| = 9.07084; step 0.0175895; tol 0.885528
64:  |F(x)| = 8.88409; step 0.116758; tol 0.863323
65:  |F(x)| = 8.82598; step 0.0183666; tol 0.888265
66:  |F(x)| = 8.64064; step 0.138253; tol 0.862598
67:  |F(x)| = 8.56059; step 0.0184698; tol 0.8834
68:  |F(x)| = 8.34404; step 0.179322; tol 0.855043
69:  |F(x)| = 8.1986; step 0.0798705; tol 0.868898
70:  |F(x)| = 8.01219; step 0.129745; tol 0.85954
71:  |F(x)| = 7.77286; step 0.151839; tol 0.847035
72:  |F(x)| = 7.49663; step 0.211838; tol 0.83717
73:  |F(x)| = 7.33552; step 0.143322; tol 0.861731
74:  |F(x)| = 7.11758; step 0.202731; tol 0.847318
75:  |F(x)| = 6.92584; step 0.0841314; tol 0.852163
76:  |F(x)| = 6.66849; step 0.148919; tol 0.834358
77:  |F(x)| = 6.49641; step 0.0936889; tol 0.854148
78:  |F(x)| = 6.27982; step 0.173879; tol 0.840989
79:  |F(x)| = 6.21005; step 0.104383; tol 0.880113
80:  |F(x)| = 5.95206; step 0.311442; tol 0.826774
81:  |F(x)| = 5.84771; step 0.0658969; tol 0.86872
82:  |F(x)| = 5.52592; step 0.386533; tol 0.803673
83:  |F(x)| = 5.4901; step 0.0306027; tol 0.888372
84:  |F(x)| = 5.32078; step 0.0924585; tol 0.84534
85:  |F(x)| = 5.11388; step 1; tol 0.831368
86:  |F(x)| = 4.91527; step 0.233652; tol 0.831451
87:  |F(x)| = 3.94431; step 1; tol 0.62218
88:  |F(x)| = 2.71733; step 1; tol 0.427155
89:  |F(x)| = 1.00216; step 1; tol 0.164215
90:  |F(x)| = 0.163451; step 1; tol 0.0239411
91:  |F(x)| = 0.00369448; step 1; tol 0.000459807
92:  |F(x)| = 1.58342e-05; step 1; tol 1.65322e-05
==> Solving for alpha= 1.0
0:  |F(x)| = 8084.63; step 1; tol 0.342037
1:  |F(x)| = 2811.99; step 1; tol 0.10888
2:  |F(x)| = 2679.33; step 0.0540234; tol 0.817087
3:  |F(x)| = 2457.27; step 0.145064; tol 0.757
4:  |F(x)| = 2229.62; step 0.293304; tol 0.740964
5:  |F(x)| = 1401.84; step 1; tol 0.494125
6:  |F(x)| = 635.165; step 1; tol 0.219744
7:  |F(x)| = 561.901; step 0.120546; tol 0.704352
8:  |F(x)| = 493.256; step 1; tol 0.693534
9:  |F(x)| = 371.347; step 1; tol 0.510102
10:  |F(x)| = 332.655; step 0.143602; tol 0.722223
11:  |F(x)| = 237.016; step 1; tol 0.469445
12:  |F(x)| = 233.74; step 0.0196123; tol 0.875297
13:  |F(x)| = 219.77; step 0.20992; tol 0.795634
14:  |F(x)| = 212.642; step 0.0406852; tol 0.842559
15:  |F(x)| = 202.983; step 0.0678949; tol 0.820095
16:  |F(x)| = 186.052; step 0.20501; tol 0.756122
17:  |F(x)| = 178.744; step 0.0933333; tol 0.830689
18:  |F(x)| = 170.871; step 0.167445; tol 0.822458
19:  |F(x)| = 145.236; step 1; tol 0.650218
20:  |F(x)| = 95.3081; step 1; tol 0.387571
21:  |F(x)| = 43.572; step 1; tol 0.188104
22:  |F(x)| = 36.1231; step 0.269139; tol 0.618582
23:  |F(x)| = 21.8998; step 1; tol 0.34438
24:  |F(x)| = 19.9895; step 0.139459; tol 0.749839
25:  |F(x)| = 19.9724; step 0.00474796; tol 0.898454
26:  |F(x)| = 17.4563; step 1; tol 0.726497
27:  |F(x)| = 14.1098; step 1; tol 0.588002
28:  |F(x)| = 7.53609; step 1; tol 0.311172
29:  |F(x)| = 1.31187; step 1; tol 0.027273
30:  |F(x)| = 0.0283652; step 1; tol 0.000420758
31:  |F(x)| = 9.136e-05; step 1; tol 9.33644e-06
32:  |F(x)| = 2.04046e-07; step 1; tol 4.48937e-06
Done!

Here we reproduce Figure 1 from Reference 1.

[6]:
%%opts Overlay [legend_position='top_right']

extents = (16,0.0,24,4.0)

gr_plots = []
for alpha,x,y in gr_results:
    label = 'alpha={} (pyPRISM)'.format(alpha)
    style = {'line_dash':ls[alpha],'color':colors[alpha]}
    c1 = hv.Curve((x,y),label=label,extents=extents)(style=style)
    gr_plots.append(c1)

for alpha,x,y in gr_compare:
    label = 'alpha={} (Ref 1)'.format(alpha)
    style = {'marker':markers[alpha],'color':colors[alpha]}
    c1 = hv.Scatter((x,y),label=label,extents=extents)(style=style)
    gr_plots.append(c1)


hv.Overlay(gr_plots).redim.label(x='r',y='g(r)')
[6]:

Polymer Grafted Particle Nanocomposite

image0

In this example, we use pyPRISM to study a polymer nanocomposite system in which polymer chains of varying length \(N_{matrix} = 10, 60\) are mixed with a nanoparticle permanently grafted with polymer chains. The grafted chains are of length \(N_{graft}=20\) and are of either linear or comb polymer architecture with side chain length \(N_{sc} = 3\). All interactions in this system are modeled as athermal (hard-sphere). We plot the particle-particle potential of mean force as a function of the length of the matrix chains and the grafted chain architecture. The details of this system are described in Ref. 5.

As always, we define the aesthetics first

[7]:
%opts Curve Scatter [width=500,height=400] Layout [shared_axes=False] Scatter (size=10,alpha=0.5)
%opts Curve Scatter [fontsize={'xlabel':14,'xlabel':14,'ylabel':14,'ticks':12}]
%opts Overlay [legend_position='bottom_left']
%opts Layout [shared_axes=False]


colors = {}
colors['linear',10] = 'blue'
colors['linear',60] = 'red'
colors['comb',10] = 'green'
colors['comb',60] = 'magenta'

ls = {}
ls['linear',10] = 'solid'
ls['linear',60] = 'dashed'
ls['comb',10] = 'dotted'
ls['comb',60] = 'dashdot'


markers = {}
markers['linear',10] = 'o'
markers['linear',60] = '^'
markers['comb',10] = 'd'
markers['comb',60] = 's'

Next, we load the data from the literature.

[8]:
PMF_compare = []
for arch in ['linear','comb']:
    for Nmatrix in [10,60]:
        fname = '../data/GraftedComposite-Gr-{}-Nmatrix{}-PP.dat'.format(arch,Nmatrix)
        x,y = np.loadtxt(fname).T
        y = -np.log(y)
        PMF_compare.append([arch,Nmatrix,x,y])
/home/tbm/software/anaconda3/4.4.0/envs/pyPRISM_py3_dev/lib/python3.5/site-packages/ipykernel_launcher.py:6: RuntimeWarning: divide by zero encountered in log

Finally, we conduct the calculation. Unlike the bare-composite case, we can directly solve for the results but we still use loops to quickly scan a small parameter space and gather the results.

Note that this calculation is considerably more complicated than the previous if only for the fact that we have three components for the first time. This results in a significantly longer script for the calculation.

[9]:
import pyPRISM
from pyPRISM.calculate.pair_correlation import pair_correlation
from pyPRISM.calculate.pmf import pmf
import numpy as np

D = 5.0 #grafted nanoparticle diameter
d = 1.0 #polymer segement diameter
phi = 0.001 #grafted particle volume fraction
eta = 0.35 #total occupied volume fraction
vd = 4.0/3.0 * np.pi * (d/2.0)**(3) #volume of one polymer segement
vD = 4.0/3.0 * np.pi * (D/2.0)**(3) #volume of one nanoparticle

sys = pyPRISM.System(['particle','graft','matrix'],kT=1.0)
sys.domain = pyPRISM.Domain(dr=0.1,length=1024)

sys.diameter['particle'] = D
sys.diameter['graft']    = d
sys.diameter['matrix']   = d

sys.omega['particle','matrix']  = pyPRISM.omega.InterMolecular()
sys.omega['graft','matrix']     = pyPRISM.omega.InterMolecular()
sys.omega['particle','particle'] = pyPRISM.omega.SingleSite()

sys.closure[sys.types,sys.types]   = pyPRISM.closure.PercusYevick()
sys.closure['particle','particle'] = pyPRISM.closure.HyperNettedChain()

sys.potential[sys.types,sys.types]   = pyPRISM.potential.HardSphere()
sys.potential['particle',sys.types]  = pyPRISM.potential.HardSphere()
sys.potential['particle','particle'] = pyPRISM.potential.HardSphere()

guess = np.zeros((sys.domain.length,sys.rank,sys.rank))
PMF_results = []
for Nmatrix in [60,10]:
    sys.omega['matrix','matrix']   = pyPRISM.omega.FromFile('../data/GraftedComposite-Omega-matrix-N{}.dat'.format(Nmatrix))
    sys.omega['graft','graft']     = pyPRISM.omega.FromFile('../data/GraftedComposite-Omega-linear-GG.dat')
    sys.omega['graft','particle']  = pyPRISM.omega.FromFile('../data/GraftedComposite-Omega-linear-GP.dat')

    numGraftBeads = 500
    vPGP = vD + numGraftBeads*vd
    sys.density['matrix']   = (1-phi)*eta/vd
    sys.density['particle'] = phi*eta/vPGP
    sys.density['graft']    = numGraftBeads * phi*eta/vPGP
    print('--> rho=',sys.density['graft'],sys.density['particle'],sys.density['matrix'])
    PRISM = sys.createPRISM()
    PRISM.solve(guess)
    guess = np.copy(PRISM.x)
    PMF_results.append(['linear',Nmatrix,sys.domain.r,pmf(PRISM)['particle','particle']])

    numGraftBeads = 1250
    vPGP = vD + numGraftBeads*vd
    sys.density['matrix']  = (1-phi)*eta/vd
    sys.density['particle'] = phi*eta/vPGP
    sys.density['graft']    = numGraftBeads * phi*eta/vPGP
    print('--> rho=',sys.density['graft'],sys.density['particle'],sys.density['matrix'])
    sys.omega['matrix','matrix']   = pyPRISM.omega.FromFile('../data/GraftedComposite-Omega-matrix-N{}.dat'.format(Nmatrix))
    sys.omega['graft','graft']     = pyPRISM.omega.FromFile('../data/GraftedComposite-Omega-comb-GG.dat')
    sys.omega['graft','particle']  = pyPRISM.omega.FromFile('../data/GraftedComposite-Omega-comb-GP.dat')
    PRISM = sys.createPRISM()
    result = PRISM.solve(guess)
    PMF_results.append(['comb',Nmatrix,sys.domain.r,pmf(PRISM)['particle','particle']])

print('Done!')
--> rho= 0.0005347606087887683 1.0695212175775368e-06 0.6677823102249745
0:  |F(x)| = 125.67; step 0.0222735; tol 0.853672
1:  |F(x)| = 110.033; step 1; tol 0.689955
2:  |F(x)| = 98.7161; step 0.360292; tol 0.724395
3:  |F(x)| = 96.916; step 0.0346837; tol 0.867475
4:  |F(x)| = 77.7223; step 1; tol 0.677262
5:  |F(x)| = 52.3436; step 1; tol 0.412816
6:  |F(x)| = 52.2497; step 0.00201374; tol 0.896772
7:  |F(x)| = 45.2768; step 1; tol 0.723781
8:  |F(x)| = 42.7455; step 0.0847881; tol 0.80218
9:  |F(x)| = 37.6435; step 0.200722; tol 0.697978
10:  |F(x)| = 32.0038; step 1; tol 0.650526
11:  |F(x)| = 25.3211; step 0.309525; tol 0.563386
12:  |F(x)| = 21.2678; step 0.353001; tol 0.634926
13:  |F(x)| = 17.046; step 0.420115; tol 0.578152
14:  |F(x)| = 10.0361; step 1; tol 0.311978
15:  |F(x)| = 9.52045; step 0.0566309; tol 0.809896
16:  |F(x)| = 6.99251; step 1; tol 0.590338
17:  |F(x)| = 3.87908; step 1; tol 0.313649
18:  |F(x)| = 3.59957; step 0.091973; tol 0.774974
19:  |F(x)| = 3.16073; step 0.265407; tol 0.693929
20:  |F(x)| = 2.73033; step 1; tol 0.67158
21:  |F(x)| = 1.39749; step 1; tol 0.405918
22:  |F(x)| = 0.815644; step 1; tol 0.306583
23:  |F(x)| = 0.191751; step 1; tol 0.0497412
24:  |F(x)| = 0.138158; step 1; tol 0.467215
25:  |F(x)| = 0.0047945; step 1; tol 0.196461
26:  |F(x)| = 0.000179072; step 1; tol 0.00125548
27:  |F(x)| = 2.33742e-06; step 1; tol 0.000153342
--> rho= 0.0006076825099872368 4.861460079897895e-07 0.6677823102249745
0:  |F(x)| = 47.2842; step 1; tol 0.255559
1:  |F(x)| = 6.39546; step 1; tol 0.0164647
2:  |F(x)| = 0.600451; step 1; tol 0.00793331
3:  |F(x)| = 0.0275196; step 1; tol 0.00189048
4:  |F(x)| = 0.00369618; step 1; tol 0.0162354
5:  |F(x)| = 3.65937e-06; step 1; tol 8.82164e-07
--> rho= 0.0005347606087887683 1.0695212175775368e-06 0.6677823102249745
0:  |F(x)| = 24.4749; step 1; tol 0.00231931
1:  |F(x)| = 0.34516; step 1; tol 0.000178995
2:  |F(x)| = 0.202216; step 1; tol 0.308911
3:  |F(x)| = 0.0112913; step 1; tol 0.00280606
4:  |F(x)| = 5.59149e-05; step 1; tol 2.20705e-05
--> rho= 0.0006076825099872368 4.861460079897895e-07 0.6677823102249745
0:  |F(x)| = 39.6577; step 1; tol 0.0980329
1:  |F(x)| = 1.07302; step 1; tol 0.000658876
2:  |F(x)| = 0.609651; step 1; tol 0.290528
3:  |F(x)| = 0.0416829; step 1; tol 0.00420723
4:  |F(x)| = 0.0108212; step 1; tol 0.0606569
5:  |F(x)| = 0.00213452; step 1; tol 0.0350178
6:  |F(x)| = 2.32349e-05; step 1; tol 0.000106641
Done!

Finally, plotting the results

[10]:
%%opts Overlay [legend_position='top_right']
from math import sqrt

extents = (10,-0.2,40,0.2)
gr_plots = []
for arch,Nmatrix,x,y in PMF_results:
    key = (arch,Nmatrix)
    label = 'alpha={} (pyPRISM)'.format(key)
    style = {'line_dash':ls[key],'color':colors[key]}
    c1 = hv.Curve((x,y),label=label,extents=extents)(style=style)
    gr_plots.append(c1)

step = 10
for arch,Nmatrix,x,y in PMF_compare:
    x = x[::step]
    y = y[::step]
    key = (arch,Nmatrix)
    label = 'alpha={} (Ref 1)'.format(key)
    style = {'marker':markers[key],'color':colors[key]}
    c1 = hv.Scatter((x,y),label=label,extents=extents)(style=style)
    gr_plots.append(c1)


hv.Overlay(gr_plots).redim.label(x='r',y='W(r)')
[10]:

Summary

This notebook has covered two examples of nanocomposite systems which are significantly more complex than examples in previous notebooks. We also discuss the strategies we use to converge the PRISM equations for these systems, as we cannot directly solve for the answer.

image0

NB0.Introduction \(\cdot\) NB1.PythonBasics \(\cdot\) NB2.Theory.General \(\cdot\) NB3.Theory.PRISM \(\cdot\) NB4.pyPRISM.Overview \(\cdot\) NB5.CaseStudies.PolymerMelts \(\cdot\) NB6.CaseStudies.Nanocomposites \(\cdot\) NB7.CaseStudies.Copolymers \(\cdot\) NB8.pyPRISM.Internals \(\cdot\) NB9.pyPRISM.Advanced

[ ]: