22
Statistical Model Dr. Kasra Momeni www.KNanoSys.com

Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

Embed Size (px)

Citation preview

Page 1: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

Statistical Model

Dr. Kasra Momeniwww.KNanoSys.com

Page 2: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Outline• Diffusion

• ContinuumDescription• DiffusionCoefficient• SurfaceDiffusionModel

• RandomNumberGenerators• RandomWalkModel

• Pseudocode• Statistics

• Homework

AdHiMad Lab 2

Page 3: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Diffusion• Itisoneofthekeymechanismsformasstransportwithinmaterials

• Applications:• Carburisation:Carbonisdiffusedintothesurfaceofsteel

• NuclearWaste:Preventingradioactivewasteleakageduetodiffusion

• Semiconductors:Dopingprocess• Phase-Transformation:Diffusionofanexternalelementinthehostlattice

• Corrosion:Diffusionofthereactingelementwithinthemetals

AdHiMad Lab 3

https://www.doitpoms.ac.uk/http://elementsmagazine.org/http://volga.eng.yale.edu/MaterialsScienceandEngineering:A510(2009):342-349.https://upload.wikimedia.org/

Page 4: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Diffusion• Experimentalcalculationofthediffusionratesisverycumbersomeandinsomecasesnotpossible

• Computersimulationsprovideanalternativetool,withhigheraccuracy,andenablingstudyoftheunderlyingmechanisms

• Differentdiffusionmechanismsbasedondimensionality• BulkDiffusion:Alloys,phase-transformation,dislocationmotion• SurfaceDiffusion:Growthoffilmsand2Dmaterials• Edgediffusion:Morphologyof2Dmaterials

AdHiMadLab 4

2DMaterials,3(4),041003.2DMaterials,4(2),025029.ChemistryofMaterials 26.22(2014):6371-6379.

Page 5: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Diffusion• Diffusionisafunctionofdifferentphysicalparametersincluding:temperature,initialconcentration(initialvalue),surfaceconcentration(boundaryvalues),time,anddiffusivity(diffusioncoefficient)

• Diffusion(ContinuumFormulation)– Fick’sLaw!" = −%"&'" 1*+,-./'"/+

= −& 0 !" 223,-.

!" isthefluxofelementi,%" isitsdiffusioncoefficient,and'" istheconcentrationofi’th specie.• CombiningFick’s1st and2nd laws:

/'"/+

= & 0 %"&'"

AdHiMad Lab 5

Page 6: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Probability and Average • Whatisthelikelihoodofheadvstailwhenyouflipacoin?

50%-50%• Whatisthelikelihoodof1whenyourolladice

1/6~17%• Approximatelyhowmany1sappearsifwetossthedice120000times?

• Generalcase:npossiblestates,N(>>n) #trials,mi #state i• Probabilityofstatei

4" =5"

6

AdHiMad Lab 6

https://img.clipartfest.com/https://images.clipartof.com/

Page 7: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Probability and Average • Thesumofallprobabilitiesoverdifferentstatesshouldbeunity

74"

8

"9:

=75"

6

8

"9:

=1675"

8

"9:

= 1

• Weightedaverage:AssumingA tohasanonunity valueinstatei

; =1675"

8

"9:

0 ;" =74"

8

"9:

0 ;"

• Equivalentcontinuumequationsare:; = <4(>) 0 ; > 3>

�• Calculatingtheprobabilityfunctionaliskeyforfindingavalueofaproperty.

AdHiMad Lab 7

Page 8: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Probability in a Diffusive Process• ThediffusionofaspecieisgovernedbyFick’slaw

/'"/+

= & 0 %"&'"• Inaspecialcaseofasinglespecie,1D,sphericallysymmetricsystemwithconstantD,anda' >, 0 = C > :

/'/+= %&D';&D =

1FD

/D

/FDFD

/D

/FD

• Thesolutionwillbe' G, + =

18 I%+ J/D L

MNO PQR⁄

• Whatisthetotalconcentrationastimepasses?

<' G, + 4IFD3F�

= 1

AdHiMad Lab 8

Shewmon,P.,&Janßen,M.(2016).DiffusioninSolids.Springer.

Page 9: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Probability in a Diffusive Process• Whatistheaveragedisplacementofatoms?(Similarto2stmomentofarea)

F = <F' G, + 4IFD3F�

=4I�

%+�

• Whatistheaveragesquaredisplacementofatoms?(similartomassmomentofinertia)

FD = <FD' G, + 4IFD3F�

= 6%+

Thus% =

16+

FD

• WhileD isamaterialproperty, FD canbemeasuredfromsimulations• WehadassumedD=cte,thus FD mustbeproportionaltot

AdHiMad Lab 9

Page 10: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Notes on Diffusion • Imperfectionsinthematerialaffectthediffusionrate

• Defects,dislocations,grainboundaries,…• Defectscommonlyresultintheincreaseofparentlatticevolumeà enhancethediffusionrate

• Diffusioncoefficientaffectedbydifferentdefects:%VWRR"XY < %["\V]XWR"]8 < %^_ < %\`NaWXY

• Diffusionisanactivatedprocess• DEnn <DEnnn

• Wecanonlyconsidernnjumps• Rateofjumpa exp(-DE/kBT)

AdHiMad Lab 10

DE

Page 11: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Random Walk• Amotioninspacewherethereisnorestrictionsonthedirectionofthenextjump,i.e.alljumpsareequallyprobable

• Arandomwalkproblemwillbedefinedknowing• Latticestructureofthematerial• Rateofjumps

vTrackingthepositionofatoms• Consideralattice– e.g.square• Assumejumpswithnormalizedratesr– up,down,left,right• Performnjumps• Calculate<R2>

AdHiMad Lab 11

