How to design a molecular modelling simulation?

Molecular dynamics of polymer

The previous article talked about what parts need to be considered to setup a molecular modelling simulation. In this article, I'm taking a look at how to design a simulation: may it sounds similar to setup, but by the end of this you'll see how design tackles simulation on a grand scale! This is the next part in my series on MD for polymer modelling, so follow me for future updates on all things materials simulation!

Aspects of a Simulation

Aside from the initial files to explain how our particles work, the "setup" or pre-processing stage, there are more things to consider to design a good simulation. Fortunately, unlike the the setup stage, which tends to be repeated for each polymer you simulate, the design of the simulation is normally fixed across the range of models you test. Think of simulation design like experiment design: you can test 10 different polymers in the lab, but you trial them with the same instrument by repeating the same method. When it comes to modelling, the parameters can look very different from what goes on in the lab. The best example of this is the number of atoms in the system: this is meaningless when making kilograms of samples in the lab, but vital to the design of simulation. More atoms helps to improve the accuracy of simulations, especially for properties that require long range interaction like crystallinity. The trade off is computational cost, as more atoms means more calculation and a longer wall time for the simulation.

Ensembles

The core of molecular dynamics (MD) is statistical mechanics and the concept of ensembles is key to designing a good simulation. An ensemble defines the thermodynamics of a simulated system. By keeping a few parameters constant it's possible to have a sample that is thermodynamically consistent, regardless of the starting state of the particles, if given enough time to equilibrate. The choice of ensemble governs the properties you can simulate. For polymer simulations, the most common choices are the canonical NVT ensemble, or the isobaric-isothermal NPT ensemble. By controlling the number of particles N, the temperature T, the volume V or the pressure P, it's possible to measure a range of different material properties. The user needs to consider what properties they care about: you can't determine the density of a system using the NVT ensemble, as the volume can't change to best fit the system.

Time - And Not Wasting It

MD relies on integration to calculate the movement of atoms, which means breaking down movement into a series of steps. Choosing the size of this timestep, and how many timesteps to run for, are important parts of simulation design. Typically 1 femtosecond is used for atomistic simulations: it's small enough that it captures the hydrogen vibrations (which tend to be between 1-2 fs), but large enough that simulations don't take too long to equilibrate. Achieving equilibration is important for measuring material properties, as an unequilibrated sample is not reproducible, and likely wrong. However, deciding if a simulation is equilibrated is not easy. Some people run simulations for a long time (which in this context is nanoseconds...) which does equilibrate the system, but more often than not wastes computing resources. Equilibration can also be determined by checking if the potential energy or density of the system has converged and stayed constant. However, there's uncertainty over if the simulation has reached a local optimum energy, and not the global optimum energy! The image below shows the density of a system that appears to have equilibrated...but has it? There's no easy answer to equilibration, so it's best to experiment and understand your system.

Plot of density converging in MD simulation

Now that we've talked through the key stages to setup and design a simulation, we can get onto the main event! The next article will cover how to create a polymer network in MD so you can test key properties and start exploring new materials. We'll be using the terms discussed in the previous articles, so follow me and keep your eyes peeled in August. Until then, enjoy your simulations!

Previous
Previous

How to build a polymer with molecular simulation?

Next
Next

How to setup a molecular modelling simulation?