QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: David1986 on October 29, 2016, 22:29

Title: define constraints for Left direction in graphene sheet
Post by: David1986 on October 29, 2016, 22:29
Hi
I want to calculate strain in graphen sheet and I have been done that with use of this tutorial:
http://docs.quantumwise.com/tutorials/youngs_modulus/youngs_modulus.html
As you can see in this tutorial we  use of  flow comments for  calculate strain in Right direction:

constraints = configuration.indicesFromTags("Right")
        for c in constraints:
            xyz = numpy.array(configuration.cartesianCoordinates()[c]) + numpy.array(self.__delta)
            configuration._changeAtoms(indices=[c], positions=[xyz]*Angstrom)

how can define this comment for Left direction?
Title: Re: define constraints for Left direction in graphene sheet
Post by: Anders Blom on October 29, 2016, 22:54
First of all, it's not a "comment"...
Second, why would you need to change the work flow, it will work fine for graphene too (with proper adjustments). It's not "strain in right direction", it's just moving the right-hand side atoms (while keeping the "left" atoms fixed) to strain the structure, but fixing the right and moving the left is completely symmetric and would give the same result.
Title: Re: define constraints for Left direction in graphene sheet
Post by: David1986 on October 30, 2016, 11:19
thank you for your comment
I want to employ strain to two sides (left,right) in the same time.
Title: Re: define constraints for Left direction in graphene sheet
Post by: Anders Blom on October 30, 2016, 23:45
Why? It will have no effect beyond what is already done. If you look carefully, you will see that the tags (and hence constraints) "left"/"right" only apply to the outermost layers of atoms. The entire structure is stretched, i.e. both the atoms on the left and right of the defect.
Title: Re: define constraints for Left direction in graphene sheet
Post by: David1986 on November 5, 2016, 16:30
I want to employ strain to two sides (left,right) in the same time like fig6 in this article:

Pei, Q. X., Y. W. Zhang, and V. B. Shenoy. "A molecular dynamics study of the mechanical properties of hydrogen functionalized graphene." Carbon 48.3 (2010): 898-904.

How can do this?
Title: Re: define constraints for Left direction in graphene sheet
Post by: Anders Blom on November 6, 2016, 22:19
As I said, that is exactly what you do with this script, the structure will be stretched on both left and right side of the defect. The label "right" is arbitrary, it could just as well have been called "label2" in the script. Look instead at how the actual structure changes as the strain is applied and you still see that both sides are moving, relative to the center.
Title: Re: define constraints for Left direction in graphene sheet
Post by: David1986 on November 29, 2016, 10:32
at first many thanks for your quid
in continue I want to extract data from  software but as you can see:

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")

data plot as png format, How can extract data from this figure?
Title: Re: define constraints for Left direction in graphene sheet
Post by: Anders Blom on November 29, 2016, 15:50
The "data" is in the variables "strain" and "stresses_factored"
Title: Re: define constraints for Left direction in graphene sheet
Post by: David1986 on November 30, 2016, 09:15
unfortunately, I can not open them, can I define my log file to save data? I need to extract data to file with .doc format
Title: Re: define constraints for Left direction in graphene sheet
Post by: Anders Blom on November 30, 2016, 09:37
Open?
print  strain
print stresses_factored
Title: Re: define constraints for Left direction in graphene sheet
Post by: David1986 on December 5, 2016, 09:06
I want to plot "strain" in Orgin,  I need to extract and transfer data from ATK to Orgin,how can I do this?
Title: Re: define constraints for Left direction in graphene sheet
Post by: Petr Khomyakov on December 5, 2016, 10:08
What do you mean by plot "strain"?
Title: Re: define constraints for Left direction in graphene sheet
Post by: Julian Schneider on December 5, 2016, 10:27
You can save the data to a .txt file by adding the following lines to your python script.

Code
save_array = numpy.array([strain * 100, stresses_factored.inUnitsOf(GPa)]).transpose()
numpy.savetxt('stress_strain.txt', save_array)

I  guess origin should be able to read this file otherwise you copy the content to a doc file.
Title: Re: define constraints for Left direction in graphene sheet
Post by: David1986 on December 19, 2016, 07:29
In the above code that gives the graph of stress versus strain. I want to get the graph of pressure versus strain. as you know the relationship between pressure and stress is :
P = 1 / 3 Tr [stress]
How do I enter this formula to in the code and plot the graph of pressure versus strain?
Title: Re: define constraints for Left direction in graphene sheet
Post by: Jess Wellendorff on December 19, 2016, 11:47
The trace is the sum of the diagonal elements in the 3x3 matrix:
P = (S[0,0] + S[1,1] + S[2,2]) / 3
where S is your stress tensor (in appropriate units).
Title: Re: define constraints for Left direction in graphene sheet
Post by: zh on December 19, 2016, 13:07
In the above code that gives the graph of stress versus strain. I want to get the graph of pressure versus strain. as you know the relationship between pressure and stress is :
P = 1 / 3 Tr [stress]
How do I enter this formula to in the code and plot the graph of pressure versus strain?

Graphene is a 2D system, the use of pressure may be not suitable.