tag:blogger.com,1999:blog-56336022862430666712024-03-05T18:09:06.238-07:00MDSBruce Allenhttp://www.blogger.com/profile/17501369714580738278noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-5633602286243066671.post-475998073570823272016-07-03T00:41:00.001-06:002016-07-03T00:41:02.379-06:00Upgrades to Molecular Dynamics Studio in ProgressOne bad design decision I made was to use numerical atomtypes instead of the alphanumeric atomtypes the rest of the world uses. I did this to try to speed up achieving my masters thesis. At the time I had a lot of stuff happening in my life. Hopefully Summer of 2016 will be the Summer of Upgrades. The prototype changes for the WINDOWS uploaded to the SourceForge site.The new functionality is as follows:<br />
<br />
1. Us the CFF91.frc file as provided with MSI2LMP as distributed with LAMMPS is now the standard.<br />
2. PACKMOL now carries the alphanumeric atomtypes through from the MMP files to the final MMP file created.<br />
3. The NanoEngineer-1 CAD tool now puts the alphanumeric atomtypes in the MMP file.<br />
<br />
This upgrade includes the newest version of PACKMOL and MSI2LMP. I am working on building a<br />
multithreaded PACKMOL EXE so we can make use of multi-threaded processors.<br />
<br />
As always, if you use the tools please send me comments. I know I don't always answer. but I hope to solve that problem this summer.<br />
<br />
I intend/hope to have Linux and OSX versions of PACKMOL and MSI2LMP upgraded by 15 July, 2016.<br />
<br />
I have no time frame for a Linux NanoEngineer-1 yet. This has to be built from a different source tree and suffers more from and tool ignorance.Bruce Allenhttp://www.blogger.com/profile/17501369714580738278noreply@blogger.com0tag:blogger.com,1999:blog-5633602286243066671.post-7974556903242185262015-12-08T02:49:00.004-07:002015-12-08T02:49:45.557-07:00Constructing Systems of Molecules for Molecular Dynamics Simulations Using Self AssemblyIt's December 2015 and I have spent many an hour reading about how others build systems of molecules for molecular dynamics simulations. There are many ways to Rome and all have obstacles and suffer from problems and seem not to provide good, computationally quick and cheap solutions. My biggest problem since last October has been funding. I solved this problem in February of 2015 by going back to work full-time. Sadly, working full-time leaves much less time to devote to my research. This is why I have spent time reading papers on building systems. I have seen 12 step programs and and 21 step programs to build a system. The definition of a system is one or more molecules in equilibrium prior to running molecular dynamics (MD) to determine some physical property or perhaps to collect data for diffusion of small molecules in a polymer material. Digging deeper the monomers must be connected to form the polymer. Polymer chain lengths must be decided and constructed and the bonds between polymers must be constructed. The bonds between polymer chains are cross-links. This is where the fun begins. The number of and types of steps seem predicated on achieving some desired outcome for the initial simulation system. Outside of the theoretical (e.g. first principles) work of Flory (Rotational Isomeric State Theory), Theodorou and Suter ("Detailed Molecular Structure of a Vinyl Polymer Glass) the phenomenological concepts continue to rule system construction and therefore "free volume" concepts are invoked.<br />
<br />
Constructing a system is usually defined as the automation of the polymerization process and/or constructing bonds between polymers, where molecules are attached to one another. In the case of an epoxy system, DGEBA/IPD, one IPD molecule can cross-link with up to DGEBA molecules. This can result in a 3D networked system of monomers. Many of the reviewed approaches literally beat the system to death in terms of cycling temperature and pressure of the system based on chemistry of the system until it exhibits experimental properties of the macroscale system in simulation. The usual suspects compare the built system to experimental data via radial distribution functions and the like and declare success. How can one compare a simulated system with an experimental system? I suggest comparing elastic, shear, bulk moduli and density values to their experimental counterparts at specific temperature ranges. Using molecular dynamics (MD) one must average over some significant time duration to give an average (time independent) value. One can do something similar with Monte Carlo methods (MCM), but it does not contain the kinetic energy (KE). Based on many sources across many disciplines, one relies on the lowest system energy representing the most probable configuration, where configuration is geometry.<br />
<br />
Obviously, geometry and potential energy (PE) are related via force fields. MD subjects the simulated system to both potential and kinetic energy (KE) since MD provides velocity. Experimental physical properties such as moduli, density and glass transition temperature are are based on PE and KE and therefore dynamic. The interesting point is PE is usually negative and KE is positive. Looking at the equations for the CFF force fields like COMPASS one sees that a single molecule can have a zero PE value if every bond length, bond angle, out-of-plan and dihedral angles are all at their equilibrium values.Once energy is stored by distorting bond lengths and/or angles the system energy is decreased. The movement of atoms provide the kinetic energy, which increases the system energy. Of course multiple molecules create a system that must account for Van der Waals and Coulombic forces as COMPASS does. Forces between atoms are time varying and atoms are attracted and repelled based on proximity. If one were to take a snapshot in time of a system of molecules one would see atoms in all molecules at positions where bond lengths and angles away from the zero PE positions. Assuming that none of the molecules have a net delta velocity the system can be considered to be in equilibrium. Considering a mass of epoxy in an ocean of nitrogen molecules exerting 1 bar of pressure the epoxy would consist of bond lengths and angles dictated by the external forces. However, atoms in a material at some temperature must move as per normal modes of vibration with stretching, bending, rocking, and wagging motions. The result is no net translation or rotation. For molecules in close proximity their Van der Waals and Coulombic forces create a viscous-like environment to dampen movement.<br />
<br />
Obviously, in the real-world cross-links form in a nonequilibrium environment with mass transfer and most likely temperature gradients. Chemical reaction can be endo and/or exothermic. Molecular dynamics doesn't account for electronic configurations. There are some reactive force fields, but they are specific to certain types of chemical reactions. Barring advances in this area the question remains how does one get molecules to "assemble" themselves into the lowest energy conformations? So far, the literature cites using a proximity strategy. Once two molecules come close enough (e.g. 6-10 Angstroms) at their reactive sites a bond is created between the two molecules. This is the cross-link bond. The two molecules are now one molecule and the PE of the one molecule depends on the rotation of the smaller molecule around the newly formed bond and the length of the newly formed bond assuming the two original molecules don't collide. A human can connect the two molecules and with a little playing "eyeball" where the two molecules should be oriented to minimize the PE. Running a MMEM software will attempt to minimize the energy of the entire system. If the two molecules are bonded and the new bond forms deviates from the zero PE bond length or if the angles it forms deviate from the zero PE angles then the new molecule increases in PE. Time must be spent relaxing the system to a lower energy and there is no guarantee of moving the system to the best conformation. In summary, molecules need to move relative to one another, when they are in proximity they must be bonded together forming the cross-link and then the system PE must be adjusted. Proximity is a bad strategy for cross-linking.<br />
<br />
How do molecules move? The molecules or the atoms composing molecules can move by dynamic, static and energy methods. If one adds proximity cross-linking to these molecule movement methods one defines possible system construction methods. The current construction methods as follows:<br />
<br />
1. Dynamic Methods - Molecular Dynamics (MD) is obviously a time series of atom and molecule<br />
movements in a confined space. Molecules go whizzing around in space. force fields (think<br />
springs between atoms) are used to insure the molecules do actually translate and rotate according to Newton's laws. Proximity is used to cross-link molecules at reaction sites to form cross-links.<br />
<br />
2. Static Methods - Self-avoiding walks (SAW) and Packmol optimization methods fall into<br />
this category. Self-avoiding walks place atoms and test for collisions and backtrack when<br />
necessary and then try another direction to place atoms. Packmol calculates a packing<br />
optimization solution based on a penalty function for atoms with respect to one another and to<br />
geometric boundaries (e.g. walls ). Molecules are moved via a heuristics algorithm. Proximity is<br />
used to cross-link molecules at reaction sites to form cross-links.<br />
<br />
3. Energy Methods - Metropolis Monte Carlo Method (MMCM) and Simulated Annealing (SA) fall<br />
into this category. SA relies on reducing the system temperature of the system over the course of the computation. The probability of the small spatial move of a molecule is calculated accounting<br />
for the change in system energy and compared to a random number. Metropolis Monte Carlo<br />
Method is done with a single system temperature. The methods are not time-based and in many <br />
case higher energy moves are accepted that allow the system to bypass high energy barriers and <br />
hopefully find a lower system energy. Proximity is used to cross-link molecules at reaction sites<br />
to form cross-links.<br />
<br />
4. Other Method(s) - Genetic Algorithms, reactive force fields, etc...<br />
<br />
<br />
Packmol uses a penalty function to determine if the packing of molecules is successful. Packmol randomly distributes molecules in a given volume and then employs a linked-cell approach to determine if every atom of a molecule is at least 2 Angstroms from the atoms of all other molecules. The linked-cell approach linearizes this problem since only atoms in the linked-cell need to be compared drastically reducing the number of comparisons. Packmol uses heuristics to move molecules with large penalty functions to locations where molecules with low penalty functions are located. The linked-cell and proximity is just part of the penalty function calculation. Every atom has a list of restrictions. A simple system contains a single box restriction where all atoms must be inside the box. Unless the atom is very near the perimeter its restriction contribution is zero. An atom alone in a linked-cell has the same penalty function value. Simple restrictions such as the box boundary is read in from a configuration file. Every atom has a component contribution of the penalty function. Molecules with the highest penalty function are too close to other molecules and are translated and rotated close to molecules with the lowest penalty function values.<br />
<br />
GENCAN is used to minimize the penalty function described above. This is done by calculating the values based on atom proximity and restrictions. The penalty function is a function of the translation and rotation of the molecules in the system. A penalty function of zero guarantees no spearing, or bad dynamics for the system of molecules.<br />
<br />
When the atom proximity is being calculated atom types can be used to match the correct pair of atoms across two molecules. In the case of the DGEBA/IPD system the carbon and nitrogen atoms need to be some distance apart to support cross-linking (6-10 Angstroms). If this is the only criteria then bad geometry occurs due to the two molecules involved are not constrained enough to force GENCAN to consider only the dihedral angle between the two molecules. Also, the currently implemented heuristics often forces the two molecules in question apart making the cross-link much greater in length forcing the cross-link to be abandoned. Ideally, two molecules (e.g. IPD and DGEBA) are in proximity and a new restriction could be created that gets calculated in the restrictions section of the algorithm. This on-the-fly restriction (or dynamic constraint) now states that two atoms in different molecules must be some distance apart. As molecules move now the molecule that is to be cross-linked to it must move as well. The solution to this problem comes from the geometry of the sp3 nitrogen and the sp3 carbon involved in the cross-link site between the two molecules. The nitrogen has two hydrogens which come off during the reaction with the epoxide ring which provides the sp3 carbon. The key is if the carbon were to be located where one of the hydrogens are and if the nitrogen were to be located where one of the hydrogens is on the sp3 carbon then the nitrogen and carbon form an axis and the two molecules have the correct attitude relative to one another with the exception of their dihedral angle. By not fixing the dihedral angle, the molecules are free to rotate about their common axis using the GENCAN algorithm. This new approach developed is to specify the hydrogens that are not needed after cross-linking as having an atom type of zero. This is jokingly referred to as "zeronium." The "zeronium atoms are later removed when the molecular new system's machine part file is written. While they exist in the packing process they provide a coordinate to locate the other molecule's Carbon or Nitrogen atoms. The goal being to achieve the correct geometry in terms of bond lengths and bond angles initially and letting GENCAN solve the dihedral angle. Linking together molecules in this manner solves the problem of creating new molecules and allowing the cross-linked molecules to achieve new conformations over the course of the packing optimization. It solves the bad geometry problem by taking the ideal geometry as a first estimate.<br />
<br />
The heuristics algorithm become very different. The new algorithm becomes a process of "self assembly." If each molecule were a vehicle capable of navigating in 3D they could broadcast a need for other molecules to attach themselves to them. The attachment site coordinates are the data needed for an prospective molecule to change it's attitude in space to line up for attachment. This approach leads to a self assembly heuristics algorithm. Since two points in space are used to cross-link two molecules, the GENCAN algorithm is free to solve the dihedral angle. With the dynamic constraints moving a single molecule would require the cascading movement of multiple molecules. This is why moving free monomer molecules takes priority. Proximity is tested for during the GENCAN algorithm and dynamic constraints are created on the fly as well.<br />
<br />
The current Packmol software has no concept of "holes" or "voids" inside the box. Also, one successfully runs the software on successively smaller and smaller boxes until the algorithm fails to pack the molecules. Making the box bigger gets one back to a successful packing. This usually provides the smallest possible box with the least amount of "holes" in it. The new heuristics will require moving molecules to a new location in the box with the purpose of creating cross-links. The cross-link sites on each molecule are known and moving the IPD into proximity of the DGEBA or the otherway around will in fact create the permanent linkage between the molecules while the dynamic constraint that follows provides the correct geometry.<br />
<br />
The modifications to be implemented use the proximity penalty function algorithm to identify cross-link pairs. The cross-links are maintained in a new dynamic data structure. At the same time the new dynamic constraint is created for the carbon atom in the DGEBA molecule and the zeronium atom in the IPD molecule. The zeronium atom in the DGEBA is paired up with the nitrogen in the IPD molecule. The number of restrictions per atom is currently set at 10 and can be increased to handle these dynamic constraints. Unlike MD software, Packmol doesn't care when two atoms occupy the same space in this case it helps define the necessary geometry and to avoid overlaps and collisions. The coding of the Packmol enhancement is in progress and shows promise in self assembling the monomers to polymers and in creating cross-links.<br />
<br />Bruce Allenhttp://www.blogger.com/profile/17501369714580738278noreply@blogger.com0tag:blogger.com,1999:blog-5633602286243066671.post-1236025666302298742013-07-08T18:30:00.001-06:002013-07-08T18:30:18.394-06:00Running LAMMPS to run LAMMPS...<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: x-small; line-height: 18px;"><br /></span>
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">I naively</span><span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; line-height: 18px;"> believed one could build a system of molecules outside of LAMMPS and then pop the LAMMPS Geometry Input File into LAMMPS and run an ensemble (e.g. NPT, NVT, etc...) and have answers pop out the other end. I was first confronted with instantaneous pressure values which are alarming if you are new to molecular dynamics (or perhaps ignorant as I was). The pressure values are a topic for another blog entry. Looking at MD cell creation as the context of "running LAMMPS to run LAMMPS" one can say that we are all in the hunt for a free lunch in terms of a minimal total wall-clock time to achieve a correct answer from an MD simulation. The MD cell is the starting point. Build an MD cell close to physical reality and simulation can begin immediately. the devil is in the details. </span><br />
<span style="background-color: white;"><span style="color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;"><br /></span></span></span>
<span style="background-color: white;"><span style="color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">I have written about several methods to cross-link molecules. The static method </span><b style="line-height: 18px;">(see Cross-linked Polymers: Part I - Static Method)</b><span style="line-height: 18px;"> starts with an empty MD cell and attempts to create polymer chains composed of molecules atom-by-atom until the desired density is obtained. The desire is to have many polymer chains intertwined by this process in addition to the cross-linking that will occur when a monomer molecule is completely built and a curing agent molecule is started from its "hotspot" atom. A 3D network of monomers and curing agent molecules is built for each starting point in the MD cell. Since all polymer chains have different attitudes they should intertwine. The missing piece from the static cross-linking puzzle is the final system density - the target objective. Static cross-linking occurs without MD. Therefore, the kinetic energy component is missing. What happens when the system undergoes MD simulation? Hopefully, the short distance between atoms of different molecules does not cause bad dynamics. If the system does not achieve the desired density at state (i.e. temperature and pressure) are there too few degrees of freedom in the system? Is the system non-ergodic? Is it possible to constrain the placement of atoms of different molecules as some safe distance just as packmol does? An atom could be rotated such that it maintains its correct bond length, but this could force a recalculation for the positions of the other two hydrogen atoms in say a methyl group which were placed successfully prior to the atom in question.</span></span></span><br />
<span style="background-color: white;"><span style="color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;"><br /></span></span></span>
<span style="background-color: white;"><span style="color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">Static cross-linking is the Yin of MD cell creation while a dynamic cross-linker </span><b style="line-height: 18px;">(see Cross-linked Polymers: Part II - Dynamic Method I and Dynamic Method II)</b><span style="line-height: 18px;"> is the Yang. Dynamic cross-linking starts with an MD cell full of monomers, hopefully distributed to foster cross-linking without the need for significant diffusion of molecules where diffusion requires time. Dynamic cross-linking immediately solves the kinetic energy component by placing molecules at the correct distance apart for nonbonded conditions. Creating a bond between two molecules to partially create a polymer chain will reduce the volume occupied by the polymer since the bonded molecules are closer together. The random attitudes of the monomer and curing agent molecules ensure a polymer chain that follows a random path through the MD cell. Both MD and molecular mechanics energy minimization (MMEM) are required for every group of new cross-links created. Where the static method could recalculate conflicting atom positions using collision detection and rotation of atoms around a common axis the dynamic method avoids this through MMEM. Once cross-links are placed MMEM attempts to equilibrate the system. MMEM is used because there is no analytic function relating geometry and potential field to state (i.e. temperature and pressure). As monomers and curing agent molecules are connected to form polymers, their mobility decreases. The final system density, rate of cross-linking and final percentage of cross-linking is dependent on diffusion of the monomers and curing agent molecules. Could the initial distribution of monomers and curing agent molecules prevent the formation of a system with the desired density in a timely manner? Is the system non-ergodic? </span></span></span><br />
<span style="background-color: white;"><span style="color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;"><br /></span></span></span>
<span style="background-color: white;"><span style="color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">Both approaches create MD cells, but their final geometries will determine the amount of wall-clock time is needed to run LAMMPS for the system to be deemed valid for simulation. Perhaps simulated annealing (SA) is required to achieve a valid MD cell ready for simulation. I currently use SA to build my initial MD cell, which uses packmol with a MD cell full of oligomer rings. The rings are cross-linked monomers and curing agent molecules forming oligomers. Half my simulation time is spent in MD cell preparation via SA. It is used in conjunction with the NPT ensemble to achieve a desired density at state. Both methods discussed above lack an analytical function to relate geometry and potential field to state. </span></span></span><br />
<span style="background-color: white;"><span style="color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;"><br /></span></span></span>
<span style="background-color: white;"><span style="color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">Therefore, running LAMMPS to run LAMMPS is necessary - at least for me since I don't have the magic software to build fully equilibrated systems directly. I'm not complaining. Whether you are laughing or agreeing with my blog entries please drop me a line and let me know your opinion. I am finally starting on the design and code for a dynamic cross-linker today, July 8th, 2013. </span></span></span><br />
<span style="background-color: white;"><span style="color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;"><br /></span></span></span>
<span style="background-color: white;"><span style="color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;"><br /></span></span></span>
<span style="background-color: white;"><span style="color: #666666; font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span></span>Bruce Allenhttp://www.blogger.com/profile/17501369714580738278noreply@blogger.com0tag:blogger.com,1999:blog-5633602286243066671.post-17079583965505657682013-05-21T23:16:00.002-06:002013-05-22T08:54:29.518-06:00State of the UnionI suppose one of the main reasons for vaporware is the unintended situations we all find ourselves in the coarse course of daily events. I wanted to update this blog weekly and have had demands on my time I didn't expect - the first being medical. Definitely not life threatening, it continues to be life coloring. It has hampered my progress in my pursuit of knowledge, my research and of course my software development. I had hope to address a cross-linker software by now. That is my objective this summer in addition to running laboratory experiments in support of my molecular dynamics modeling.<br />
<br />
I just finished a two quarter class in Electrodynamics! What a rush! I have to admit many Materials Scientists walk around with one eye shut. One eye on mass and the other shut to charge. If anything my small simulations of DGEBA/IPD showed me the power of partial charges on matter and why Van der Waals forces are necessary for good simulations. I now have a much better understanding of polarization of materials in an electric field. I think it cleared up some questions I had about polarization in chemistry too. I suggest to all Materials Science majors to take Electrodynamics. Imagine the extra "dog pile" one could add to a molecular dynamics simulator - not "that" kind of dog pile, but the one where all the dogs jump on you because you have a hotdog in your hand. As the geometry of your molecule changes with time the partial charges could be recalculated. The electric field in the material would then change due to the redistribution of charge. The moving charges give rise to magnetic fields which can induce electric fields and vs versa! Griffiths' Electrodynamics text points out the wildly fluctuating fields inside matter at the microscopic level. How these fields affect diffusion, alignment of molecules, whether the fields help or hurt molecules to clump could affect reactions of water with polymers, and how charged molecules behave inside matter. Also, when materials are in a significant electro-magnetic field perhaps fun things happen to the molecules that are diffusing in the materials.<br />
<br />
This summer will provide freedom to work on the following:<br />
<br />
<br />
<ul>
<li>Health - new medication, continue my exercise program</li>
<li>Research - experiments into a variety of ways to damage siloxane materials and how to model such damage so changes in physical properties can be seen in MD simulations</li>
<li>Software - build a cross-linker</li>
<li>Research - how does electrodynamics fit into molecular dynamics simulations</li>
<li>Research - which force field or potential will work best for simulating siloxane materials such as PDMS</li>
</ul>
<div>
I will present weekly progress on the cross-linker and the technical details. Also, extending existing software into millions of atoms should prove interesting in terms of time efficient algorithms. I strongly believe that MDS could be a great multi-disciplinary teaching project across many fields of study. I look forward to discussing enhancements with all who are interested in enhancing this open source project. </div>
<div>
<br /></div>
<br />
<br />
<br />Bruce Allenhttp://www.blogger.com/profile/17501369714580738278noreply@blogger.com1tag:blogger.com,1999:blog-5633602286243066671.post-67827938501151461342013-02-23T21:40:00.004-07:002013-02-23T21:40:38.842-07:00LAMMPS Wish ListLarge-scale Atomic/Molecular Massively Parallel Simulator or LAMMPS is a fantastic research tool! When one looks at the list of features it's amazing that LAMMPS is so fantastic. One feature is the electric field. The following YouTube video shows the power of LAMMPS combined with an electric field capability.<br />
<br />
<a href="https://www.youtube.com/watch?v=lMBRnxbcRH4">https://www.youtube.com/watch?v=lMBRnxbcRH4</a><br />
<br />
How could LAMMPS need a wish list? Well I do have a wish list for LAMMPS. I'm not being ungrateful, I am wishing and willing to help add the following features to LAMMPS for my research. Features can be added to the proper source tree or to USER features. The following list will be updated as time goes on.<br />
<br />
1. Magnetic fields - adding this feature would allow small charged molecules to transport differently in a polymer matrix when in the presences of an electromagnetic field. Water moving in a polymer matrix comes to mind.<br />
<br />
2. Ultra-violet radiation damage and cross-linking capability - adding this capability would allow the study of a decomposing polymer matrix, the transport of low molecular weight material created due to damage and cross-linking in polymers. ReaxFF would be a good first starting point. I was thinking of bombarding the MD cell with phantom particles that would interact with atoms to cause bond scission and allowing ReaxFF to form a new bond or reform the broken bond.<br />
<br />
I know this is a short entry, but I wanted to get a placeholder for the topics out here. If you have comments I would enjoy hearing them.<br />
<br />
<br />
<br />Bruce Allenhttp://www.blogger.com/profile/17501369714580738278noreply@blogger.com0tag:blogger.com,1999:blog-5633602286243066671.post-22353911260255506682013-02-23T21:04:00.001-07:002013-02-23T21:04:58.428-07:00Cross-linked Polymers: Part III - Dynamic Method II<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;"><b>Welcome to Cross-linked Polymers Part III </b>which will examine an idea that could allow PACKMOL to generate cross-linked systems as it packs molecules. Adding such a capability to PACKMOL would be a great leap forward in building pseudo-random geometries that are in fact cross-linked!!! But first, I want to expand on an idea of fixed atoms from last time. Previously, I stated using a cross-linked MD cell in the fixed mode PACKMOL provides thus locking the polymer matrix in place and then adding water or other molecules into the space remaining in the polymer matrix. After having such a thought I only recently asked why couldn't one distribute monomers into the MD cell using a large tolerance between atoms of different molecules using PACKMOL and then run a second time with the monomers fixed and then have it pack cross-linking molecules into the remaining empty space? Being no free lunch, we must use the first output MMP file generated to create a PACKMOL input file specifying the coordinate of each monomer's baricenter (not the center of mass) and it's Euler angles in order to rotate it into the correct attitude to match the MMP file. This is not to horrible to generate. For thousands of monomers there will be the following entry in the PACKMOL input file:</span></span><br />
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;"><br /></span></span>
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">structure monomer.mmp</span></span><br />
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">number 1</span></span><br />
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">center </span></span><br />
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">fixed x,y,z,a,b,g</span></span><br />
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">end structure</span></span><br />
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; line-height: 18px;"><br /></span>
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Obviously, either a new piece of vaporware is needed to generate the fixed monomer portions of a second PACKMOL input file or PACKMOL could be extended to make multiple passes in order to build up an MD cell.</span><br />
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">In this case a second pass would recreate the monomers in fixed geometry and then the cross-linker molecules would be packed into spaces around them. An important question to ask about dynamic method one is where does the well mixed MD cell consisting of monomers and cross-linking molecules come from? As stated before the current PACKMOL packs the first molecule template followed by the second and so on. This segregates the molecules. If polymerization continues using dynamic method one we will eventually have a system that will not allow the diffusion of monomers or cross-linking molecules. Building a PACKMOL input file of alternating DGEBA and IPD molecules is doable with a Perl or Python script. <b>An now back to our irregularly schedule blog entry...</b></span></span><br />
<br />
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;"> PACKMOL uses constraints to put molecules as close together as possible without violating the user defined tolerance. In a nutshell, what if a dynamic constraint could be added to PACKMOL so that after adding DGEBA an IPD molecule is added but the "start point" on the DGEBA defines the position for a start point on the "to be added" IPD molecule. Remember, the molecular machine part file (MMP) created in NanoEngineer-1 can contain a "starting point", which I refer to as a "hot spot" If you think of a monomer in a polymer it has two hot spots. They are located at the sites where they react with other molecules. For my system of DGEBA and IPD these are at opposite ends of the monomer. DGEBA has two hot spots - male and female. IPD has four. IPD has two amine groups that have two hydrogens each. One IPD bonds with a maximum of four DGEBA. Therefore, if one wants to create a cross-linked epoxy system at 50 percent cross-linking one would specify only two of the IPD hot spots could be bonded and the number of IPD and DGEBA molecules would need to specified so that excess of either molecule does not occur - unless your system wants to study such a situation.</span></span><br />
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;"><br /></span></span>
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">PACKMOL software changes could be moderate to complex. PACKMOL would pack molecules in a different manner than today. PACKMOL would have to understand the hot spots. When it encounters a hot spot it would use the coordinates of the hot spot to place the other molecule. The molecule to place would be based on the information stored in the hot spot when created in NanoEngineer-1. If there were a 50 percent probability of placing another monomer or a cross-linking molecule at the hot spot PACKMOL would flip a coin. If an atom has multiple hot spots and one has a better chance of reaction then PACKMOL will use this information stored in the hot spot. This new approach to accessing molecules for packing will not affect the packing algorithm. <b>So what does this have to do with building cross-linked MD cells?</b></span></span><br />
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;"><br /></span></span>
<span style="color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">PACKMOL currently uses static constraints. One defines the MD cell dimensions and the tolerance between atoms of different molecules. One can select many 3-D MD cell shapes (e.g. spheres, boxes, etc...). Adding hot spots to PACKMOL will add a dynamic constraint. Every monomers would add two dynamic constraints as to where two IPD molecules have to exist. Specifying the placement of the hot spot of molecule B at tolerance distance from hot spot on molecule A sets up the necessary condition for cross-linking the two molecules. Keep in mind that PACKMOL will pack the molecules and maintain the value of the cost function over many attempts and then select the optimal packing configuration as the solution. Keep in mind that only the position of one hot spot is constrained while the attitude of the molecule to be place will vary in the packing algorithm.</span></span><br />
<span style="color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">PACKMOL will then write the best solution to an MMP file. </span></span><br />
<span style="color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;"><br /></span></span>
<span style="color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">The final product is special due to the distance between DGEBA and IPD molecules are now close enough to be cross-linked!!! Either another piece of vaporware could be written to cross-link the molecules or the code could be added to PACKMOL. The code will work as described in the "knitter" vaporware referenced in dynamic method one. The code will find the hot spots and the distances between molecules will be near perfect for cross-linking. The advantage of this approach is that LAMMPS does not need to execute to achieve cross-linking. The question is: is this really a dynamic method? Running LAMMPS in method one makes it dynamic. Running PACKMOL packing optimization is dynamic since multiple configurations of molecules are generated and cost functions calculated. Keep in mind that PACKMOL also allows for a pseudo-random seed to be specified allowing the researcher to generate multiple unique geometries for simulations. As mentioned in the "Cleaning House" article posted on 11 January, a structure cleaner would be a great piece of vaporware. I intend to test a structure cleaner against a final MD cell created using dynamic method two. This will be more complex given the number of molecules. </span></span><br />
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;"><br /></span></span>
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;">For those of you who read my blog please feel free to comment on my entries. I would love to hear your comments and please tell me where I am going wrong. I want to produce software that can be used. I welcome collaboration to create open source software for everyone. My next topic will address having to run LAMMPS prior to running LAMMPS. This is rather cryptic, but I have found that I must run LAMMPS on an initial MD cell to generate an initial MD cell at the correct density prior to going forward with simulations for scientific investigation. </span></span><br />
<span style="background-color: white; color: #666666; font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 18px;"> </span></span>Bruce Allenhttp://www.blogger.com/profile/17501369714580738278noreply@blogger.com0tag:blogger.com,1999:blog-5633602286243066671.post-80905093210523141162013-01-18T21:59:00.001-07:002013-02-23T17:00:32.281-07:00Cross-linked Polymers: Part II - Dynamic Method I<span style="font-family: Arial, Helvetica, sans-serif;"><span style="color: #666666;"><span style="line-height: 18px;">Welcome</span></span><span style="background-color: white;"><span style="color: #666666;"><span style="line-height: 18px;"> to part two of cross-linked polymers. I will cover a dynamic cross-linking approach where LAMMPS will put resin and curing agent molecules into motion and molecules will be bonded together external to LAMMPS. This approach is based on LAMMPS as a callable library from a larger cross-linker application. If anyone has invented this wheel why not at least give me some feedback. While reading the literature on molecular dynamics, it is easy to find descriptions of cross-linking. Many authors speak to creating some automation code and seem to never publish it. I suppose in order to be a molecular dynamic scientist one must fashion his or her own cross-linker - just as a Jedi must fashion his or her own light saber. Another piece of vaporware I am interested in building will do the following to create an amorphous polymer matrix:</span></span></span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: white; color: #666666; line-height: 18px;"><br /></span>
</span><br />
<ul>
<li><span style="color: #666666;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">The cross-linker application will defined an internal geometry data structure for all molecules taking part in the simulation. The data structure will consist of sub-structures defining molecules, atom types, individual atoms, bonds, angles and dihedral angles. All of this information will change over time as bonds are broken and others are created. As the cross-linking occurs over time the number of molecules will decrease! </span></span></li>
<li><span style="color: #666666;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">The "start points" previously defined in part one, to attach molecules, will be used in this new software for the same purpose. A DGEBA molecule will have two start points and an IPD molecule will have four start points. The user will define the probability of when an IPD molecule is attached to a DGEBA molecule and the same information for DGEBA molecule for an IPD or another DGEBA molecule. Keep in mind that your molecules my be different - just create a template for each one. </span></span></li>
<li><span style="color: #666666;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">A radius of reaction will be defined by the user for every start point. Only start points within the radius of reaction can be considered for cross-linking. Perhaps you flip a fair or unfair coin to determine if the cross-linking occurs or not. The software will be flexible enough to support this.</span></span></li>
<li><span style="color: #666666;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">A number of LAMMPS simulation steps will be defined by the user so that LAMMPS can be executed for this number of steps. The number of steps and the time duration could be based on your knowledge of the system kinetics. </span></span></li>
<li><span style="color: #666666;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">A maximum number of LAMMPS executions will be defined so that the cross-linker software does not execute forever. </span></span></li>
<li><span style="color: #666666;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">A desired cross-linking percent will be defined by the user to tell the cross-linker how far to execute.</span></span></li>
<li><span style="color: #666666;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">A user defined convergence value will be used to test cross-linking percentage so the cross-linker can terminate in the event the desired cross-linking could not be obtained.</span></span></li>
<li><span style="color: #666666;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">If specified, the cross-linker will tell LAMMPS to run a molecular mechanics energy minimizer, MMEM, to help take some of the stress out of the geometry created by the new bonds. Perhaps, prior to running the MMEM the software could be instructed to run the structure cleaner. I would like to see quantify how useful the structure cleaner could be in reducing times to achieve low potential energy values.</span></span></li>
<li><span style="color: #666666;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">The cross-linker will call LAMMPS to stir up the soup of resin and curing agent molecules and get the system away from bad dynamics.</span></span></li>
<li><span style="color: #666666;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">The cross-linker will run LAMMPS for some user defined number of simulation steps and return to the cross-linker so it can test molecule start points against one another for possible cross-linking.</span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="color: #666666;"><span style="line-height: 18px;">A new bond will be formed if the radius of reaction criteria is met and the number of molecules in the cross-linker will decrease </span></span><span style="color: #666666; line-height: 18px;">retyping atoms in the area of the new bond(s) will occur. </span></span></li>
<li><span style="color: #666666; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Some atoms will be deleted due to the cross-linking and will be removed from the simulation.</span></li>
<li><span style="color: #666666;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Termination criteria will be tested.</span></span></li>
<li><span style="color: #666666;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">LAMMPS will be executed again from inside the cross-linker program.</span></span></li>
</ul>
<span style="color: #666666;"><span style="font-family: Arial, Helvetica, sans-serif; line-height: 18px;">The above approach to "chemical reaction" will result in an amorphous cross-linked polymer. I intend to compare it to an approach using the ReaxFF. Additional infrastructure software will have to be modified to accomplish the goal of amorphous cross-linked polymers. One interesting feature of PACKMOL is that it packs the molecules given to it in a serial fashion. The first molecule is packed then the second and so on. This leads to a segregated MD cell. PACKMOL requires an enhancement to distribute all molecules across the entire MD cell volume. This will provide the best mixed environment for cross-linking. One work around is to create a PACKMOL input file that specifies DGEBA and IPD in alternating references for the total number of desired molecule in the MD cell. It you need one hundred of each this works well. </span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="color: #666666;"><span style="line-height: 18px;"><br /></span></span>
<span style="color: #666666;"><span style="line-height: 18px;">Another use of PACKMOL would take advantage of creating a fixed molecule structure, such as the cross-linked polymer created above, and then instruct PACMOL to distribute additional molecules into the structure. Fixed molecules are used only to take up space in the MD cell and the new molecules added will be no closer than the tolerance limit provided by the user. This approach will require converting the final cross-linked polymer MD cell into a molecular machine part (MMP) file so PACKMOL can read it. A small molecule could then be packed into a small portion of the MD cell that contains the cross-linked polymer. Water could be placed into a well defined MD cell at desired temperature and density. </span></span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="color: #666666;"><span style="line-height: 18px;"><br /></span></span>
<span style="color: #666666;"><span style="line-height: 18px;">The dynamic cross-linking approach will be prototyped by building software in C++ to do specific tasks. The "knitter" application will read a LAMMPS output file and build the MD cell geometry in MMP file format in order to check for "start points" that meet the reaction radius requirements and "knit" molecules together. Next, a new MMP file containing new geometry, atom types, molecules, etc. will be created. MSI2LMP will be used to create the new LAMMPS Geometry Input File and LAMMPS will be executed again base on the desired number of steps. All the applications involved will be called from a script.</span></span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="color: #666666;"><span style="line-height: 18px;"><br /></span></span>
<span style="color: #666666;"><span style="line-height: 18px;">Cross-linked Polymers Part III will examine an idea that could allow PACKMOL to generate cross-linked systems as it packs molecules. PACKMOL uses constraints to put molecules as close together as possible without violating the user defined tolerance - usually 2 angstroms, which stops atoms from different molecules from being too close. In a nutshell, what if a dynamic constraint could be added to PACKMOL so that after adding DGEBA an IPD molecule is added but the "start point" on the DGEBA defines the position for a start point on the "to be added" IPD molecule. </span></span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="color: #666666; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span>
<span style="color: #666666; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span>
<span style="color: #666666; font-size: x-small;"><span style="line-height: 18px;"><br /></span></span>
<span style="color: #666666; font-size: x-small;"><span style="line-height: 18px;"> </span></span></span>Bruce Allenhttp://www.blogger.com/profile/17501369714580738278noreply@blogger.com0tag:blogger.com,1999:blog-5633602286243066671.post-84798247239453801532013-01-11T02:14:00.001-07:002013-01-16T12:22:37.274-07:00Cleaning House & May the Force be with You!<b><span style="color: red;">Just a quick update on NanoEngineer-1. I have installed Windows 7 SP1 just to test NanoEngineer-1 in XP compatibility mode. Sadly, this was a failure. As far as Windows 7 is concerned I still have ditch the service pack. If you have any additional information on this problem please let me know. I also tried modes for Windows 7 and 2000 with no luck.</span></b><br />
<br />
<br />
I briefly mentioned potential energy of the molecules in my last post. NanoEngineer-1 has GROMACS molecular dynamics simulator integrated into it. This would be a great idea for LAMMPS too. You can draw a molecule and start up the simulator and then watch a movie of the molecule under dynamics. The cool part of this is bonds can be stretched to hugh lengths and the simulator does not break the bond during simulation. Instead the molecule experiences a hugh influx of energy and bounces around. How does one stop such behavior? One solution is to minimize the energy of the molecule(s) using the molecular mechanics energy minimizer provided by NE-1! The MMEM uses some algorithm such as steepest decent and calculates a local energy minimum for the system or for specific highlighted molecules. MMEM uses the NanoDynamics-1 force field. If memory serves me right it minimizes on bonds, angles and does not pay attention to dihedral angles. It appears to pay attention to molecules that are not bonded together and perhaps has something like Van der Waals forces. The down side of the MMEM is it takes a long time for large molecules and since you are only guaranteed a local minimum in energy you may be starting from a weak point on the potential energy surface. So waiting a long time and probably not getting what you want is no fun. It's time to go shopping for a better solution.<br />
<div>
<br /></div>
<div>
There are many chemistry applications on planet Earth and one is ChemSketch by ACD/Labs. I used it to draw molecules for school. I noticed that it had a "cleaner" feature. Not having the source code I can't look at how it does this cleaning of the structure so quickly. Knowing something about chemistry I can guess how the cleaner works. Let's face it atoms generally hate each other. A methane molecule has hydrogens spread out such that all five atoms are as far away from one another as possible. Molecules appear to want to maximize the space they occupy. So one idea is to allow atoms to assume ideal positions relative to one another based on hybrid orbitals. Sp1, Sp2 and Sp3 provide simple geometry to be used in placing atoms relative to one another. Of course not all atoms or groups of atoms are treated the same by a force field. Looking at COMPASS family of force fields one sees many equilibrium bond lengths between atoms based on their atom types. So the hybrid orbitals could be a good first step, but using the equilibrium bond lengths, bond angles, and dihedral angles from the desired force field would be even better! Besides a computer has nothing better to do than to recompute (x,y,z) positions for an atom relative to another atom based on the equilibrium values in the force field. Some of this data will be missing but the fall back would be to substitute generic values. </div>
<div>
<br /></div>
<div>
The molecule template created by NanoEngineer-1 contains cartesian coordinates. There is nothing wrong with this data format, but the force field data is in a format that chemists recognize immediately! The Z-matrix is used to represent a molecule or a system of atoms/molecules by their natural coordinates - bond length, bond angle, dihedral angle and out-of-plane angle. If you have used The Gaussian software you know about the Z-matrix. So in the interest of creating bad puns: in order to clean house you need the force to be with you! </div>
<div>
<br /></div>
<div>
My next piece of vaporware will be a cleaner software and hopefully be implemented in Python inside NanoEngineer-1. It will have a cleaner button on the GUI and will do the following behind the scenes: first a Z-matrix will be constructed from the cartesian coordinate data and some dummy atoms will be added to support the Z-matrix. The Z-matrix data structure is devoid of cartesian coordinates. The bond lengths, bond angles, dihedral angles and out-of-plane angles could be calculated and stuffed into the Z-matrix, but why bother. These values will be replaced with the correct data from the desired force field. Every atom carries an atom type from the force field and this allows the look up of the correct values to fill in the Z-matrix. Once completed, the Z-matrix will be transformed into a molecular machine part (MMP) internal representation within NanoEngineer-1. A single pass through the atoms should create the Z-matrix and a second pass should create the MMP internal representation. The effort is linear 2N!</div>
<div>
A final pass may be necessary to ensure that all atoms are as far away from their neighbors as possible. Since we are not calculating energy and doing a steepest decent minimization we may need to develop an objective function based on maximizing distance between atoms while maintaining equilibrium bond lengths, etc... The above is the easy part of the problem. The Van der Waals and Coulombic contributions in minimizing the overall system energy appear to be satisfied only by a full MMEM. Perhaps the structure cleaner will serve to provide a better starting point. One obvious use is to clean up manually cross-linked molecules drawn in NanoEngineer-1. I had manually cross-linked a few oligomers to attempt to get higher densities for the DGEBA/IPD system. The simulations ran much longer due to structure "dirtiness" created by my really long bond lengths. Since the oligomers contain cycles the software must handle such cases and not step through the structure forever! </div>
<div>
<br /></div>
<div>
Comments and suggestions are invited and encouraged here! </div>
Bruce Allenhttp://www.blogger.com/profile/17501369714580738278noreply@blogger.com1tag:blogger.com,1999:blog-5633602286243066671.post-38723773748486566442013-01-10T23:55:00.004-07:002013-01-16T23:08:35.592-07:00Cross-linked Polymers: Part I - Static MethodChemical reactions are fun! Throwing some resin monomers into a beaker and mixing them with a curing agent results in something greater than the sum of their individual molecules. Once it cures you have a material that should have been jammed between two things you wanted glued together or something you should have poured into a mold to make one of those vendetta masks I see on TV these days. All those molecules magically react with one another forming a 3D-network of molecules. monomers form bonds with other monomer molecules and with curing agent molecules.<br />
<br />
The world of molecular dynamics (MD) does in some cases support chemical reactions. The LAMMPS MD simulator supports the ReaxFF and sadly I have not devoted much time to it. Ignorance can be a dangerous thing. One could reinvent the wheel and look foolish especially if the wheel produced is not as good as a standard wheel. For what it does ReaxFF is a fantastic tool! It is 10-50 times slower than non-reactive force fields, but is NlogN in performance compared to quantum mechanical (QM) methods which are N^3! This is according work done by Adri van Duin in a power point I read online. Ideally, it would be fantastic to build a cell filled with DGEBA and IPD molecules and specify the ReaxFF force field and let LAMMPS build an initial cell to some desired level of cross-linking. ReaxFF is on my to do list. I am working on less creative and more brute force methods for creating cross-linked systems, which I plan to benchmark against the ReaxFF approach.<br />
<br />
My first attempt at cross-linking software is still vaporware. It is based on a static approach. The static approach is based on building molecules one atom at a time using a template to tell the software where to place the next atom relative to the previous atom. Starting points in the cell are randomly generated initially and a molecule to be built per starting point is randomly decided. Atoms are added to each of N molecules in a round-robin fashion giving nearly equal access to each molecule under construction. Each molecule is built in turn and positions on a molecule's structure is identified as a point where another molecule can be attached. If there are many molecules to choose from for this attachment then a random selection is made based on the odds supplied to the software. A DGEBA molecule has two places in its structure where either another DGEBA or an IPD can be attached. If the choice is 50:50 then a coin is flipped to choose one. Each DGEBA molecule contributes two new starting points to a stack of starting points in the software. The situation could become explosive! Every IPD molecule has four start ing points so explosive is an understatement! So what allows the software to terminate? The software uses several methods of termination. The first is to achieve a desired cell density. The second is collisions. Every molecule under construction could collide with another molecule being built! Which ever molecule that tests for and finds a collision is selected for deletion! This applies to molecules that attempt to leave the cell. The third and fourth tests used to terminate the molecule building process is to track the cell density and upon convergence to any value or after some user defined iteration limit the process terminates.<br />
<br />
What is collision detection? In the case of molecules it means that two atoms cannot occupy the same space. It also means that a bond cannot spear a ring structure. An atom should not occupy space between two bonded atoms. The book, "Real-time Collision Detection" by Christer Ericson provided me the knowledge about collision detection. Testing for collisions between points with points, lines (aka bonds) and planes (aka ring structures) , and lines with planes are being done in computer games and so it can be used in a much slower environment of building cells for simulation. Organic ring structures are represented by one or more unique triangular planes. Again, collision detection causes the current molecule to be erased and the starting point to be replaced with a hydrogen atom. The following structure shown below shows DGEBA like molecules being built atom-by-atom where the monomers are being assembled into chains simulating a polymerization process. Collision detection is not the Holy Grail. Software is not smart and every new atom, bond and plane needs to be tested for collisions against all the other atoms, bonds and planes!!! This is at least N^2 in effort! Fortunately, there are tricks discovered by smart people that can be employed to this problem. The one I use is to partition my cell into many cubes. Every atom, bond and plane belongs to at least one of these cubes. Testing against the atoms, bonds and planes in the cube where the new atom is placed drastically reduces the number of tests. Also, since the atoms in a molecule template do not collide with other atoms in the template by definition these comparisons can be ignored as well.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzzeAY8CUyr0DkMh_HYCDAGC2ZeDlqK928JhyKcIrQxnZj2Hb53ByXdiASpYBC1pDkUzhZiiyygbZ6cN1C2Xo_5yLtr2aHeSWtaog0MhyasgxJfyJitu0-cLfJ94SduJqEW2RnperplGg/s1600/SAW+DGEBA.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="342" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzzeAY8CUyr0DkMh_HYCDAGC2ZeDlqK928JhyKcIrQxnZj2Hb53ByXdiASpYBC1pDkUzhZiiyygbZ6cN1C2Xo_5yLtr2aHeSWtaog0MhyasgxJfyJitu0-cLfJ94SduJqEW2RnperplGg/s640/SAW+DGEBA.bmp" width="640" /></a></div>
<br />
<div style="text-align: center;">
"Polymerization" of DGEBA like molecules</div>
<br />
Notice in the image above that the monomers are in regular patterns that could possibly be the start of some crystalline or semicrystalline structure. This is a side benefit from the static cross-linking and could possibly result in other test cell geometries beyond amorphous cells. Randomly generating a new trajectory angle for each monomer attached to a chain could result in an amorphous structure assuming the chain does not turn back on itself thus negating a self avoiding walk or SAW. In face the name of the static cross-linking software is SAW.<br />
<br />
SAW creates trees of molecules bonded together growing throughout a volume. This process does not create a graph where a graph is a tree with multiple paths to a node and cycles. Each independent tree does not eventually cross-link to another in the cell. This is like a dendritic structure. Of course with enough chains entangled this approach to cross-linking may be good enough? As I pointed out on a previous post I used the oligomer approach to cross-linking for my graduate thesis work. PACKMOL packed the five oligomers into a cell and as an extra bonus entangled the oligomers.<br />
<br />
Another important issue is the potential energy of the molecules. If one draws the molecule template in NanoEngineer-1 with longer or shorter than expected bonds or angles that are too wide or narrow it is like storing energy in a spring. NE-1 is used to create the molecule template and the stress added will be placed into every molecule replicated by SAW. This energy is released at the beginning of simulation in LAMMPS and leads to failed simulations because atoms jump across CPUs. Bad dynamics are bad! I will have more to say about energy in a separate blog article soon.<br />
<br />
In part two I will cover a dynamic cross-linking approach where LAMMPS will put resin and curing agent molecules into motion and molecules will be bonded together external to LAMMPS. This approach is based on LAMMPS as a callable library from a larger cross-linker. If anyone has invented this wheel why not package up your source code and make a contribution to open source? Comments and suggestions are very welcome on this blog. You can't hurt my feelings because I have worked in the software industry for over 20 years and have a tough skin. Let's work together to build tools to build better students who will go to industry and have some understanding of real-world problems.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiByTXXyNK4hTEppCaAXMKeqQv5KWgkxs366sGUYjEKW4TfaXaP_43wpfQeeRAPLK6FkFCFeU6nz13aQk3Pj0cweS19KZLheD9eRTczWHjohIxk4PeOYVzezkb75XxJ78Yf6S8jr1h_P0/s1600/SAW+DGEBA+Detail.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="342" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiByTXXyNK4hTEppCaAXMKeqQv5KWgkxs366sGUYjEKW4TfaXaP_43wpfQeeRAPLK6FkFCFeU6nz13aQk3Pj0cweS19KZLheD9eRTczWHjohIxk4PeOYVzezkb75XxJ78Yf6S8jr1h_P0/s640/SAW+DGEBA+Detail.bmp" width="640" /></a></div>
<br />
<div style="text-align: center;">
Closeup of DGEBA like structures above</div>
Bruce Allenhttp://www.blogger.com/profile/17501369714580738278noreply@blogger.com6tag:blogger.com,1999:blog-5633602286243066671.post-40021728886529590962013-01-02T02:08:00.000-07:002013-01-02T02:08:00.287-07:00<h2 style="text-align: center;">
<span style="color: red;">Happy New Year 2013!!! PACKMOL, Chunks, Molecules & LAMMPS</span></h2>
<div>
<span style="color: red;"><br /></span></div>
<div>
I found an embarrassing bug in PACKMOL. Actually, in the modifications I made to PACKMOL. How could this happen? Writing software is not glamorous and often thankless. At the best of times the user should get their work done and at the worst of times the user is ready to fire the programmer! Software is defined as "code, data and documentation maintained in a specific configuration." I have a software engineering book that explains this. Explicit requirements for software are code, data and documentation. The implicit requirement is the former are maintained in a specific configuration. Sadly, I lost configuration! I had fixed this problem a while back and lost the changes. I have been working behind the scenes to build a better infrastructure to prevent this. I will soon host all my source code on Dropbox. I will have a directory structure on Dropbox and point my development tools at Dropbox. Of course this sounds silly to many software engineers. Why didn't I just host my project on github and forget about Source Forge? Why am I not using state of the art development practices? I will change my evil ways once this project attracts additional software developers and collaboration becomes critical. As of this writing, the software is alpha and in need of additional developers who want to own this project.<br />
<br />
Back to the bug I found. My modified PACKMOL reads and writes molecular machine part (MMP) files. This is a file format created by the NanoEngineer-1 molecular CAD application. I misplaced memory location of the molecule templates for all molecules after correctly processing the second molecule template. I also created a phantom molecule in the MMP file. I fixed this bug as well. Now the MMP file created by PACKMOL assigns a "chunk" to every molecule. What is a chunk? A chunk is a concept from NanoEngineer-1. It identifies one or more atoms. When you click on a chuck identifier inside the NE-1 CAD program the collection of atoms are highlighted in green. You can now move the entire chunk around on the screen. The funny thing is that the "mol" token is used in the MMP file to define a chunk. Someone must have originally wanted to make a chunk a molecule, but that did not happen completely. NanoEngineer-1 creates chunks willy-nilly. There can be one or more atoms in a chunk. A single molecule drawn in NanoEngineer-1 can contain many chunks as you create atoms as well as copy and paste existing atoms in order to save time drawing a molecule.<br />
<br />
When using NanoEngineer-1 the user must enter "Chunks" mode by clicking the chunks button. Upon existing chunks mode one can see the tree of chunks down the left-hand-side of the application. Again, clicking on one or more will highlight the chunks in the canvas showing the chunks in the molecule drawn. Selecting more than one chunk is done by holding down the shift button and clicking on the chunks in the tree. Looking at the icon menubar one sees an icon of three green squares and a black arrow pointing to a single green rectangle. The tooltip tells you this is a chunk combiner tool. If you use this tool to combine chunks into a single chunk then all combined chunks will be highlighted. This is important in using LAMMPS!<br />
<br />
LAMMPS has built into it the concept of a group-ID. This is a way to identify a group of atoms. For my purposes a group would be a molecule such as a water molecule floating around in a polymer matrix. LAMMPS also supports a full atom model. The model includes a molecule ID on every atom of a simulation. The molecule-Id can be used as a group-ID. One can parse LAMMPS output files for specific molecules and use trajectory data to create a path a molecule travels over the course of a simulation. In order to get this molecule data to LAMMPS correctly from NanoEngineer-1 and PACKMOL you need to follow some simple rules:<br />
<br />
1. Draw a single molecule per MMP file you create inside NanoEngineer-1. Once you have your single molecule completely drawn then combine the chunks into a single chunk.<br />
2. Let PACKMOL create your initial MD cell from multiple MMP files. The MMP file processing in PACKMOL will uniquely identify all molecules created from the MMP files.<br />
3. MSI2LMP reads and understands the chunks in the MMP file created by PACMOL and will assign unique molecule-IDs to all molecules when it creates the LAMMPS Geometry Input File.<br />
<br />
I hope the fixes to PACKMOL and this discussion about chunks and molecules help you in creating successful MD cells. I have seen many downloads to date, but have not received many, three, comments back. Open source is about helping people be successful by making quality software. I look forward to comments, and feature suggestions. PACKMOL should create quality MD cells from many molecules now.<br />
<br /></div>
Bruce Allenhttp://www.blogger.com/profile/17501369714580738278noreply@blogger.com3tag:blogger.com,1999:blog-5633602286243066671.post-68799694191555340222012-12-30T17:32:00.001-07:002013-01-02T21:33:44.031-07:00<h2>
<span style="color: red; font-family: Arial, Helvetica, sans-serif;"><b>Welcome to Molecular Dynamics Studio!!!</b></span></h2>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>What is Molecular Dynamics Studio? In an age of fantastic software products from extremely competent companies such as Accelrys, Materials Design and Scienomics, why create software in such a well-covered market? The truth is that MDS is simply a collection of open source software applications modified to use a common file format in order to create molecular dynamics cells and started life as part of a masters degree thesis project. As we can see from other academic projects some do rise to challenge commercial products, but the path I see for MDS is to offer projects in the academic environment for students in computer science, science and engineering. Perhaps enhancing MDS will help create better students? </b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><b><br /></b></span>
<span style="line-height: 18px;"><span style="font-family: Arial, Helvetica, sans-serif;"><b style="background-color: white;">The source forge site for MDS is at: </b></span></span><span style="font-family: Arial, Helvetica, sans-serif;"><span style="color: blue; line-height: 18px;"><b><a href="https://sourceforge.net/projects/moleculardynami/">https://sourceforge.net/projects/moleculardynami/</a></b></span></span><br />
<br />
<span style="line-height: 18px;"><span style="font-family: Arial, Helvetica, sans-serif;"><b style="background-color: white;">MDS is a collection of software modifications created to integrate NanoEngineer-1, PACKMOL and MSI2LMP for the purpose of easily creating molecular dynamics cells. NanoEngineer-1 is a molecular CAD software written by Nanorex and provides the user an easy way to create molecules, while the software modifications allow the user to type atoms using multiple force fields. PACKMOL can generate a random collection of molecules using the molecule templates from NanoEngineer-1 thus providing the initial MD cell. Modifications to PACKMOL allow the atom type data to be passed through to the MSI2LMP software. MSI2LMP creates a LAMMPS input file based on class I or class II force fields. MSI2LMP was modified to use numerically coded force field data generated by NanoEngineer-1. The MMP file format was extended and integrated into all three software applications. </b></span></span><br />
<br style="background-color: white; color: #555555; font-family: sans-serif; font-size: 13px; line-height: 18px;" />
<b>NanoEngineer-1 project:<span style="color: yellow;"> <a href="http://www.nanoengineer-1.net/">http://www.nanoengineer-1.net</a></span></b><br />
<br style="background-color: white; color: #555555; font-family: sans-serif; font-size: 13px; line-height: 18px;" />
<b>PACKMOL project:<span style="color: yellow;"> <a href="http://www.ime.unicamp.br/~martinez/packmol/">http://www.ime.unicamp.br/~martinez/packmol/</a></span></b><br />
<br style="background-color: white; color: #555555; font-family: sans-serif; font-size: 13px; line-height: 18px;" />
<b>LAMMPS project where MSI2LMP is part of the distribution:<span style="color: yellow;"> <a href="http://lammps.sandia.gov/">http://lammps.sandia.gov/</a></span></b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitsOr85upigspwVv69TjKV8Nv9oIgBHTxCfA7XjFO4PFORhPVFWRWhfy9kBISMqJT_Ce8BchvATQoezkJc8J4c6gPdEFsjgfcxGTo6mIN5sySH6Lf7UwKMdbHAj_fxYLmHVNYj31fuAa0/s1600/MDS-1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitsOr85upigspwVv69TjKV8Nv9oIgBHTxCfA7XjFO4PFORhPVFWRWhfy9kBISMqJT_Ce8BchvATQoezkJc8J4c6gPdEFsjgfcxGTo6mIN5sySH6Lf7UwKMdbHAj_fxYLmHVNYj31fuAa0/s1600/MDS-1.jpg" height="442" width="640" /></a></div>
<br />
<div style="text-align: center;">
<b>NanoEngineer-1 is the CAD software for MDS</b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirZngnvegsqimlHxgyOVexHB_YCgbn9now3zvWY5ebbd6lMl9rCVqUn1_-pbJAgr8rhy0fF0w-JISEA7VJrj-VWWms-mc48iJL_ULjsdjZyeR4uzyburW70XW9Pn3CpdSJsn_xtOkIWYQ/s1600/MDS-2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirZngnvegsqimlHxgyOVexHB_YCgbn9now3zvWY5ebbd6lMl9rCVqUn1_-pbJAgr8rhy0fF0w-JISEA7VJrj-VWWms-mc48iJL_ULjsdjZyeR4uzyburW70XW9Pn3CpdSJsn_xtOkIWYQ/s1600/MDS-2.jpg" height="632" width="640" /></a></div>
<br />
<div style="text-align: center;">
<b><span style="font-family: Arial, Helvetica, sans-serif;">The force field chooser was added to allow manual atom typing for now</span></b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQ-ZYQbnN5omfyogUYDuUN5Ytlll4Q-vdz227kpXdZByZ04S6gw9uh0BMXrLRxtMJ_9-d0ZXfrJYt1M0pl3K2hobaOVY7quZiJlPOdM02BaZRUEFmG-_nbd7tX_g2IqPUgPfgv9Z5dxl4/s1600/MDS-3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQ-ZYQbnN5omfyogUYDuUN5Ytlll4Q-vdz227kpXdZByZ04S6gw9uh0BMXrLRxtMJ_9-d0ZXfrJYt1M0pl3K2hobaOVY7quZiJlPOdM02BaZRUEFmG-_nbd7tX_g2IqPUgPfgv9Z5dxl4/s1600/MDS-3.jpg" height="548" width="640" /></a></div>
<br />
<div style="text-align: center;">
<b><span style="font-family: Arial, Helvetica, sans-serif;">Initial MD cell created by PACKMOL from five DGEBA_IPD oligomers</span></b></div>
<div style="text-align: center;">
<b><br /></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRa-qGi73Alefk0ci_-GzupsTAiTyZky88q7VMQlYvdHFkD25c8wHI_zdm6vpNuPozM7oo0EWeVFKAGxMopb9h9hZ_y3URFsV8nA9NzaIs8388bLyDrs0W2KfK7c1-9UQ6ZkHCU3DK39w/s1600/MDS-4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRa-qGi73Alefk0ci_-GzupsTAiTyZky88q7VMQlYvdHFkD25c8wHI_zdm6vpNuPozM7oo0EWeVFKAGxMopb9h9hZ_y3URFsV8nA9NzaIs8388bLyDrs0W2KfK7c1-9UQ6ZkHCU3DK39w/s1600/MDS-4.jpg" height="518" width="640" /></a></div>
<br />
<div style="text-align: center;">
<b><span style="font-family: Arial, Helvetica, sans-serif;">Annealed MD cell </span></b></div>
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><b>The following road map for MDS shows where MDS could go over time. If you are a student or a non-student and are interested in working on this open source project please consider working on this project.</b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><b><br /></b></span>
<br />
<ul>
<li><b style="font-family: Arial, Helvetica, sans-serif;">Modifications to NanoEngineer-1 molecular CAD software to include:</b></li>
<ul>
<li><b style="font-family: Arial, Helvetica, sans-serif;">structure cleaner </b></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><b>remove and replace deprecated python packages</b></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><b>port python code to newer versions of Windows, Linux and OS X</b></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><b>integrate LAMMPS to make its minimizer available</b></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><b>additional force fields </b></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><b>united atom support</b></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><b>automatic atom typing</b></span></li>
</ul>
<li><b style="font-family: Arial, Helvetica, sans-serif;">Modifications to PACKMOL software to include:</b></li>
<ul>
<li><b style="font-family: Arial, Helvetica, sans-serif;">add dynamic constraints to implement cross-linking</b></li>
<li><b style="font-family: Arial, Helvetica, sans-serif;">implement random placement of molecules</b></li>
</ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><b>Modifications to MSI2LMP software to include:</b></span></li>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><b>better way to handle force field data perhaps a database</b></span></li>
</ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><b>Creation of a Dynamic Cross-linking software:</b></span></li>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><b>calls LAMMPS to move monomers over time</b></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><b>cross-links monomers and curing agents based on proximity </b></span></li>
</ul>
</ul>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>The above road map presents many computer science, science and engineering problems. Solutions have been found by many companies and exist in commercial software today. The value proposition to the student or a programmer interested in open source software is to create or add to an existing portfolio for review by prospective employers. </b></span></div>
<br />
<br />
<br />Bruce Allenhttp://www.blogger.com/profile/17501369714580738278noreply@blogger.com5