+ All Categories
Home > Documents > Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be...

Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be...

Date post: 28-Aug-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
22
Polymer Adsorption a random walk approach Project for MIT class 18.366, May 2005 “Random Walks and Diffusion” By: Ernst A. van Nierop Supervisor: Prof. M.Z. Bazant
Transcript
Page 1: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

Polymer Adsorptiona random walk approach

Project for MIT class 18.366, May 2005 “Random Walks and Diffusion” By: Ernst A. van Nierop Supervisor: Prof. M.Z. Bazant

Page 2: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

1 Abstract

Polymer adsorption to a planar surface is modeled as a random walk. For sim­ulation purposes, the random walk is a Rayleigh isotropic flight, or a Rayleigh flight with persistence between steps (= monomers). In order to compare the results of the simulations with theory, the random walk is modeled as a non­separable continuous time random walk (NS-CTRW), with a Smirnov waiting time distribution and planar diffusion (Gaussian distribution) for the conditional step-size distribution. The result of these assumptions shows sub-diffusion char­acteristics (with cusps near the origin) for the overall probability distribution function. Good qualitative agreement is found between the analytic model and the simulation.

Simulations are repeated for persistent random walks of varying degrees of per­sistency. As expected, in all cases the radius Rs of the adsorbed polymer with N monomers scales as Rs ∼

√N ; and the effective monomer length is increased

by persistency.

Cover picture: Sketch of polymer adsorption. We are interested in the PDF of lsep, and of the overall ‘size’ of the adsorbed area by a polymer of length N ­monomers. Picture taken from paper by B. O’Shaughnessy and D. Vavylonis, [1]

2

Page 3: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

2 Introduction

Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit­ting’ the solid surface. Each step of the random walk represents a monomer in the polymer, and each time the walker hits the surface this hit-location is noted as an adsorption site. This model follows somewhat intuitively from the general approach of modeling polymers as random walks; typically persistent and self-avoiding walks. Although this adsorption model ‘throws out’ a lot of physics and chemistry involved in real adsorption processes, reasonable results have been obtained (e.g. cf. [1]) by such approaches.

In this short study, some of the basic theory involved in describing (non)-persistent random walks is reviewed, and we investigate what sort of statistics one may expect the distribution of adsorption sites to obey. Also, statistics are generated using Matlab simulations, and compared to the theory.

3 Non-persistent polymer adsorption

3.1 Theory

As we studied in the fourth problem set for this class (see also the book by Redner [2]), the eventual probability of a random walker hitting the z = 0 surface at some point rs = (xs, ys, 0) originally released at some point (0, 0, a) is equivalent (mathematically) to the electric field at rs caused by a point charge of strength q = 1/4πD at (0, 0, a). Note that the precise value of the diffusivity D is irrelevant in this problem as it should be. After all, we are looking for the eventual hitting probability, not caring (at least, at first) about the time it takes to get there. Working this problem through, one can show that the eventual hitting probability is

a P (x, y) =

2π(x2 + y2 + a2)3/2 . (1)

Upon hitting z = 0, the walker is placed at r� = (xs, ys, a), and the walk s restarts. If we label the number of adsorption sites as Ns, then it can be shown (see solution to qu.2 on Pset 4, 2005, [3]) by smart integral manipulation that the eventual hitting probability after visiting Ns-sites is

Nsa PNs (x, y) =

2π(x2 + y2 + N2a2)3/2 , (2)

s

which is a two dimensional Cauchy distribution with both infinite mean and second moment. It can be shown that the half-width Rs of PNs (x, y) (i.e. the value of (x, y) where PNs (x, y) = 0.5) scales as Rs ∼ Ns where Rs =

�x2 + y2

(see for instance the solution to qu.2 on problem set 1, 2005, [4]). We proceed to determine the scaling of Ns with N , the number of monomers in the polymer.

3

Page 4: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

