*2 )**(1/2.0) ) / len(x_coords) # Find cross-sectional area by multiplying circumference with length of a pi-bond pi_bond = 1.35 circumference = radius * 2 * numpy.pi area = circumference * pi_bond # Find volumes of CNT and of whole cell volume_cnt = area * strainer.lengths[-1] u1, u2, u3 = bulk_configuration.bravaisLattice().primitiveVectors() volume_cell = u1 * u2 * u3 # Factor the stresses to the volume of the CNT stresses_factored = numpy.array(strainer.stresses * (volume_cell / volume_cnt) )*eV/Angstrom**3 # Calculate the strain strain = (strainer.length() - strainer.length() ) / strainer.length() # Calculate Young's modulus in TPa print "Young's Modulus: ", (stresses_factored[-1].inUnitsOf(Pa) - stresses_factored.inUnitsOf(Pa) ) / float(strain[-1]) / 1e12, " TPa"
Finally, add a few lines of code that will save different parts of the calculation and plot the results using pylab.
# Save the result to a file. print strainer.length() nlsave("mdtrajectory_cnt.hdf5", md_trajectory, "MD") nlsave("mdtrajectory_cnt.hdf5",strainer.length(), "C length") nlsave("mdtrajectory_cnt.hdf5",strainer.stress(), "C stress") nlsave("mdtrajectory_cnt.hdf5",stresses_factored, "C stresses factored") # Plot stress-strain curve. import pylab pylab.figure() pylab.plot(strain * 100, stresses_factored.inUnitsOf(GPa)) pylab.title('CNT with Stone-Wales defect') pylab.xlabel('Strain (%)') pylab.ylabel('Stress (GPa)') pylab.grid(True) pylab.savefig("mdtrajectory_cnt_fig.png")
The script is now ready to be executed. You may download the script to
make sure you did the manual editing correctly:
Visualize and analyse the results¶
The nanotube lengths and stresses that occur during the MD simulation run
are saved in the
.nc file with different ID’s (“C length”, “C stress”,
and “C stresses factored”). These are used to produce the plot titled
mdtrajectory_cnt_fig.png, which is automatically saved in the
project folder. It shows the stress vs. strain relationship for the nanotube,
which is also shown below. The linear (elastic) behavior for small strains
make it possible to calculate Young’s modulus E for the nanotube,
defined as E = stress/strain.
With this procedure, the calculated Young’s modulus of the carbon nanotube with one Stone–Wales defect is around 2.3 TPa (it may vary across different MD runs). This is pretty far from the calculated value of 1.28 TPa for defect-free nanotubes [SPAS+99]. However, as shown in [KDE+98], nanotubes with defects have in general a higher Young’s modulus.
The figure above shows that the stress is negative for small stress levels, which means that the nanotube is actually under compressive stress until around 1.1% strain.
This could be avoided by running a geometry optimization step before running the MD calculation, which can be done using the Optimization block available in the Script Generator. However, for the strains investigated here, the CNT shows a linear stress–strain behavior, so the obtained Young’s modulus should not change significantly if a geometry optimization is performed first.
The data file
mdtrajectory_cnt.nc should be shown on the LabFloor.
Select the file and click the Movie Tool in the right-hand plugins panel.
The Movie Tool can be used to inspect MD trajectories; it will show a movie of
the simulation and data about energies and temperatures. The tool looks like
Right click the mouse and select Show bonds to visualize the bond connection between the carbon atoms.
Another useful plugin is the MD Analyzer, which can show the radial distribution, velocity distribution, and the kinetic energy distribution of the atoms in the system. A screenshot of the velocity distribution is shown below.
|[KDE+98]||(1, 2) A. Krishnan, E. Dujardin, T. W. Ebbesen, P. N. Yianilos, and M. M. J. Treacy. Young’s modulus of single-walled nanotubes. Phys. Rev. B, 58:14013–14019, Nov 1998. doi:10.1103/PhysRevB.58.14013.|
|[SPAS+99]||Daniel Sánchez-Portal, Emilio Artacho, José M. Soler, Angel Rubio, and Pablo Ordejón. Ab initio structural, elastic, and vibrational properties of carbon nanotubes. Phys. Rev. B, 59:12678–126