Page 12: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Random Walk• Afternjumps

b 2 = F: + FD +⋯+ F8 =7F"

8

"9:• Forcalculatingthediffusioncoefficientweneedtocalculatethe b 2 0 b 2

b 2 0 b 2 =7F"D

8

"9:

+ 27 7 F⃗" 0 F⃗f

8

f9"g:

8M:

"9:

• Forasquarelattice• Lengthofalljumpsarea• Theonlydifferenceisinthedirectionofthejump

AdHiMad Lab 12

F⃗" 0 F⃗f= F⃗" F⃗f cos(k"f)

Page 13: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Random Walk• Thusforasquarelatticewehave

b 2 0 b 2 = 2-D + 2-D7 7 cos(k"f)8

f9"g:

8M:

"9:

• Theaverage b 2 0 b 2 = 2-D + 2-D ∑ ∑ cos(k"f)8f9"g:

8M:"9: = 2-D +

2-D ∑ ∑ cos(k"f)8f9"g:

8M:"9: = 2-D + 2-D ∑ ∑ cos(k"f)8

f9"g:8M:"9:

• Sincethejumpsareequallylikelyinalldirections

7 7 cos(k"f)8

f9"g:

8M:

"9:

= 0

• Thus b 2 0 b 2 = 2-D = Fmn5o+-D

AdHiMad Lab 13

Page 14: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Diffusion Coefficient – Random Walk• Wehadprovedthat% = :

pRbD ,andnowwefound bD = Fmn5o+-D

thus

% =16+

Fmn5o+-D =Fmn5o-D

6• CAUTION:Alljumpsareequallyviable• Inrealworldreversejumpsaremoreprobable

• WeaddacorrectionfactorK,thus% = q Nf`rsWO

p,whereK=1forrandomwalk

andK<1 forarealisticjump• K canbefoundusingatomisticcalculationsknowingtheinteratomicpotential

AdHiMad Lab 14

Page 15: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Implementation• Forimplementingtherandomwalkwefollowthesesteps

• Determinethelattice(possiblejumps:directionsanddistanceperjump)1. Generatethesequenceofrandomwalks2. Calculatethenewposition3. CalculatetheR(n)andbD 2• Performsteps1-3formanyrandomwalks• UsetheBinningprocesstocalculatetheaverage<R2>

AdHiMad Lab 15

Page 16: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Random Number Generators • Althoughcomputersaredevelopedtoperformaccuratecalculations,wemayusesomealgorithmstogeneratesaseriesofnumbersthatlook random

• Differentrandomnumbergeneratorshavedifferentqualities• Therearelibrariesoffunctionsthatyoumayuseforgeneratinghighqualityrandomnumbers

• drand48()• use<random>libraryinC++11• MathematicaRandomReal• Matlab:rand,haltonset

AdHiMad Lab 16

Page 17: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Random Number Generators - Park-Miller• Park-MillerGenerator

tfg: = -tfmod5• wherea andm areconstants,modisthereminderofLHSwrt RHS,andI1 istheinitialorseednumber

• Itresultsalongsequenceofsudo randomnumbersifwechoose- = 7x5 = 2J: − 1

• Maximumvalueofthisseriesism• CAUTION:Theserieswillreturnthesamesetofnumbersunlessyouchangetheseednumber

• Inrandomwalksyouneedtochangetheseed,otherwiseyougetthesamesetoverandover

AdHiMad Lab 17

Park,&Miller(1988)CommunicationsoftheACM,31(10),1192–1201

Page 18: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Random Walk – pseudo code• Definethesetofpossiblejumps

• e.g.[1,0][-1,0][0,1][0,-1]• Defineasetofpathsofrandomjumps

• e.g.P1:LLLUUDDRRDULDD;P2:LDDULDRRLDRRLDL;…• Findthenewposition,r(n)pi ,anditssquare,r2(n)pi,aftereachjump• Findtheaverageof< r(n)pi>and <r2(n)pi>betweenmanypathsPi• Plot<r2(n)pi>vsn• Thelargerthen,thecloserthe<r2(n)pi>toaline

AdHiMad Lab 18

Page 19: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Random Walk – Statistics • Considerjumpsonlyin1D• Astimepassestheatomattheoriginjumpsinalldirectionswithequalprobability

• Theaverageofthedisplacementswillbezero• Thereisahigherprobabilityoffindingatomsatthecenter

• ItisproventhattheprobabilityofarandomwalkisgivenbyaGaussiandistributionasfollows

t >8 =3

2I2-Dz.x

L>o −3>8D

22-D• ItshouldbenotedthattheGaussianfunctiongoestozeroasxgoesto∞,whichisnotrealistic

• Theexactprobabilisticfunctionshouldbezerobeyondna

AdHiMad Lab 19

Page 20: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Random Walk – Statistics • Theprobabilityinalldirectionsis

} b = t >8 t ~8 t �8 =3

2I2-DJ/D

L>o −3

22-D>8D + ~8D + �8D

• Theprobabilityforend-to-enddistance

} b = t >8 t ~8 t �8 =3

2I2-DJ/D

4IbDL>o −3bD

22-D

• Theprobabilityof} b canbefoundusingtheBinningmethodandplottingthehistogram

AdHiMad Lab 20

Page 21: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni

Homework• Writearandomwalkcodeandprovidethefollowingitemsforn=1000jumpsaveragedover10,100,and1000steps

• P(r) vsr• < r(n)pi>vs n• <r2(n)pi>vsn

AdHiMad Lab 21

Page 22: Statistical Model - latech.edukmomeni/Courses/Multiscale Material Design/Lecture8... · PI: K. Momeni Diffusion •Experimental calculation of the diffusion rates is very cumbersome

PI: K. Momeni AdHiMad Lab 22

Questions