One can determine how the number of adsorption sites Ns will grow with the number of monomers involved N using scaling arguments. In order to do this, we should recognize that the ‘waiting time’ between adsorption events is just equivalent to the return time to the plane once we already hit it. This re­turn time has a certain probability distribution associated with it, namely the Smirnov density (see lecture 16 [5]),

a aψ(t) =

�, (3)

4D⊥t√

4πD⊥t3 exp

� − 2

where D⊥ is the diffusivity perpendicular to the plane (= 1 D = a2/6) and t is3 essentially equivalent to N . From Hughes [6], we know that the number of steps taken in time t is related to the waiting time probability ψ(t) by

˜ ψ̃(s) �Ns� = s(1 − ψ̃(s))

, (4)

where f̃(s) is the Laplace transform of f(t). In this case

s 2ψ̃(s) = exp�−a

� �, and since D⊥ = a /6

D

= exp�−√

6s� ⊥

(5)≈ 1 −√

6s + O(s)

where we have expanded for large t, i.e. for small s. Hence, eq.(4) reduces to

˜�Ns� ∼ 1

s3/2

Ns ∼ √

t = N1/2 (6)⇒ � � From our previous result (the two-dimensional Cauchy distribution), we know that Rs ∼ Ns, and hence we obtain a result to be tested by simulation, namely that Rs ∼

√N . Let us now proceed to find the probability distribution func­

tion of the adsorption sites after a certain time t. In order to do that, we need to recognize that this is a non-separable continuous time random walk, or NS­CTRW.

As shown during lectures, and in Hughes [6], the probability distribution P (r, t) of finding a walker at position r at time t can be shown to depend on the probability distribution of step-sizes p(r) and the distribution of the waiting time ψ(t). However, in the case of a non-separable walk, we must be concerned with the fact that where the walker is now, is conditional on it having been within stepping distance at the previous (random) time step. Let us call χ(r r�, t) the |probability distribution that the walker steps a distance r that takes time t given that it was at r� at time t�. If steps in time and space are separable, and steps

4

Page 5: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

in space were distributed as p(r r�), then χ = p(r r�)ψ(t). For non-separable | |walks, ψ is a function of time and space and related to χ as

ψ(r�, t) = χ(r r�, t)dr and space

|

p(r r�) = χ(r r�, t)dt, so that |time

|χ(r r� t) = p(r r�)ψ(t r, r�) (7)| | | |

where ψ(t r, r�) is the waiting time distribution conditional to the walker step­|ping from r� to r. Following through with the analysis as is done for instance in Hughes one obtains the Scher-Lax expression for P (r, t) in terms of Fourier and Laplace transforms of χ and ψ; which is very similar to the Montroll-Weiss model. The central result is

˜ ψ̃(s)P̂ (k, s) =

1 − ˜ (8)ˆs(1 − χ(k, s))

where f̂(k) is the Fourier transform of f(r).

For the specific case at hand, let us again use the Smirnov distribution for the waiting times, and for p(r, t) let us assume that the walker undergoes ordinary diffusion in the plane parallel to z = 0. Note that it does so with diffusivity D = 2 D = a2/3. Hence p(r, t) will be a Gaussian distribution, and the conditional 3 probability χ(r, t) can be found by

21 /4D� t p(r, t) = �4πD t

e−r

χ(r, t) = p(r, t) ψ(t)

χ̂(k, t) = e−D� k2 t ψ(t)⇒

χ̃(k, s) = � ∞

e−st e−D� k2 t �

2

1

πt3 e−3/2t dt ⇒

0 3

= e−√

6(D� k2 +s) (9)

ˆwhere we expanded for small s in the last step. Hence, P̃ (k, s) becomes

˜ 1 − e−√

6s

P̂ (k, s) = s�1 − e−

√6(D k2 +s)

√6s≈

s�

6(D k2 + s)1 ≈ √

s�

D�k2 + s (10)

This expression has an exact inverse Fourier transformation, and quite mirac­ulously it is also possible to get the inverse Laplace transform of P̃ (r, s). Note

5

Page 6: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

� ��

for the record that the other way around (Laplace inversion before Fourier in­version) seems to be much more challenging although the same result should clearly hold. Carrying on, we find

