Department of Chemical Engineering University of California, Santa Barbara Spring Exercise 2. Due: Thursday, 4/19/09

Similar documents
Department of Chemical Engineering University of California, Santa Barbara Spring Exercise 3. Due: Thursday, 5/3/12

ECE521 W17 Tutorial 1. Renjie Liao & Min Bai

Analysis of the Lennard-Jones-38 stochastic network

Computational Methods for Nonlinear Systems

Exploring the energy landscape

Lab 1: Empirical Energy Methods Due: 2/14/18

VPython Class 2: Functions, Fields, and the dreaded ˆr

Read through A Graphing Checklist for Physics Graduate Students before submitting any plots in this module. See the course website for the link.

Computational Methods for Nonlinear Systems

LAB 1: MATLAB - Introduction to Programming. Objective:

Satellite project, AST 1100

Lab 8: Magnetic Fields

Competition between face-centered cubic and icosahedral cluster structures

IAP 2006: From nano to macro: Introduction to atomistic modeling techniques and application in a case study of modeling fracture of copper (1.

Studying Topography, Orographic Rainfall, and Ecosystems (STORE)

Conjugate-Gradient. Learn about the Conjugate-Gradient Algorithm and its Uses. Descent Algorithms and the Conjugate-Gradient Method. Qx = b.

Python & Numpy A tutorial

Data Mining with the PDF-4 Databases. FeO Non-stoichiometric Oxides

SRM assay generation and data analysis in Skyline

Speed of waves. Apparatus: Long spring, meter stick, spring scale, stopwatch (or cell phone stopwatch)

ES205 Analysis and Design of Engineering Systems: Lab 1: An Introductory Tutorial: Getting Started with SIMULINK

Assignment 1: Molecular Mechanics (PART 1 25 points)

Modeling the Free Energy Landscape for Janus Particle Self-Assembly in the Gas Phase. Andy Long Kridsanaphong Limtragool

Changes in Energy and Momentum

The Coefficient of Friction

An Introduction to Two Phase Molecular Dynamics Simulation

GIS CONCEPTS ARCGIS METHODS AND. 3 rd Edition, July David M. Theobald, Ph.D. Warner College of Natural Resources Colorado State University

Physics 103 Newton s 2 nd Law On Atwood s Machine with Computer Based Data Collection

Presenting Tree Inventory. Tomislav Sapic GIS Technologist Faculty of Natural Resources Management Lakehead University

Practical Information

Introduction to Hartree-Fock calculations in Spartan

first name (print) last name (print) brock id (ab17cd) (lab date)

Problem Set 3 September 25, 2009

Your work from these three exercises will be due Thursday, March 2 at class time.

Practical Bioinformatics

Gradient Descent Methods

Conformational Analysis of n-butane

Close-packing transitions in clusters of Lennard-Jones spheres

Experiment 1: Linear Regression

Global Minimum Structures of Morse Clusters as a Function of the Range of the Potential: 81 e N e 160

Richter Scale and Logarithms

Pytorch Tutorial. Xiaoyong Yuan, Xiyao Ma 2018/01

2 Getting Started with Numerical Computations in Python

HOMEWORK #4: LOGISTIC REGRESSION

Worksheet 1: Integrators

Kinematics Lab. 1 Introduction. 2 Equipment. 3 Procedures

Global minima for rare gas clusters containing one alkali metal ion

Updated 2013 (Mathematica Version) M1.1. Lab M1: The Simple Pendulum

Dynamics of Lennard-Jones clusters: A characterization of the activation-relaxation technique

Comparing whole genomes

Testing Newton s 2nd Law

Lab 1: Handout GULP: an Empirical energy code

Matter & Interactions I Fall 2016

(Multiscale) Modelling With SfePy

GIS CONCEPTS ARCGIS METHODS AND. 2 nd Edition, July David M. Theobald, Ph.D. Natural Resource Ecology Laboratory Colorado State University

Remember that C is a constant and ë and n are variables. This equation now fits the template of a straight line:

COMS 6100 Class Notes

LAB 3: WORK AND ENERGY

Analyzing the Earth Using Remote Sensing

Lecture 5. September 4, 2018 Math/CS 471: Introduction to Scientific Computing University of New Mexico

PHY 123 Lab 9 Simple Harmonic Motion

IndiFrag v2.1: An Object-based Fragmentation Analysis Software Tool

Computer Model of Spring-Mass System. Q1: Can a computer model of a mass-spring system, based on the finite-time form of the momentum principle

LAB 4: FORCE AND MOTION

Appendix B Microsoft Office Specialist exam objectives maps

Lab 6: Linear Algebra

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Physics Department. Experiment 03: Work and Energy

Matrix Eigensystem Tutorial For Parallel Computation

A Dynamic Lattice Searching Method for Fast Optimization of Lennard Jones Clusters

HOMEWORK #4: LOGISTIC REGRESSION

Structuring of hydrophobic and hydrophilic polymers at interfaces Stephen Donaldson ChE 210D Final Project Abstract

1 Newton s 2nd and 3rd Laws

Algorithms for Uncertainty Quantification

Newton s Third Law. Evaluation copy

Lab 2 Worksheet. Problems. Problem 1: Geometry and Linear Equations

Excel for Scientists and Engineers Numerical Method s. E. Joseph Billo

a. Follow the Start-Up Procedure in the laboratory manual. Note the safety rules.

44 Force extension characteristics for a spring / elastic material

Static and Kinetic Friction

x k+1 = x k + α k p k (13.1)

Students will explore Stellarium, an open-source planetarium and astronomical visualization software.

Basic chromatographic parameters and optimization in LC

Assignment 1 Physics/ECE 176

1.1 Variational principle Variational calculations with Gaussian basis functions 5

WILEY. Differential Equations with MATLAB (Third Edition) Brian R. Hunt Ronald L. Lipsman John E. Osborn Jonathan M. Rosenberg

Geometry Optimization and Conformational Analysis of (C 60 ) N Clusters Using a Dynamic Lattice-Searching Method

1 Introduction to Minitab

Statistics for Python

Chemistry 112 Laboratory Experiment 7: Determination of Reaction Stoichiometry and Chemical Equilibrium

Gravity Modelling Forward Modelling Of Synthetic Data

Python Raster Analysis. Kevin M. Johnston Nawajish Noman

Mechanics of Structures (CE130N) Lab 3

Earth Materials Lab 2 - Lattices and the Unit Cell

(THIS IS AN OPTIONAL BUT WORTHWHILE EXERCISE)

Linear Neural Networks

BASIC TECHNOLOGY Pre K starts and shuts down computer, monitor, and printer E E D D P P P P P P P P P P

Fractal dimensions of computer simulated agglomerates

National Technical University of Athens (NTUA) Department of Civil Engineering Institute of Structural Analysis and Aseismic Research

Laboratory 2: Motion in One Dimension: Velocity

Introduction to SVD and Applications

Transcription:

Department of Chemical Engineering ChE 210D University of California, Santa Barbara Spring 2012 Exercise 2 Due: Thursday, 4/19/09 Objective: To learn how to compile Fortran libraries for Python, and to write a short Python code to perform energy minimization using the conjugate-gradient method. The term clusters denotes small, stable packings of (often spherical) particles. For years, many groups have been interested in studying the geometries and energetics of clusters of objects ranging in size from atoms to small colloidal particles in the nanometer to micrometer scale. Cluster analyses are instrumental to understanding a wide range of physical phenomena, including the structure of solids, diffusion in dense liquids, aggregation of colloidal and other particles in solution, nanostructured materials, and the self-assembly behavior of many synthetic and biomolecular systems. A cluster is characterized by the number of particles and the energetic interactions between them. For attractive spherical particles, such as those that might be modeled by the Lennard- Jones interaction, it is found that there are cluster sizes of particularly exceptional stability. The so-called magic cluster numbers correspond to cluster sizes where the packing of atoms is most efficient and can reach a particularly stable configuration. The most stable magic clusters are built from an icosahedral geometric arrangement of the particles. The first few magic cluster sizes in this series are 13, 19, 38, 55, and 75. To find stable packings of particles, we first build an interaction model using the dimensionless Lennard-Jones (LJ) potential: = 4 We can then start with a random configuration of particles and use an energy-minimization algorithm to find a stable structure of low energy. However, because the number of local minima is so large, we will need to repeat this procedure for a number of times starting from different random configurations in order to locate the global minimum. In addition, for the minimization procedure to work, we need to add a very weak biasing potential that pulls our particles towards the origin. This potential helps favor a single cluster, rather than multiple separate ones, during the minimization procedure. Without it, the LJ

potential does not have sufficiently long-ranged interactions to pull together atoms that are separated by several units of distance. The biasing potential is harmonic such that our total force field is: = + 4 Here, = 0.0001 is a very small parameter. The scaling is chosen so that the average energy due to this term for a cluster of particles is constant. In this assignment, you will perform conjugate gradient minimization of Lennard-Jones particles, initially randomly distributed in space. Part of the code has already been written for you, including the Fortran library that computes the pairwise interaction energies & forces and the basic Python routine for performing the line search. Part a Download from the course website the files ex2lib.f90 and ex2.py. Place these files in a new path on your computer where you will store your code and perform your computations. Then, compile the pre-written Fortran library using f2py. On a Windows machine, you should use: c:\mydir> f2py c m ex2lib ex2lib.f90 --fcompiler=gnu95 --compiler=mingw32 On other systems, you might delete the --compiler=mingw32 option altogether, or replace it with your favorite C compiler (e.g., --compiler=gcc). Part b The file ex2.py is a template for your code that already has some code written in it. Take a look at the existing code to learn what it is doing. Then, write code for the following functions: function: InitPositions(N, L) description: Returns an array of initial positions of each atom, placed randomly within a cubic box of dimensions L arguments: N: number of atoms L: box width returns: Pos: (N,3) array of positions

function: ConjugateGradient(Pos, dx, EFracTolLS, EFracTolCG) description: Performs a conjugate gradient search to find an energy minimum. arguments: Pos: starting positions, (N,3) array dx: initial step amount, a float EFracTolLS: fractional energy tolerance for line search EFracTolCG: fractional energy tolerance for conjugate gradient returns: PEnergy: value of potential energy at minimum Pos: minimum energy (N,3) position array For your conjugate gradient algorithm, keep the following points in mind: A line search function has already been written in the template file, and you will call this from your algorithm. You can get the potential energy and forces array using the library module: PEnergy, Forces = ex2lib.calcenergyforces(pos) Your first line search direction should be the force vector. Subsequent line search directions should be found using the conjugate gradient expressions: = + where = % & You should continue successive line searches until the fractional change in energy found after successive searches is less than the tolerance EFracTolCG, < EFracTolCG. In debugging your code, you may want to insert print statements throughout to see the progression of the potential energy during the minimization iterations. Part c Write module-level code that systematically loops from = 2 to = 25 (inclusive). For each particle number, your code could should do the following: Perform + minimizations, each one starting from a different random configuration of particles. The + minimized energies should be put in a list. Display the minimum, average, and standard deviation of the minimized energies for the + trials.

For your simulation runs, use the following parameters (typical for this kind of system): EFracTolLS = 1.e-8 EFracTolCG = 1.e-10 the step size dx = 0.001 For placing particles initially in a cubic volume, = -, choose - such that the average number density of particles (/,) is equal to 0.001. Part d Plot the minimum and average energies as a function of for each of + = 100, 1000, and 10000. Your simulations may take several hours to finish for the last case. Can you estimate where you have been able to find the global minimum? Note: you can turn on real-time visualization of the minimization if you have VPython installed, which should be included with Python(x,y). Set the variable UseVisual = True in the code template and download the module atomvis.py from the course website and place it in the same folder as your script. However, visualization will slow your code by 10-20%. Part e Compare your results to the known global minimum energies, taken from [Leary, J. Global Optimization 11, 35 (1997)]. You can download these values from the course website. Add this curve to your graph. Why might your results be higher? min min min 2 1.000 10 28.4225 18 66.5309 3 3.000 11 32.7660 19 72.6598 4 6.000 12 37.9676 20 77.1770 5 9.1038 13 44.3268 21 81.6846 6 12.7120 14 47.8451 22 86.8090 7 16.5054 15 52.3226 23 92.8445 8 19.8215 16 56.8157 24 97.3488 9 24.1134 17 61.3180 25 102.3727

Part f From simple macroscopic arguments, we would expect that the energy of a cluster would scale with both the surface area (via a surface tension) and volume (via a bulk energy density). Thus, we could model the global energy minimum as macro =6+7 +8 Find the constants 6,7,8 by fitting your data in the +=10000 case. This fitting can be done by least-squares minimization using the Solver function in Excel, or you can use any other numerical software of your choice. Then, plot the difference between the true minimum energy and the expected macroscopic energy macro as a function of. Can you identify the magic numbers 13 and 19, which should correspond to lower energies than expected from the macroscopic scaling estimate? Part g ADVANCED TRACK For the case in which =13 and +=10000, add to your Python code a routine that will make a list of all of the unique energy values found from the + minimizations. Because your minimization routine is finite and will not return exact minimum energies, you will have to test whether or not two energies are within numerical tolerance. You can use the numpy function allclose(val1, val2, rtol, atol) for this purpose. This function will return True if val1 and val2 have a relative (fractional) difference less than rtol and an absolute difference less than atol. Use atol=1.e-4 and rtol=1.e-6 in your code. Then, sort the list from minimum to maximum energy. Make a plot of the energies as a function of their rank (i.e., 0 for the minimum energy, 1 for the next highest, 2 for the next, and so on) for rank 0 to 200. Also, indicate the number of unique minima found. For comparison, Doye and coworkers [Doye, Miller, and Wales, J. Chem. Phys. 111, 8417 (1999)] used advanced minima-finding algorithms to determine that there are 1467 unique minima. What to turn in For the assignment, submit a printout of your two graphs in parts d/e, f, and g. Be sure to clearly label all axes and curves. In addition, print a copy of your Python code for reference and attach it to the back of these.