Visualizing the Energies of Screw Dislocations

Pooja Reddy     3.016      Fall 2017

needed functions

particleForcesAndEnergues uses the positions of each pair of particles, and returns a list of forced computed using normalized Lennard Jones Potential (1/(r^12))-(1/(r^6)) and a list of particle energies. This function works for both 2 dimensional and 2 dimensional  particles.

particleForcesAndEnergiesCompiled= Compile[{{positions,_Real,2}}, 
Block[{distanceMatSquared,distanceMatSixth, differenceMat,ret},
differenceMat = Outer[Subtract,positions,positions,1] ;
distanceMatSquared =DistanceMatrix[positions, DistanceFunction->SquaredEuclideanDistance] + IdentityMatrix[Length[positions]];
distanceMatSixth= distanceMatSquared^3;
Flatten[{  (*exponents wrong*)
Total[((-12 differenceMat) ( 1-distanceMatSixth))/distanceMatSquared^7],
Total[(1/distanceMatSixth) - (2/(distanceMatSixth^2))]
}]
]
]

particleForcesAndEnergies[positions_]:= Module[{res},
res = particleForcesAndEnergiesCompiled[positions];
{Partition[Take[res,2 Length[positions]],2],
Take[res,- Length[positions]]}
]

This function takes the calculated energies of particles and creates a list of colors. One extreme of the color spectrum is for low energy, the other is for high energy.

colorEnergies[val_,emin_,emax_]:=ColorData["TemperatureMap"][Rescale[val,{emin,emax},{0,1}]]

These functions below take the energies of particles, and assign an opacity to a particle depending on their energy. The higher energy particles are more opaque. There are two. One for the cubic system, and one for the hexagonal close packed system.

opacityEnergies[val_,emin_,emax_]:=Opacity[Clip[(1-(Rescale[val,{emin,emax},{0,1}])),{0.05,1}]]

opacityEnergies[val_,emin_,emax_]:=Opacity[Clip[Rescale[val,{emin,emax},{0,1}],{0.05,1}]]

Points2D makes a 2 dimensional square lattice of a certain dimension.

points2D[dim_]:=Tuples[Range[0,dim],2]

Defects in Crystals

Crystal structures have underlying lattice structures, but in reality they are rarely perfect. They have mistakes in them, known as defects.

a point defect can be a vacancy or an interstitial

dislocations are linear defects

http://inspirehep.net/record/1094489/plots

Defects have an affect on the 3 dimensional lattice!

Why do we care about Defects?

They affect materials properties!

Some properties depend on/ are determined by defects:

	-conductivity (semiconductors)
	
	
	-hardness, ductility
	
	
	-diffusion coefficient

http : // mainland.cctt.org/istf2011/pages/Background/UsingRadiation.asp
http://forums.trovegame.com/showthread.php?116146-Brass-Dragon
https://en.wikipedia.org/wiki/File:Chemical_surface_diffusion_slow.gif

Energy of Defects

Lattices exist because they are low energy configurations

Errors in the lattice, like defects, should increase the energy of the lattice



how can we think of the energy of  atoms in a lattice?

Calculating energy of particles using Lennard-Jones Potential

approximates the interaction between a pair of neutral atoms

Helps find bond length! Bond length - distance  corresponding to the minimum potential energy

but how about in a lattice, with lots of atoms? Energy still wants to be minimized

atoms then try to sit in the minimum of multiple energy wells! A lattice, with a regular structure, lets atoms be at defined, comfortable distances from each other, which helps explain why this is a low energy configuration

So how would defects affect the energy of particles in a lattice?

Visualizing the energies of Defects

explored defects:
-vacancies  (in a 2D lattice)
-screw dislocations (in a 3D lattice)

Vacancy

coloring : red is high energy, blue is low energy

notice:
surface energy
energy around vacancy vs undisturbed lattice

a vacancy in a 2D square lattice

(* creating a lattice 10 by 10 *)
tenPoints=points2D[10];
(* picking a point to be a vacancy, and removing that atom from the made lattice *)
pointsToPlot1=tenPoints[[RandomInteger[{1,100}]]];
finalPoints=DeleteCases[tenPoints,pointsToPlot1];
(* calculating the forces and energies for the particles*)
{forces, energy} = particleForcesAndEnergies[finalPoints];
 (*visualizing the particles *)