˜ s P̂ (r, s) =

π�1

D�sK0

�r � �

D

2 ⇒ P (r, t) = π�

21

πD te−r /8D t K0

� r2 � (11)

8D t

where K0 is the modified Bessel function of the second kind.

Figure 1: Probability distribution of finding the walker at r after time t. This is a plot of eq.(11), with D = 1/3. Note that there is a scaling factor missing, since the total area below the curve should always be 1 exactly, of course. Note the qualitative features of this distribution: a cusp-like shape near r = 0 reminiscent of sub-diffusion.

An example of what the distribution P (r, t) should look like for various values of time, is shown in fig.1. Note that it is characterized by a cusp-like peak in the middle (owing to the infinity of the Bessel function there), representing a typical characteristic of sub-diffusion.

3.2 Simulation

In order to compare with theory, we place a random walker at (0, 0, a), and allow it to undergo an isotropic Rayleigh flight with fixed step size a (see fig.2). Note that a corresponds physically to the length of one monomer. Each time

6

Page 7: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

−10

12

−6−4

−20

−2

−1

0

1

2

3

4

xy

z

the walker crosses the z = 0 plane, for instance at rn = (xn, yn, 0), it is restarted from (xn, yn, a). This process is repeated for polymers of lengths N = 10 up to N = 104, and for each polymer chain length the process is repeated M times, typically M = 103 gave good results1 .

Figure 2: A non-persistent random walk generated by the code in Appendix A.

Figure 3 shows four 3-D histograms which were made for polymer lengths of N = 10, 100, 1000 and 10.000. As expected, the histograms are smoother for larger polymers, simply because longer polymers will have more adsorption sites. Notice also the extent of some of the random walks: the limits of the histogram axes represent the furthest walk that resulted in the simulations. In order to compare these typical results with our theoretical result, figure 4 shows a slice out of the histogram for N = 104 with Yn < 1. Superposed upon the | |histogram is the theoretical result, for two different ‘times’ t. The diffusivity was chosen to be a fixed parameter, D = 1/3. The two values of ‘time’ were chosen by (a) matching the variance of the normalized data with the variance of the theoretical curve (this yields t = 22) and (b) by matching the curves qualitatively (yielding t = 120). The general shape of the distributions seem to agree quite reasonably, but more statistics need to be collected to smooth out the simulated histogram. Note that having t ∼ 100 as the best fit to this data is perhaps not entirely surprising, since t ≈ Ns ∼

√N = 100!

1Appendix A contains the Matlab code used in coding this walker. Appendix C contains another bit of Matlab code, used to plot the results in an attractive way, namely as 3-D histograms.

7

Page 8: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

Figure 3: Typical results of the non-persistent random walk, for different chain lengths. Each chain length was simulated 1000 times. The extent of the axes of the histograms shows the extent of the furthest simulated random walk in each case.

Figure 8 on p.12 summarizes the scaling results of Rs versus the number of monomers in the polymer N . For the case at hand, where there is no persis­tency, Rs ∼ N 0.479 which is close to the expected N 0.5 . Note that Rs was calculated as being σ where σ2 is the variance of the x- or y-coordinates of the adsorption sites.

4 Persistent polymer adsorption

4.1 Theory

In order to make the random walker slightly more realistic for an adsorption problem, we now add persistency to the model. In a persistent random walk, one prescribes a preferred alignment between one step and the next. In chemistry, persistence would be equivalent to some preferred bonding angle between two successive monomers. Not getting into the details of the chemistry, here we

8

Page 9: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

−50 0 500

0.2

0.4

0.6

0.8

1

XN

P(X

N)

/ max

( P

(XN)

)

Figure 4: Comparison of a simulated histogram and the expected theoretical one given in eq.(11). The dotted black curves are the theoretical plots, the ‘sharper’-peaked one having t = 22 and the other having t = 120. Diffusivity D was assumed to be 1/3 in both cases.

psimply assume that if �n is the vector representing the nth monomer, then

