Presentation is loading. Please wait.

Presentation is loading. Please wait.

CE 400 Honors Seminar Molecular Simulation Prof. Kofke Department of Chemical Engineering University at Buffalo, State University of New York Class 3.

Similar presentations


Presentation on theme: "CE 400 Honors Seminar Molecular Simulation Prof. Kofke Department of Chemical Engineering University at Buffalo, State University of New York Class 3."— Presentation transcript:

1 CE 400 Honors Seminar Molecular Simulation Prof. Kofke Department of Chemical Engineering University at Buffalo, State University of New York Class 3

2 2 Dimensions and Units 1. Magnitudes Typical simulation size very small –100 - 1000 atoms Important extensive quantities small in magnitude –when expressed in macroscopic units Small numbers are inconvenient Two ways to magnify them –work with atomic-scale units ps, amu, nm or Å –make dimensionless with characteristic values model values of size, energy, mass

3 3 Dimensions and Units 2. Scaling Scaling by model parameters –size  –energy  –mass m Choose values for one atom/molecule pair potential arbitrarily Other model parameters given in terms of reference values –e.g.,  2 /  1 = 1.2 Physical magnitudes less transparent Sometimes convenient to scale coordinates differently

4 4 D & U 3. Corresponding States Lennard-Jones potential in dimensionless form Parameter independent! Dimensionless properties must also be parameter independent –convenient to report properties in this form, e.g. P*(  *,T*) –select model values to get actual values of properties –Basis of corresponding states Equivalent to selecting unit value for parameters

5 5 Dimensions and Units 4. Corresponding States Example –Want pressure for methane at 0.0183 mol/cm 3 and 167 K –LJ model parameters are  = 0.3790 nm,  /k = 142.1 K –Dimensionless state parameters  * =  3 = (0.0183 mol/cm 3 )(3.790  10 -8 cm) 3 (6.022  10 23 molecules/mole) = 0.6 T* = T/(  /k) = (167 K)/(142.1 K) = 1.174 –From LJ equation of state P* = P  3 /  = 0.146 –Corresponding to a pressure P = 0.146 (142.1 K)(13.8 MPa-Å 3 /molecule )/(3.790Å) 3 = 5.3 MPa 53 bars

6 6 Units in Etomica 1. All internal calculations are based on a consistent set of units –Mass: amu or Dalton, 1/N A grams = 1.66  10 -24 grams –Length: Angstrom, 10 -10 meters –Time: picosecond, 10 -12 seconds Conversion to other units is done for input or output by a Device or Display Default action is to perform no conversion –Temperature is given as k B T, in units of amu-A 2 /ps 2 Default I/O unit system can be changed –MKS (CGS, English, atomic, etc. to be defined) –Lennard-Jones –At beginning of simulation, use (for example) setUnitSystem(etomica.units.UnitSystem.MKS);

7 7 Units in Etomica. 2. A Unit class has the information needed to perform conversions Unit formed from two elements –Prefix: milli, kilo, mega, nano, pico, etc. –BaseUnit: meter, gram, second, etc. –For example: import etomica.units; new Unit(Prefix.KILO, Gram.UNIT); –Can construct without prefix specified (none by default) Display/Device units specified with setUnit method setUnit(new Unit(Second.UNIT)); Lennard-Jones units use size and energy scales for conversions –By default,  = 3 Angstroms,  /k = 300K

8 8 Units and Spatial Dimensions Most often we simulate 2-dimensions systems –Easier to visualize Some physical quantities have units defined exclusively for 3-dimensional systems –Pressure: pounds per square inch, bars, mm Hg, etc. –Volume: cubic centimeters, liters, gallons, etc. Etomica offers two approaches –Report in appropriate 2-D units pounds per inch, Newtons per meter, square centimeters, etc. –Ascribe an artificial “depth” to the simulation Volume = (depth)  (area) Presently –LJ UnitSystem will report in appropriate 2-D units –MKS UnitSystem ignores the problem (a bug!)

9 9 Notes About Etomica Version now in use was completed in early June Much development/debugging of API proceeded over summer –Etomica GUI hasn’t yet been brought up-to-date –Progress now being made with it, and expected to become available Real Soon Now –In the meantime, please be patient! Etomica crashes in two known circumstances: –Assembly of incompatible components Soft potential with hard integrator, for example –Jamming of molecules with hard integrator

10 10 Equations of State 1. The “equation of state” is the pressure-volume-temperature behavior of a fluid (or solid) Consider: –What happens to the pressure as the volume decreases (density increases) at fixed temperature? –What happens to the density as temperature increases at fixed pressure? –Must it always happen this way? What is the law relating pressure, temperature, density? –Is it exact, like the law F = ma?

11 11 Equations of State 1. The “equation of state” is the pressure-volume-temperature behavior of a fluid (or solid) Consider: –What happens to the pressure as the volume decreases (density increases) at fixed temperature? It increases, always. –What happens to the density as temperature increases at fixed pressure? It decreases (hot expands), usually. –Must it always happen this way? Yes and no. What is the law relating pressure, temperature, density? –PV = nRT, the ideal gas law –Is it exact, like the law F = ma? No! (nor is F = ma, for that matter).

12 12 Equations of State 2. The ideal-gas law is, well, an idealization –Appropriate at low density, and (less so) at high temperature Real materials deviate from ideal-gas behavior –Repulsions between molecules tend to increase pressure above ideal –Attractions tend to decrease pressure below ideal Here’s an empirical equation of state for the 2-D hard sphere model –Note the adherence to ideal-gas behavior at low density –It is hard to make good, general-purpose equations of state for real materials

13 13 Monte Carlo Simulation: Buffon’s Needle Consider a grid of equally spaced lines, separated by a distance d Take a needle of length l, and repeatedly toss it at random on the grid Record the number of “hits”, times that the needle touches a line, and “misses”, times that it doesn’t –OK, do it!

14 14 Monte Carlo Simulation: Buffon’s Needle Consider a grid of equally spaced lines, separated by a distance d Take a needle of length l, and repeatedly toss it at random on the grid Record the number of “hits”, times that the needle touches a line, and “misses”, times that it doesn’t Buffon showed that the probability of a “hit” is This “experiment” provides a means to evaluate pi

15 15 Monte Carlo Simulation: Area of Circle Consider selecting many points at random in a unit square What is the fraction of the selections that lie in the unit circle? 1 1

16 16 Monte Carlo Simulation: Area of Circle Fraction falling in circle is given by the ratio of their areas This gives another experiment to measure pi Let’s try it!

17 17 Random Number Generation Random number generators –subroutines that provide a new random deviate with each call –basic generators give value on (0,1) with uniform probability –uses a deterministic algorithm (of course) usually involves multiplication and truncation of leading bits of a number Returns set of numbers that meet many statistical measures of randomness –histogram is uniform –no systematic correlation of deviates no idea what next value will be from knowledge of present value (without knowing generation algorithm) but eventually, the series must end up repeating Some famous failures –be careful to use a good quality generator linear congruential sequence Plot of successive deviates (X n,X n+1 ) Not so random!


Download ppt "CE 400 Honors Seminar Molecular Simulation Prof. Kofke Department of Chemical Engineering University at Buffalo, State University of New York Class 3."

Similar presentations


Ads by Google