orthogonal space random walk (osrw): free energy...

12
Orthogonal Space Random Walk (OSRW): Free Energy Simulation Ameet Gohil University of Iowa REU at Department of Scientific Computing, Florida State University ABSTRACT Many efforts have been made in developing free energy simulation methods. The free energy simulation can get extremely challenging when complex system undergoes reactions. Here we explore free energy simulation methods starting from the most basic methods using Langevin dynamics. The simulation methods require the particle to visit all the wells; we explain our successful attempts on guiding the particle through hidden barriers. We also present a simulation method that introduces a new parameter, λ, in the system to add bounds to the system and efficiently travel through hidden barriers. The simulation method uses time dependent drag coefficient in the new parameter space to increase efficiency. The time dependent drag efficient still requires optimization, but it does show considerable improvement in particle guidance. After the drag coefficient is optimized, the free energy calculation code will be added. INTRODUCTION Determining Free energy is a very important step in understanding chemical reactions. Hence, an efficient free energy would prove very useful in understanding complex systems such proteins, DNA, and other biological systems. First approach to free energy simulation was using metadynamics. This approach is uses addition of small 1D Gaussian potentials. For instance, Figure 1 shows a 1D potential U 0 (x). A particle is simulated using Langevin dynamics i.e. including random collisions, drag force, and potential as force components. At the end of every iteration during the simulation, a small Gaussian (G i (x)) is added to the original potential U 0 (x). The final potential at the of the simulation is U(x)=U 0 (x)+Σ G i (x). When all the wells are full, the simulation is stopped and the free energy is determined using the following equation. Figure 1: 1D potential free energy simulation The main goal is to achieve a free energy simulation on potentials with hidden barriers. Hence, the problem was approached using a 2D potential described

Upload: vuliem

Post on 09-Jul-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Orthogonal Space Random Walk (OSRW): Free Energy ...ww2.che.ufl.edu/reu/student_reports/2009/Gohil_report.pdf · Orthogonal Space Random Walk (OSRW): Free Energy Simulation Ameet

Orthogonal Space Random Walk (OSRW): Free Energy Simulation

Ameet Gohil University of Iowa

REU at Department of Scientific Computing,

Florida State University

ABSTRACT Many efforts have been made in developing free energy simulation methods. The free energy simulation can get extremely challenging when complex system undergoes reactions. Here we explore free energy simulation methods starting from the most basic methods using Langevin dynamics. The simulation methods require the particle to visit all the wells; we explain our successful attempts on guiding the particle through hidden barriers. We also present a simulation method that introduces a new parameter, λ, in the system to add bounds to the system and efficiently travel through hidden barriers. The simulation method uses time dependent drag coefficient in the new parameter space to increase efficiency. The time dependent drag efficient still requires optimization, but it does show considerable improvement in particle guidance. After the drag coefficient is optimized, the free energy calculation code will be added. INTRODUCTION Determining Free energy is a very important step in understanding chemical reactions. Hence, an efficient free energy would prove very useful in understanding complex systems such proteins, DNA, and other biological systems. First approach to free energy simulation was using metadynamics. This approach is uses addition of small 1D Gaussian potentials. For instance, Figure 1 shows a 1D potential U0(x). A particle is simulated using Langevin dynamics i.e. including random collisions, drag force, and potential as force components. At the end of every iteration during the simulation, a small Gaussian (Gi(x)) is added to the original potential U0(x). The final potential at the of the simulation is U(x)=U0(x)+Σ Gi(x). When all

the wells are full, the simulation is stopped and the free energy is determined using the following equation.

 Figure 1: 1D potential free energy simulation

The main goal is to achieve a free energy simulation on potentials with hidden barriers. Hence, the problem was approached using a 2D potential described

Page 2: Orthogonal Space Random Walk (OSRW): Free Energy ...ww2.che.ufl.edu/reu/student_reports/2009/Gohil_report.pdf · Orthogonal Space Random Walk (OSRW): Free Energy Simulation Ameet