p �n+1 = cos(ϕ),ρ = �n · p

is the correlation coefficient, where ϕ is prescribed. Note that this leaves an­other angle undetermined, which we will call θ, the angle of rotation around the axis created by extending �.p

From lecture [7], we know that

Rs = 2 = aef f

√N, and

��RN �� 1 + ρ

aef f = a 1 − ρ

, (12)

where the scaling with √

N was shown earlier. Note that −1 < ρ < 1, so that aef f can range anywhere from 0 to ∞, where the latter case corresponds to all monomers being perfectly aligned, essentially creating one long one. We are interested in this effective monomer length, and if the adsorption statistics are affected by it...

9

Page 10: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

Figure 5: Schematic illustration of orthogonal rotations necessary to properly code a persistent walk.

4.2 Simulation

In order to properly code the persistent walk, one first computes the difference vector between the nth and (n − 1)th position of the random walk. We then find through which angles this vector has been rotated from the z-axis, and undo these rotations. The difference vector is now precisely equal to �ez ,

�ez = R−1 R−1 (� pn−1) (13)ϕ θ pn − �

to which we can add the new walker position trivially. We then redo the rotation of the difference vector + new position, and repeat this process ad infinitum (or more precisely, ad N ). Figure 5 schematically indicates the two orthogonal rotations that need to be done, and the order in which they are to be performed for best numeric performance. The rotation matrices are

⎛⎝

⎞⎠

1 0 0 0 cos ϕ sin ϕ 0 − sin ϕ cos ϕ

Rϕ(x) = (14)

and ⎛⎝

cos θ sin θ 0 sin θ cos θ 0

0 0 1

⎞⎠Rθ (z) = (15).

Figure 6 shows the first few steps in a persistent random walk, with a 45◦ angle persistency between the monomers. Figure 7 also shows a 3-D histogram for a typical persistent walk with N = 5000 and M = 1000. The key issue in the simulation of persistent random walks is to find out how the persistency angle influences the statistics. Figure 8 shows the standard deviation of the polymer radius vs. the chain length. As expected, the overall scaling of Rs ∼ N γ is not altered, with γ between 0.479 and 0.558. It was also expected that the persistent walks would have a larger Rs at any N , and this is supported entirely by the simulation. Table 1 summarizes these results, and shows that there is a

10

Page 11: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

−3

−2

−1

00

0.51

0.5

1

1.5

2

2.5

yx

z

small but essential difference between entirely uncorrelated steps and seemingly uncorrelated steps with ρ = 0, i.e. for ϕ = 90◦. In the truly uncorrelated case, a walker can step back onto itself, which allows the polymer to have a smaller total radius than in the case of 90◦ steps.

Figure 6: A persistent random walk generated by the code in Appendix B; persistence angle is 45◦.

Angle �

1+ρ 1−ρ γ aef f

random n.a. 0.479 0.343 30◦ 3.73 0.558 0.770 60◦ 1.73 0.501 0.570 90◦ 1 0.480 0.386

Table 1: Results of persistent simulations. Some definitions: ρ = � �pn pn+1,· Rs = aef f N γ .

11

Page 12: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

Figure 7: Typical result for a persistent random walk with persistency angle of 60◦. The walk was repeated 1000 times, for a polymer of length 5000 monomers.

Figure 8: Standard deviation of the total radius of an adsorbing polymer Rs

versus the total number of monomers in the polymer N . In each triplet of lines, the blue one indicates the standard deviation of the x-coordinates, red is for the y-coordinates, and the black dotted line is a linear fit to the blue line. Note that all fits have gradient γ= 0.479-0.558. Persistent walks have a larger vertical shift due to an increase in their effective radius. Also see table 1.

12

Page 13: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

5 Conclusions & Discussion