Graphics[
{Black, Rectangle[{-1,-1},{11,11}],MapThread[{colorEnergies[#1,Min@energy,Max@energy],Disk[#2,.48]}&,{energy,finalPoints}]}]

multiple vacancies moving through a 2d square lattice

(* creating a lattice 10 by 10 *)
tenPoints=points2D[10];
(* defining directions the vacancies can move *)
directions={{-1,0},{1,0},{0,1},{0,-1}};
(*picking 3 vacancies int eh crystal *)
ptsToPlot={Table[tenPoints[[RandomInteger[{1,100}]]],3]};
(* makes a list of positions as vacancies move*)vacancyMovingPos[n_]:=Table[ptsToPlot=Append[ptsToPlot,#+directions[[RandomInteger[{1,4}]]]&/@ptsToPlot[[-1]]],n][[-1]];
dir=vacancyMovingPos[100];
(* takes the list of vacancy positions, and actually removes from from the lattice *)
deleteParticles[points_,vacancies_]:=
Module[{points1,points2,points3},
points1=DeleteCases[tenPoints,vacancies[[1]]];
points2= DeleteCases[points1,vacancies[[2]]];
points3= DeleteCases[points2,vacancies[[3]]]
];
pos=deleteParticles[tenPoints,#]&/@dir;
(* calculating forces and energies for the system, and visualizing *)
DynamicModule[{i,forces,energy},
With[{},
Manipulate[
{forces,energy}= particleForcesAndEnergies[pos[[i]]];
Graphics[
{Black, Rectangle[{-1,-1},{11,11}],MapThread[{colorEnergies[#1,-4.5,-2.7],Disk[#2,.48]}&,{energy,pos[[i]]}]}]
,{i,1,50,1}
]
]
]

Clear[ptsToPlot]

Screw Dislocation

Cubic Lattice

coloring : red is high energy, blue is low energy

(* making list of all positions *)myPositions=Tuples[2 Range[-2.5,2.5],{3}]/.{x_,y_,z_}:> {x,y,z +0 ArcTan[x,y]/ Pi};
(* calculating forces and energies. Look at needed function section to see explanation of what some of the below functions do *)
{forces, energyList} = particleForcesAndEnergies[myPositions];
(* visualizing all the atoms in the cubic lattice. Note the high surface energies *)
Graphics3D[
{Opacity[0.6],
MapThread[{colorEnergies[#1,-0.882,-0.946],Sphere[#2,1]}&,{energyList,myPositions}]} ,
ImageSize->Large]

How does a screw dislocation look?

viewing the top layer

DynamicModule[{value,innerAtomIndices,forces,energyList,allP},
(* pre-computing energies and forces, so computation when demonstrating occurs faster *)
allP[a_]:= allP[a]=Tuples[2 Range[-3.5,3.5],{3}]/.{x_,y_,z_}:> {x,y,z +a ArcTan[x,y]/ Pi};
Table[
{forces[N[value]], energyList[N[value]]} = particleForcesAndEnergies[allP[value]],
{value,0,2,.1}];
Table[
{forces[value], energyList[value]} = particleForcesAndEnergies[allP[value]],
{value,0,2,1}];

With[{atoms=Tuples[2 Range[-3.5,3.5],{3}]},
(* only visualizing top atoms, so can see how energy changes ignoring surface energies *)
innerAtomIndices =Position[atoms,{a_,b_,c_}/;!(a== -7 || a == 7 || b== -7 ||b == 7|| c!=5)];

(* visualizing the top layer of a screw dislocation *)
Manipulate[
Graphics3D[{
Opacity[0.5],
MapThread[{colorEnergies[#1,-0.874,-0.880],Sphere[#2,1]}&,{Extract[energyList[value], innerAtomIndices],Extract[allP[value], innerAtomIndices]}],
Opacity[1],Black,Arrow[Tube@{{0,0,6},{0,0,6+ 2*value}}]},
ImageSize->Large],

{{value,0,Style["Burger's vector",16]},0,2,.1},
SaveDefinitions->True,
BaseStyle->Large
]

]
]

Simulation

DynamicModule[{value,innerAtomIndices,forces,energyList,allP},

(* pre-computing energies and forces, so computation when demonstrating occurs faster *)
allP[a_]:= allP[a]=Tuples[2 Range[-3.5,3.5],{3}]/.{x_,y_,z_}:> {x,y,z +a ArcTan[x,y]/ Pi};
Table[
{forces[N[value]], energyList[N[value]]} = particleForcesAndEnergies[allP[value]],
{value,0,2,.1}];
Table[
{forces[value], energyList[value]} = particleForcesAndEnergies[allP[value]],
{value,0,2,1}];


With[{atoms=Tuples[2 Range[-3.5,3.5],{3}]}
,
(* only visualizing inner atoms, so can see how energy changes ignoring surface energies *)
innerAtomIndices =Position[atoms,{a_,b_,c_}/;!(a== -7 || a == 7 || b== -7 ||b == 7|| c== -7 ||c == 7 )];

(* visualizing the inner atoms of a screw dislocation *)
Manipulate[
Graphics3D[{
Opacity[opacity],
MapThread[{colorEnergies[#1,-0.874,-0.879],Sphere[#2,1]}&,{Extract[energyList[value], innerAtomIndices],Extract[allP[value], innerAtomIndices]}],Opacity[1],
Black,Arrow[Tube@{{0,0,6},{0,0,6+ 2*value}}]},
PlotRange->If[all,All,{{0,8},All,All}],
ImageSize->Large],

{{value,0,Style["Burger's vector",16]},0,2,.1},
{{all,True,Style["All or Half",16]},{True,False}},
{{opacity,0.5,Style["Opacity",16]},0,1,.1},
SaveDefinitions->True,
BaseStyle->Large
]

]
]

viewing the screw dislocation

Higher energy is more opaque. Can look through the lattice

DynamicModule[{value,forces,energyList,innerAtomIndices,allP},

(* pre-computing energies and forces, so computations when adjust alpha, thus opacity, occur faster *)
allP[a_]:= allP[a]=Tuples[2 Range[-3.5,3.5],{3}]/.{x_,y_,z_}:> {x,y,z +a ArcTan[x,y]/ Pi};
Table[
{forces[N[value]], energyList[N[value]]} = particleForcesAndEnergies[allP[value]],
{value,0,2,.1}];
Table[
{forces[value], energyList[value]} = particleForcesAndEnergies[allP[value]],
{value,0,2,1}];

With[{atoms=Tuples[2 Range[-3.5,3.5],{3}]},
(* only visualizing inner atoms, so can see how energy changes ignoring surface energies *)
innerAtomIndices =Position[atoms,{a_,b_,c_}/;!(a== -7 || a == 7 || b== -7 ||b == 7|| c== -7 ||c == 7 )];

(* visualizing the inner atoms of a screw dislocation *)
Manipulate[
Graphics3D[{
MapThread[{opacityEnergies[#1,-0.875,-0.882],
colorEnergies[#2,-0.874,-0.880],Sphere[#3,1]}&,{Extract[energyList[value], innerAtomIndices],Extract[energyList[value], innerAtomIndices],Extract[allP[value], innerAtomIndices]}],
Opacity[1], Black,Arrow[Tube@{{0,0,6},{0,0,6+ 2*value}}]},
PlotRange->If[all,All,{{0,8},All,All}],
ImageSize->Large],

{{value,0,Style["Burger's vector",16]},0,2,.1},
{{all,True,Style["All or Half",16]},{True,False}},
SaveDefinitions->True,
BaseStyle->Large
]

]
]

Hexagonal Close Packed Lattice

coloring : yellow is high energy, blue is low energy

(* defining the hcp lattice *)
hcpBasisVectors = {{1,0,0},{1/2, Sqrt[3]/2,0},{0,0,Sqrt[8]/3}};
latticeIndices3D = Tuples[Range[-4.5,4.5],{3}];
hcp =Map[#.hcpBasisVectors &, latticeIndices3D];

DynamicModule[{value,forces,energyList,indices,allP},

(* pre-computing energies and forces, so computation when demonstrating occurs faster *)
allP[a_]:= allP[a]=hcp/.{x_,y_,z_}:> {x,y,z +a ArcTan[x,y]/ Pi};
Table[
{forces[N[value]], energyList[N[value]]} = particleForcesAndEnergies[allP[value]],
{value,0,2,.1}];
Table[
{forces[value], energyList[value]} = particleForcesAndEnergies[allP[value]],
{value,0,2,1}];

With[{},
(* only visualizing inner atoms, so can see how energy changes ignoring surface energies *)
indices =Position[hcp,{a_,b_,c_}/;(Sqrt[Abs[a]^2+Abs[b]^2])<3&&0<c<1];

(* visualizing the inner atoms *)
Manipulate[
Graphics3D[
{Opacity[0.5],
MapThread[{colorEnergies[#1,-10,-7],Sphere[#2,0.5]}&,{Extract[energyList[value], indices],Extract[allP[value], indices]}] ,
Opacity[1], Black,Arrow[Tube@{{0,0,1},{0,0,1+ 2*value}}]},
ImageSize->Large],

{{value,0,Style["Burger's vector",16]},0,2,0.1},
SaveDefinitions->True
]
]
]

Simulation

(* defining the hcp lattice *)
hcpBasisVectors = {{1,0,0},{1/2, Sqrt[3]/2,0},{0,0,Sqrt[8]/3}};
latticeIndices3D = Tuples[Range[-4.5,4.5],{3}];
hcp =Map[#.hcpBasisVectors &, latticeIndices3D];

DynamicModule[{value,forces,energyList,indices,allP},

(* pre-computing energies and forces, so computation when demonstrating occurs faster *)
allP[a_]:= allP[a]=hcp/.{x_,y_,z_}:> {x,y,z +a ArcTan[x,y]/ Pi};
Table[
{forces[N[value]], energyList[N[value]]} = particleForcesAndEnergies[allP[value]],
{value,0,2,.1}];
Table[
{forces[value], energyList[value]} = particleForcesAndEnergies[allP[value]],
{value,0,2,1}];

With[{},
(* only visualizing inner atoms, so can see how energy changes ignoring surface energies *)
indices =Position[hcp,{a_,b_,c_}/;(Sqrt[Abs[a]^2+Abs[b]^2])<3&&Abs[c]<3];

(* visualizing the inner atoms*)
Manipulate[
Graphics3D[
{Opacity[opacity],
MapThread[{colorEnergies[#1,-10,-7],Sphere[#2,0.5]}&,{Extract[energyList[value], indices],Extract[allP[value], indices]}] ,
Opacity[1], Black,Arrow[Tube@{{0,0,3},{0,0,3+ 2*value}}]},
PlotRange->If[all,All,{{0,4},All,All}],
ImageSize->Large],

{{value,0,Style["Burger's vector",16]},0,2,0.1},
{{all,True,Style["All or Half",16]},{True,False}},
{{opacity,0.5,Style["Opacity",16]},0,1},
SaveDefinitions->True
]
]
]

viewing the screw dislocation #1

Higher energy is more opaque. Can look through the lattice

(* defining the hcp lattice *)
hcpBasisVectors = {{1,0,0},{1/2, Sqrt[3]/2,0},{0,0,Sqrt[8]/3}};
latticeIndices3D = Tuples[Range[-4.5,4.5],{3}];
hcp =Map[#.hcpBasisVectors &, latticeIndices3D];
DynamicModule[{value,forces,energyList,indices,allP},

(* pre-computing energies and forces, so computation when demonstrating opacity occurs faster *)
allP[a_]:= allP[a]=hcp/.{x_,y_,z_}:> {x,y,z +a ArcTan[x,y]/ Pi};
Table[
{forces[N[value]], energyList[N[value]]} = particleForcesAndEnergies[allP[value]],
{value,0,2,.1}];
Table[
{forces[value], energyList[value]} = particleForcesAndEnergies[allP[value]],
{value,0,2,1}];

With[{},
(* only visualizing inner atoms, so can see how energy changes ignoring surface energies *)
indices =Position[hcp,{a_,b_,c_}/;(Sqrt[Abs[a]^2+Abs[b]^2])<3&&Abs[c]<3];

(* visualizing the inner atoms, can see how opacity changes as a function of energy *)
Manipulate[
Graphics3D[{
MapThread[{opacityEnergies[#1,-9,-7],
colorEnergies[#2,-9,-7],Sphere[#3,0.5]}&,{Extract[energyList[value], indices],Extract[energyList[value], indices],Extract[allP[value], indices]}] ,
Opacity[1], Black,Arrow[Tube@{{0,0,3},{0,0,3+ 2*value}}]},
PlotRange->If[all,All,{{0,4},All,All}],
ImageSize->Large],

{{value,0,Style["Burger's vector",16]},0,2,0.1},
{{all,True,Style["All or Half",16]},{True,False}},
SaveDefinitions->True
]
]
]

Above simulations- varied the magnitude of the Burger’s vector.
Defects can propagate through a lattice.

See how a screw dislocation propagates through a lattice

Fixed Burger's  vector (magnitude 1) , propagating the terminus of the screw dislocation

Cubic Lattice

DynamicModule[{corePosition, innerAtomIndices,forces,energyList,allP},

(* pre-computing energies and forces, so computation when demonstrating occurs faster. Using the Erf function to manipulate layers as the dislocaiton moves through *)
allP[corePosition_]:= allP[corePosition]=Tuples[2 Range[-3.5,3.5],{3}]/.{x_,y_,z_}:> {x,y,z - (((1+Erf[3(z- corePosition)]))/2) ArcTan[x,y]/ Pi};
Table[
{forces[N[value]], energyList[N[value]]} = particleForcesAndEnergies[allP[value]],
{value,-10,10,1}];
Table[
{forces[value], energyList[value]} = particleForcesAndEnergies[allP[value]],
{value,-10,10,1}];

With[{atoms=Tuples[2 Range[-3.5,3.5],{3}]
},
(* only visualizing inner atoms, so can see how energy changes ignoring surface energies *)
innerAtomIndices =Position[atoms,{a_,b_,c_}/;!(a== -7 || a == 7 || b== -7 ||b == 7|| c== -7 ||c == 7 )];

(* visualizing the inner atoms of a screw dislocation *)
Manipulate[
Graphics3D[{
Opacity[opacity],
MapThread[{colorEnergies[#1,-0.87,-0.88],Sphere[#2,1]}&,{Extract[energyList[value], innerAtomIndices],Extract[allP[value], innerAtomIndices]}], 
Opacity[1],Black,Arrow[Tube@{{0,0,value+1},{0,0,value-1 }}]},ImageSize->Large,PlotRange->If[all,All,{{0,8},All,All}]],

{{value,10,Style["Terminus of Burger's vector",16]},-10,10,1},
{{all,True,Style["All or Half",16]},{True,False}},
{{opacity,0.5,Style["Opacity",16]},0,1},
SaveDefinitions->True,
BaseStyle->Large
]
]
]

layer of high and low energy propagating through the lattice

can see the layers distort as the screw dislocation terminus passes through them

Hexagonal Close Packed

(* defining the hcp lattice *)
hcpBasisVectors = {{1,0,0},{1/2, Sqrt[3]/2,0},{0,0,Sqrt[8]/3}};
latticeIndices3D = Tuples[Range[-4.5,4.5],{3}];
hcp =Map[#.hcpBasisVectors &, latticeIndices3D];

DynamicModule[{corePosition, innerAtomIndices,forces,energyList,allP},

(* pre-computing energies and forces, so computation when demonstrating occurs faster *)
allP[corePosition_]:= allP[corePosition]=hcp/.{x_,y_,z_}:> {x,y,z - (((1+Erf[3(z- corePosition)]))/2) ArcTan[x,y]/ Pi};
Table[
{forces[N[value]], energyList[N[value]]} = particleForcesAndEnergies[allP[value]],
{value,-4,4,.2}];
Table[
{forces[value], energyList[value]} = particleForcesAndEnergies[allP[value]],
{value,-4,4,1}];

With[{
},
(* only visualizing inner atoms, so can see how energy changes ignoring surface energies *)
innerAtomIndices =Position[hcp,{a_,b_,c_}/;(Sqrt[Abs[a]^2+Abs[b]^2])<3&&Abs[c]<3];

(* visualizing the inner atoms of a screw dislocation *)
Manipulate[
Graphics3D[{
Opacity[opacity],
MapThread[{colorEnergies[#1,-11,-7],Sphere[#2,0.5]}&,{Extract[energyList[value], innerAtomIndices],Extract[allP[value], innerAtomIndices]}], 
Opacity[1],Black,Arrow[Tube@{{0,0,value+.5},{0,0,value-.5 }}]},ImageSize->Large,PlotRange->If[all,All,{{0,4},All,All}]],

{{value,4,Style["Terminus of Burger's vector",16]},-4,4,.2},
{{all,True,Style["All or Half",16]},{True,False}},
{{opacity,0.5,Style["Opacity",16]},0,1},
SaveDefinitions->True,
BaseStyle->Large
]
]
]

layer of high and low energy propagating through the lattice

Takeaways

-types of dislocations
-lattices are low energy configurations
-can use Lennard Jones Potential to calculate energies of atoms
-visualize the energy of defects: screw dislocations
	-varying the magnitude of the Burger’s vector
	-propagating the terminus of the Burger’s vector