in Equation 2, where x is the known dimension and y is unknown.

The contour and 3D plots below show the shape of the potential.

Figure 2: Contour plot of the sample potential

Figure 3: Mesh plot of the sample potential

A simple particle is introduced in the potential and allowed to run for a fixed time interval. Factors such as drag force and random force due to collision are included in the simulation. The drag force depends on a

drag coefficient ζ and the velocity of the particle at that point in time. Whereas, the random collisions A(T) with other particles are simulated using a Maxwell distribution dependent on temperature T. The average force and standard deviation for the distribution are 0 and T respectively. Equation 3 shows all the components of the force acting on the simulated particle.

The Verlet method was used to simulate the particle. The steps are as following:

1. Using the current position, calculate the force and acceleration on the particle

2. Calculate the velocity at half the specified time step Δt/2

3. Calculate the new force on the particle

4. Calculate the velocity at half the specified time step Δt/2

5. Calculate new position of the particle Figure 4 shows the particle trajectory

in the sample potential. The goal is to attain a particle position distribution that is strongly concentrated in the two wells. The figure shows that the 1D Gaussian fails to guide the particle through the barrier in the y dimension to achieve symmetric particle position distribution in the wells. Hence, an alternate method is required.

Page 3: Orthogonal Space Random Walk (OSRW): Free Energy ...ww2.che.ufl.edu/reu/student_reports/2009/Gohil_report.pdf · Orthogonal Space Random Walk (OSRW): Free Energy Simulation Ameet

Figure 4: Particle trajectory with 1D Gaussian

To guide the particle through hidden barriers the Gaussian is modified to 2D as shown in Equation 4.

This new Gaussian addition is implemented by dividing the system into a grid and a Gaussian distribution is added every time the particle visits a block on the grid. The method also ensures that the particle does not linger or come back to the same well for an extended period of time. A simulation result using this method is shown in Figure 5. The figure shows that the particle jumps from one well to the other.

Figure 5: Particle trajectory using 2D Gaussian

PROBLEM ANALYSIS Even though the new 2D Gaussian

method guides the particle through hidden barriers, it is no very efficient. The method requires computing second derivative of the potential after every iteration and this ends up beings computationally expensive. Also, the method does not add bounds to the potential which increases chances of the particle getting too far away from the away from the wells.