We have developed theory and performed simulations to support a random-walk polymer adsorption model. The description of this problem as a persistent non-separable CTRW proves to be quite fertile, although details of the analytic calculations require more attention. Note that we used two quite general as­sumptions in order to find an expression for the probability distribution P (r, t); these are: 1. that the waiting time distribution is best described by a Smirnov distribution and 2. that the conditional step-size distribution is best described by simple diffusion in the plane parallel to z = 0. The model needs further scrutiny in the way of properly choosing the diffusivity, and the inherent ‘time’. Interestingly, the best fit to the non-persistent data was accomplished using t ∼ 100, which is closely related to Ns ∼

√N = 100! This avenue of thought

deserves more attention.

Although there seems to be good qualitative and quantitative agreement be­tween theory and experiment, there is still room for improvement. For the persistent case we note that the calculated aef f ’s from simulation are not equal to what one would expect from analytics. Perhaps more importantly, they also do not scale in the same manner. That is, going from 30◦ to 60◦ only shows a factor of 1.35 increase in aef f according to simulation, where an increase of 2.16 would be expected from theory.

Other ways of improving the model are (a) inclusion of self-avoidance, (b) intro­duction of an effective potential between the wall and the particles / polymer and in a more advanced stage (c) inclusion of hydrodynamic effects. After all, the polymer does not exist in vacuo but rather sets up a flow field in whatever medium it exists in. In the case of simple small particles, such hydrodynamic interactions can be modeled using Stokeslet-flows, as discussed in relation to coupled diffusion of two colloidal particles near a wall [8, 9]. In the case of larger structures, this analysis becomes more complex as the flow field must now satisfy the no-slip boundary condition on all ‘surfaces’ of the polymer. Butler and Shaqfeh [10] do take hydrodynamic interactions into account in polymer adsorption problems, but they do so by rather crude ‘lump-sum’ models.

13

Page 14: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

A Code for non-persistent walk

% Simulation of polymer adsorption on a surface % General method: % % Given a normal random distribution of steps dr (length a = monomer % length!), step the polymer chain until it hits or wants to penetrate % the surface z=0. Record this site rn = (xn,yn,0); then restart the % walker at (xn,yn,a), and let it walk again. Collect statistics for % the distribution of rn; remember the number of monomers in the polymer, % between steps and in total. % % a = 1 is assumed.

clear all close all

k = 0;

% For various lengths of polymer: for N = [10,1e2,2e2,5e2,1e3,2e3,5e3,1e4]

k = k+1; N

% Number of polymers simulated:Mmax = 1000;

% InitiateXn = 0;Yn = 0;Rn = 0;h = waitbar(0,’Currently at...’);

for M = 1:Mmax %# of polymers

waitbar(M/Mmax,h)

th = 2*pi*rand(N,1);ph = pi*rand(N,1);

dx = sin(ph).*sin(th);dy = sin(ph).*cos(th);dz = cos(ph);

xn = 0; %Initial position of walker yn = 0; %see above, note that this is NOT an adsorption site

14

Page 15: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

z0 = 1;

done = 0; ind_z = 1; IND = 0; i = 0; while done == 0

i = i+1; x = [xn;xn+cumsum(dx(IND+1:end))]; y = [yn;yn+cumsum(dy(IND+1:end))]; z = [z0;z0+cumsum(dz(IND+1:end))];

% Find where it crosses z=0 plane, re-walk from there: ind_z = min(find(z<=0));

if isempty(ind_z) %stop if last walk did not cross at all done = 1;

else

% Define new starting points:IND = IND + ind_z;xn = x(ind_z);yn = y(ind_z);

%Save useful information:xns(i) = xn;yns(i) = yn;n(i) = ind_z;

if IND == length(dx)-1 %stop if next walk is 0 steps long done = 1;

end end

end

if exist(’xns’) xn = xns; yn = yns; rn = sqrt(xn.^2+yn.^2); N_tot = sum(n);

Xn = [Xn,xn];Yn = [Yn,yn];Rn = [Rn,rn];Nt(M) = N_tot;clear xns yns xn yn

15

Page 16: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

elseNt(M) = 0;

end end Std_X(k) = std(Xn); Std_Y(k) = std(Yn); Num(k) = N; %pause close(h) datum = datestr(now,30) filename = [datum(end-6:end),’M ’,num2str(M),’ N ’,num2str(N)]; save(filename,’M’,’N’,’Xn’,’Yn’,’Rn’,’Nt’) clear N Xn Yn Rn Nt filename

end

plot(log10(Num),log10(Std_X),’b’,log10(Num),log10(Std_Y),’r’)

16

Page 17: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

B Code for persistent walk

clear all close all

%For various persistency angles for pers_angle = [30:30:90]*pi/180

k = 0;

%For various lengths of the polymerfor N = [10,1e2,2e2,5e2,1e3,2e3,5e3,1e4]

k = k+1;

%For Mmax polymersMmax = 1e3;

Angle = pers_angle*180/piN

Xn = 0;Yn = 0;

h = waitbar(0,’Currently at...’);

for M = 1:Mmax %# of polymers

waitbar(M/Mmax,h)

th = 2*pi*rand(N,1);ph = pers_angle;

dx = sin(ph).*sin(th);dy = sin(ph).*cos(th);dz = cos(ph);ddp = [dx,dy,dz*ones(length(dx),1)]’;

%Initial position of walker:%Also second position of walker (2 positions = one monomer)p(:,1) = [0;0;1];v0 = [rand(1)-0.5;rand(1)-0.5;rand(1)-0.5];v0 = v0/norm(v0);p(:,2) = p(:,1) + v0;

%Unit vectors:ex = [1;0;0];ey = [0;1;0];

17

Page 18: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

ez = [0;0;1];

i = 0; prev_n = 0;

%Now to generate the entire persistent random walk: for n = 2 : N-1

% This if-then loop creates the next step, based on the% previous ones.if p(3,n)==1 % this means that the previous step crossed

% zero and was articially placed up to % one again

dp = [rand(1)-0.5;rand(1)-0.5;rand(1)-0.5]; dp = dp/norm(dp); p(:,n+1) = p(:,n)+dp;

elsedp = p(:,n)-p(:,n-1);

%Find angles of dp:phi_n = acos(sum(ez.*dp));dpxy = [dp(1);dp(2);0];dpxy = dpxy/norm(dpxy);the_n = acos(sum(ey.*dpxy));

%Get rid of ambiguity in theta:if (dp(1)<=0)

the_n = -the_n;endRt_n = Rth(the_n);Rp_n = Rph(phi_n);

% Test by rotating dp by its angles, it should % collapse onto e_z: pn1 = (Rp_n^(-1))*(Rt_n^(-1))*dp; err = sum(pn1.*ez); if round(1000*err)~=1000

warning(’pn1 not equal to e_z, pausing’) pause

end

pn2 = pn1 + ddp(:,n);

p(:,n+1) = p(:,n-1) + Rt_n * Rp_n * pn2;end

18

Page 19: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

% This if-loop checks to see if the new step crosses % zero or not if p(3,n+1)<=0

i = i+1;z = p(3,n+1);X(i) = p(1,n+1);Y(i) = p(2,n+1);p(3,n+1) = 1; % step up to one straight from

% where you’re at. count(i) = (n+1)-prev_n; prev_n = n+1;

end

end % of walk of N monomers

if exist(’X’)N_tot = sum(count);Xn = [Xn,X];Yn = [Yn,Y];Nt(M) = N_tot;

else Nt(M) = 0;

endclear X Y

endStd_X(k) = std(Xn);Std_Y(k) = std(Yn);Num(k) = N;

close(h)datum = datestr(now,30)filename = [’M_’,num2str(M),’_N_’,num2str(N),’ angle_’,...

num2str(pers_angle*180/pi)];

save(filename,’M’,’N’,’Xn’,’Yn’,’Nt’,’pers_angle’) clear Xn Yn M N Nt th ph dx dy dz