An alternate method using an extended Hamiltonian attempts to satisfy both problems encountered in 2D Gaussian method. The extended Hamiltonian method is described in the following set of equations.

)7(

)6( 2

)(2

1

)5( 2

)(

22

0

2

0

HL

ext m

pcxkHH

m

pxUH

This method adds a new variable to

the potential changing the dimensions to 3-D (x, y, λ). The new potential is shown in Equation 8.

Page 4: Orthogonal Space Random Walk (OSRW): Free Energy ...ww2.che.ufl.edu/reu/student_reports/2009/Gohil_report.pdf · Orthogonal Space Random Walk (OSRW): Free Energy Simulation Ameet

The new part of the potential is dependent on variables x and λ. Figure 6 shows the plot of the added part of the potential.

Figure 6: Added potential Uext(x,lambda)=.5k(x-

c*lambda)^2

The technique of adding Gaussian distributions is further examined with the new potential. The modified Gaussian distribution added in this instance is shown in Equation 9.

A plot of the new Gaussian added to the center of the added potential part is show in Fig 7.

Figure 7: Added Gaussian on Uext(x,lambda)

The figure above shows that the Gaussian distributions are shaped in the direction of the low potential. The parameters k and c in the potential control the steepness of the curvature and the slope of the low energy line respectively. The new parameter λ, also follows Equation 2, but has an independent drag coefficient and random force. To enforce bounds, the λ parameter is set to reflect back at specified lower bound λL and upper bound λH. Increasing the k value and bounding λ, increases the steepness of the curvature and bounds the particle as the lowest energy state is most desirable. The system was then simulated using different viscous coefficients for λ parameter. The simulations were examined by measuring deviation of the particle from x=c*λ line and the number of times the particle was reflected by the specified lower and upper bounds in a given period of time. The results are shown in the following figures.

Page 5: Orthogonal Space Random Walk (OSRW): Free Energy ...ww2.che.ufl.edu/reu/student_reports/2009/Gohil_report.pdf · Orthogonal Space Random Walk (OSRW): Free Energy Simulation Ameet

NUMERICAL ANALYSIS AND RESULTS

 Figure 8: drag coefficient=50 deviation plot

 Figure 9: drag coefficient=200 deviation plot

Page 6: Orthogonal Space Random Walk (OSRW): Free Energy ...ww2.che.ufl.edu/reu/student_reports/2009/Gohil_report.pdf · Orthogonal Space Random Walk (OSRW): Free Energy Simulation Ameet

 Figure 10: Lambda travel, drag coefficient=50 

 Figure 11: Lambda travel, drag coefficient=200

The results show that the deviation from the line increases with time. Overall deviation from the line was observed to decrease as the viscous coefficient increased while the particle reflections decreased. The particle reflections were observed to increase over time with small viscous coefficients much faster than with larger coefficients. Using these observations, the viscous coefficient for the λ parameter was made dependent. Since, initially, the deviation from the line with any viscous coefficient is small and the particle reflection is high with small viscous coefficient, the coefficient was set to a small

value. The value linearly increased for the simulation. Figures, 12 and 13 show the deviation of particle and particle reflections on the λ parameter respectively. The deviation plot shows relatively small deviation value while maintaining the particle reflection.

 Figure 12: time dependent drag coefficient, deviation plot

 Figure 13: time dependent drag coefficient, travel plot

CONCLUSION The method shows improved efficiency overcoming hidden barriers. Currently the method uses linear progression of viscous coefficient with time to overcome stability

Page 7: Orthogonal Space Random Walk (OSRW): Free Energy ...ww2.che.ufl.edu/reu/student_reports/2009/Gohil_report.pdf · Orthogonal Space Random Walk (OSRW): Free Energy Simulation Ameet

and travel problems. The method could be refined to increase stability by using non-linear change of viscous coefficient. This

method can be used to achieve efficient free energy simulation for complex system.

References

Lianqing Zheng, Mengen Chen, and Wei Yang, “Simultaneous escaping of explicit and hidden barriers: Application of the orthogonal space random walk strategy in generalized ensemble based conformational sampling”, J. Chem. Phys., 130, 1 (2009).

Lianqing Zheng, Mengen Chen, and Wei Yang, “Random walk in orthogonal space to achieve efficient free-energy simulation of complex systems”, PNAS, 105, 51, 20227-20232 (2008).

Page 8: Orthogonal Space Random Walk (OSRW): Free Energy ...ww2.che.ufl.edu/reu/student_reports/2009/Gohil_report.pdf · Orthogonal Space Random Walk (OSRW): Free Energy Simulation Ameet

Appendix Dynamic drag coefficient simulation code: function out=VEGibbs3Dgauss2DX2t(init,vCoeff,vCoeffLi,vCoeffLf,mass,tstep,tfinal,T,k,c) height=.005; sigma=.005; rangex=50; rangey=50; rangelambda=50; resolution=2*sigma; xbins= ceil(2*rangex./resolution); % ybins= ceil(2*rangey./resolution); lambdabins= ceil(2*rangelambda./resolution); bins=zeros(xbins,lambdabins); n=ceil(tfinal/tstep); xlist=zeros(n+1,1); ylist=zeros(n+1,1); lambdalist=zeros(n+1,1); tlist=zeros(n+1,1); xlist(1)=init(1); ylist(1)=init(2); lambdalist(1)=init(3); tlist(1)=init(4); velx=init(5); vely=init(6); vellambda=init(7); upperbound=1; lowerbound=0; x=0; y=0; lambda=0; % syms x y lambda epsilon=2; a=2.5; b=.5; % energy=-epsilon.*exp(-(x-1)^2/(2*a^2)-(y-1)^2/(2*b^2))-epsilon*exp(-(x+1)^2/(2*a^2)-(y+1)^2/(2*b^2))+.5*k*(x-c*lambda)^2; % outx=energy; vCoeffL=vCoeffLi Fx=-potfx3(xlist(1),ylist(1),lambdalist(1),c,k)-(velx)*vCoeff+normrnd(0,T); ax=Fx./mass; Fy=-potfy3(xlist(1),ylist(1),lambdalist(1),c,k)-(vely)*vCoeff+normrnd(0,T); ay=Fy./mass; Flambda=-potflambda3(xlist(1),ylist(1),lambdalist(1),c,k)-(vellambda)*vCoeffL+normrnd(0,T); alambda=Flambda./mass; randMatrix=normrnd(0,T,n,3); disp(mean(randMatrix(:,1))); disp(mean(randMatrix(:,2))); disp(mean(randMatrix(:,3)));

Page 9: Orthogonal Space Random Walk (OSRW): Free Energy ...ww2.che.ufl.edu/reu/student_reports/2009/Gohil_report.pdf · Orthogonal Space Random Walk (OSRW): Free Energy Simulation Ameet

for i=1:n vCoeffL=vCoeffLi+i/n*(vCoeffLf-vCoeffLi); set=0; % if mod(i,floor(n/10))==0 % randMatrix=normrnd(0,T,floor(n/10),3); % end xf=xlist(i)+velx.*tstep+.5.*ax.*tstep.^2; yf=ylist(i)+vely.*tstep+.5.*ay.*tstep.^2; lambdaf=lambdalist(i)+vellambda.*tstep+.5.*alambda.*tstep.^2; if lambdaf > upperbound lambdaf=2*upperbound-lambdaf; set=1; end if lambdaf < lowerbound lambdaf=2*lowerbound-lambdaf; set=1; end velHalfx=velx+.5.*ax.*tstep; velHalfy=vely+.5.*ay.*tstep; velHalflambda=vellambda+.5.*alambda.*tstep; fgaussx=0; fgaussy=0; fgausslambda=0; binx=ceil((xf+rangex)./resolution); % biny=ceil((yf+rangey)./resolution); binlambda=ceil((lambdaf+rangelambda)./resolution); bins(binx,binlambda)=bins(binx,binlambda)+1; % [row,col,vals]=find(bins); % hmm=size(row,1); % parfor it=1:hmm % xshift=-rangex+col(it)*resolution-resolution/2; % valx=gaussfx(xf,xshift,yf); % valy=gaussfy(xf,xshift,yf); % fgaussx=fgaussx+vals(it).*valx; % fgaussy=fgaussy+vals(it).*valy; % end for q=binlambda-2:binlambda+2 for p=binx-2:binx+2 xshift=-rangex+p*resolution-resolution/2; lambdashift=-rangelambda+q*resolution-resolution/2; valx=gaussfx3(xf,yf,lambdaf,xshift,lambdashift,c,k); vallambda=gaussflambda3(xf,yf,lambdaf,xshift,lambdashift,c,k); fgaussx=fgaussx+bins(p,q).*valx*height; fgausslambda=fgausslambda+bins(p,q).*vallambda*height; end end % mod(i,floor(n/10))+1 Fx=-potfx3(xf,yf,lambdaf,c,k)-(velx)*vCoeff+randMatrix(i,1)-fgaussx; ax=Fx./mass;

Page 10: Orthogonal Space Random Walk (OSRW): Free Energy ...ww2.che.ufl.edu/reu/student_reports/2009/Gohil_report.pdf · Orthogonal Space Random Walk (OSRW): Free Energy Simulation Ameet

Fy=-potfy3(xf,yf,lambdaf,c,k)-(vely)*vCoeff+randMatrix(i,2)-fgaussy; ay=Fy./mass; Flambda=-potflambda3(xf,yf,lambdaf,c,k)-(vellambda)*vCoeffL+randMatrix(i,3)-fgausslambda; alambda=Flambda./mass; velx=velHalfx+.5.*ax.*tstep; vely=velHalfy+.5.*ay.*tstep; if set==1 vellambda=-vellambda; else vellambda=velHalflambda+.5.*alambda.*tstep; end t=tlist(i)+tstep; xlist(i+1)=xf; ylist(i+1)=yf; lambdalist(i+1)=lambdaf; tlist(i+1)=t; if mod(i,10000)==0 disp(i); end % if mod(i,10000)==0 % % figure % plot3(xlist,ylist,lambdalist); % xlabel('x'); % ylabel('y'); % zlabel('lambda'); % view(0,0); % pause % end if mod(i,n+1)==0 [row,col,vals]=find(bins); outx=energy; disp('in parfor'); disp(size(row,1)); disp(size(col,1)); hmm=size(row,1); tic; % outx=0; parfor iter=1:1 % if mod(iter,100)==0 disp(iter); % end % outx=outx+bins(nz_index(iter))*height*(exp((-(x-(-rangex+nz_index(iter)*resolution-resolution/2))^2)/(2*sigma^2))); xsh=(-rangex+col(iter)*resolution-resolution/2); outx=outx+vals(iter)*height/exp(((x - xsh)^2 + ((2*((4*x)/25 - 4/25))/exp((2*(x - 1)^2)/25 + 2*(y - 1)^2) + (2*((4*x)/25 + 4/25))/exp((2*(x + 1)^2)/25 + 2*(y + 1)^2) - (2*((4*xsh)/25 - 4/25))/exp((2*(xsh - 1)^2)/25 + 2*(y - 1)^2) - (2*((4*xsh)/25 + 4/25))/exp((2*(xsh + 1)^2)/25 + 2*(y + 1)^2))^2)/(2*sigma^2)); end toc disp('out of parfor');

Page 11: Orthogonal Space Random Walk (OSRW): Free Energy ...ww2.che.ufl.edu/reu/student_reports/2009/Gohil_report.pdf · Orthogonal Space Random Walk (OSRW): Free Energy Simulation Ameet

% figure % ezmesh(outx); % pause figure ezcontourf(outx); pause hold on plot(xlist,ylist); hold off pause figure plot(xlist,ylist); pause end end % figure % plot3(xlist,ylist,lambdalist); % xlabel('x'); % ylabel('y'); % zlabel('lambda'); out=[xlist,lambdalist]; % ezcontour(outx); % % view(0,90) % hold on % plot(xlist,ylist); % pause % hold off % plot(tlist,xlist); % pause % plot(tlist,ylist); % pause % plot(tlist,xlist); % hold on % plot(tlist,ylist); % hold off % out=[xlist,ylist,tlist]; % out=outx-energy;

Page 12: Orthogonal Space Random Walk (OSRW): Free Energy ...ww2.che.ufl.edu/reu/student_reports/2009/Gohil_report.pdf · Orthogonal Space Random Walk (OSRW): Free Energy Simulation Ameet

Execution code for deviation plots: clear coeffi=40; coefff=200; t=[0:.0005:1000]; for i=1:1 m=VEGibbs3Dgauss2DX2t([0 0 0 0 0 0 0],1,coeffi,coefff,1,.0005,1000,30,1000,1); u=abs(m(:,1)-m(:,2)); plot(t,m(:,2)); pause clear m u=u.^2; u=cumsum(u,1); e=[1:size(u,1)]; e=e'; u=u./e; init=2*i-1 fin=2*i st(:,i)=u.^5; end x=mean(st,2); t=t'; plot(t,x,':','Color','blue') temp1=num2str(coeffi); temp2=num2str(coefff); saveas(gcf,[temp1 '-' temp2 '.fig']); saveas(gcf,[temp1 '-' temp2 '.png']);