end[pX,sx] = polyfit(log10(Num),log10(Std_X),1);[pY,sy] = polyfit(log10(Num),log10(Std_Y),1);save([’Std_vs_Num_angle’,num2str(pers_angle*180/pi)],...

’pers_angle’,’Std_X’,’Std_Y’,’Num’,’pX’,’pY’) clear pX pY Std_X Std_Y Num

end

19

Page 20: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

C Code common to both, and hist3.m

function Rph = Rph(ph)

Rph = [1,0,0;0,cos(ph),sin(ph);0,-sin(ph),cos(ph)];

function Rth = Rth(th)

Rth = [cos(th),sin(th),0;-sin(th),cos(th),0;0,0,1];

function [cx,cy,Nxy,Nnorm] = hist3(Xn,Yn,bins)

% [cx,cy,Nxy,Nnorm] = hist3(Xn,Yn,bins)% hist3 returns the 3-D histogram of the coupled variables [Xn,Yn],% using a grid size equal to the number of bins. [cx,cy] returns the% centre values of the bins in the Xn, and Yn variable. Nxy is effect­% ively the count of how many (x,y) couples there are in a region% (x-dx:x+dx,y-dy:y+dy), where (dx,dy) follow logically from the number% of bins chosen. Nxy is also normalized, that is the maximum value is% set to = 1.%% Example:% x = randn(1,5000);% y = randn(1,5000);% hist3(x,y,20);% returns a 3-D Gaussian.%% Created by Ernst A. van Nierop on May 12th, 2005.%%

[Xs,ind_sx] = sort(Xn); % sort in x-valuesYs = Yn(ind_sx); % and keep same alignment in y-direction[Nxs,cxs] = hist(Xs,bins);[Nys,cys] = hist(Ys,bins);

%Now per bin, we figure out the histogram of y. for i = 1:bins % essentially equivalent to sliding along

% the x-axis if i == 1

20

Page 21: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

yl = 1;else

yl = 1 + sum(Nxs(1:i-1));endyh = yl + Nxs(i) - 1;

[Ns] = hist(Ys(yl:yh),cys);Nxy(i,:) = Ns; % hence each row corresponds to ONE x-value

% bin, and all the y-value bins along it. end Nnorm = Nxy/(max(max(Nxy))); [cx,cy] = meshgrid(cxs,cys); figure, surf(cx,cy,Nnorm); caxis([0,0.2]); xlabel(’Xn’), ylabel(’Yn’), zlabel(’Normalized Count’)

21

Page 22: Polymer Adsorption · 2019. 9. 12. · 2 Introduction Polymer adsorption to solid surfaces can be modeled as a random walk ‘hit ting’ the solid surface. Each step of the random

References

[1] B. O’Shaughnessy and D. Vavylonis, Irreversible adsorption from dilute polymer solutions, Eur. Phys. J. E 11, 213 (2003).

[2] S. Redner, A Guide to First Passage Processes, Cambridge, 2001.

[3] C. Rycroft, www-math.mit.edu/18.366/ps/Sol4 366 05.pdf.

[4] C. Rycroft, www-math.mit.edu/18.366/ps/Sol1 366 05.pdf.

[5] M. S. Kilic and M. Z. Bazant, www-math.mit.edu/18.366/lec/lec16.pdf.

[6] B. D. Hughes, Random Walks and Random Environments, volume 1: Ran­dom Walks, Oxford, 1995.

[7] M. Rvachev and M. Z. Bazant,www-math.mit.edu/18.366/lec03/lecture9.ps.

[8] E. R. Dufresne, T. M. Squires, M. P. Brenner, and D. G. Grier, Hydrody­namic Coupling of Two Brownian Spheres to a Planar Surface, Phys. Rev. Lett. 85, 3317 (2000).

[9] T. M. Squires and M. P. Brenner, Like-Charge Attraction and Hydrody­namic Interaction, Phys. Rev. Lett. 85, 4976 (2000).

[10] J. E. Butler and E. S. G. Shaqfeh, Brownian dynamics simulations of a flexible polymer chain which includes continuous resistance and multibody hydrodynamic interactions, J. Chem. Phys. 122, 014901 (2005).

22


Recommended