幾種常見的優化方法課件_第1頁
幾種常見的優化方法課件_第2頁
幾種常見的優化方法課件_第3頁
幾種常見的優化方法課件_第4頁
幾種常見的優化方法課件_第5頁
已閱讀5頁,還剩24頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

幾種常見的優化方法電子結構幾何機構函數穩定點最小點Taylor展開:V(x)=V(xk)+(x-xk)V’(xk)+1/2(x-xk)2V’’(xk)+…..當x是3N個變量的時候,V’(xk)成為3Nx1的向量,而V’’(xk)成為3Nx3N的矩陣,矩陣元如:Hessian1幾種常見的優化方法電子結構函數穩定點Taylor展開:當x一階梯度法a.SteepestdescendentSk=-gk/|gk|directiongradient知道了方向,如何確定步長呢?最常用的是先選擇任意步長l,然后在計算中調節用體系的能量作為外界衡量標準,能量升高了則逐步減小步長。robust,butslow最速下降法2一階梯度法Sk=-gk/|gk|directi最陡下降法(SD)

3最陡下降法(SD)3b.ConjugateGradient(CG)共軛梯度第k步的方向標量UsuallymoreefficientthanSD,alsorobust不需要外界能量等作為衡量量利用了上一步的信息4b.ConjugateGradient(CG)共軛2。二階梯度方法這類方法很多,最簡單的稱為Newton-Raphson方法,而最常用的是Quasi-Newton方法。Quasi-Newton方法:useanapproximationoftheinverseHessian.Formofapproximationdiffersamongmethods牛頓-拉夫遜法BFGSmethodBroyden-Fletcher-Golfarb-ShannoDFPmethodDavidon-Fletcher-Powell52。二階梯度方法這類方法很多,最簡單的稱為Newton-RaMoleculardynamics分子動力學HistoryItwasnotuntil1964thatMDwasusedtostudyarealisticmolecularsystem,inwhichtheatomsinteractedviaaLennard-Jonespotential.Afterthispoint,MDtechniquesdevelopedrapidlytoencompassdiatomicspecies,water(whichisstillthesubjectofcurrentresearchtoday!),smallrigidmolecules,flexiblehydrocarbonsandnowevenmacromoleculessuchasproteinsandDNA.Theseareallexamplesofcontinuousdynamicalsimulations,andthewayinwhichtheatomicmotioniscalculatedisquitedifferentfromthatinimpulsivesimulationscontaininghard-corerepulsions.6Moleculardynamics分子動力學HistWhatcanwedowithMD–CalculateequilibriumconfigurationalpropertiesinasimilarfashiontoMC.–Studytransportproperties(e.g.mean-squareddisplacementanddiffusioncoefficients).–MDintheNVT,NpTandNpHensembles–Theunitedatomapproximation–ConstraintdynamicsandSHAKE–Rigidbodydynamics–MultipletimestepalgorithmsExtendthebasicMDalgorithm7WhatcanwedowithMD–Calcul‘Impulsive’moleculardynamics

1.Dynamicsofperfectly‘hard’particlescanbesolvedexactly,butprocessbecomesinvolvedformanypart(N-bodyproblem).2.Canuseanumericalschemethatadvancesthesystemforwardintimeuntilacollisionoccurs. 3.Velocitiesofcollidingparticles(usuallyapair!)thenrecalculatedandsystemputintomotionagain.4.Simulationproceedsbyfitsandstarts,withameantimebetweencollisionsrelatedtotheaveragekineticenergyoftheparticles.5.Potentiallyveryefficientalgorithm,butcollisionsbetweenparticlesofcomplexshapearenoteasytosolve,andcannotbegeneralisedtocontinuouspotentials. 88Continuoustimemoleculardynamics1.Bycalculatingthederivativeofamacromolecularforcefield,wecanfindtheforcesoneachatomasafunctionofitsposition.2.Requireamethodofevolvingthepositionsoftheparticlesinspaceandtimetoproducea‘true’dynamicaltrajectory.3.StandardtechniqueistosolveNewton’sequationsofmotionnumerically,usingsomefinitedifferencescheme,whichisknownasintegration.4.ThismeansthatweadvancethesystembysomesmalltimestepΔt,recalculatetheforcesandvelocities,andthenrepeattheprocessiteratively.5.ProvidedΔtissmallenough,thisproducesanacceptableapproximatesolutiontothecontinuousequationsofmotion.9ContinuoustimemoleculardynaExampleofintegratorforMDsimulationOneofthemostpopularandwidelyusedintegratorsistheVerletleapfrogmethod:positionsandvelocitiesofparticlesaresuccessively‘leap-frogged’overeachotherusingaccelerationscalculatedfromforcefield.TheVerletschemehastheadvantageofhighprecision(oforderΔt4),whichmeansthatalongertimestepcanbeusedforagivenleveloffluctuations.Themethodalsoenjoysverylowdrift,providedanappropriatetimestepandforcecut-offareused.r(t+Dt)=r(t)+v(t+Dt/2)Dtv(t+Dt/2)=v(t-Dt/2)+a(t+Dt/2)Dt10ExampleofintegratorforMDsOtherintegratorsforMDsimulationsAlthoughtheVerletleapfrogmethodisnotparticularlyfast,thisisrelativelyunimportantbecausethetimerequiredforintegrationisusuallytrivialincomparisontothetimerequiredfortheforcecalculations.Themostimportantconcernforanintegratoristhatitexhibitslowdrift,i.e.thatthetotalenergyfluctuatesaboutsomeconstantvalue.Anecessary(butnotsufficient)conditionforthisisthatitissymplectic.Crudelyspeaking,thismeansthatitshouldbetimereversible(likeNewton’sequations),i.e.ifwereversethemomentaofallparticlesatagiveninstant,thesystemshouldtracebackalongitsprevioustrajectory.11OtherintegratorsforMDsimulOtherintegratorsforMDsimulationsTheVerletmethodissymplectic,butmethodssuchaspredictor-correctorschemesarenot.Non-symplecticmethodsgenerallyhaveproblemswithlongtermenergyconservation.Havingachievedlowdrift,wouldalsoliketheenergyfluctuationsforagiventimesteptobeaslowaspossible.Alwaysdesirabletousethelargesttimesteppossible.Ingeneral,thetrajectoriesproducedbyintegrationwilldivergeexponentiallyfromtheirtruecontinuouspathsduetotheLyapunovinstability.However,thisdoesnotconcernusgreatly,asthethermalsamplingisunaffected?expectationvaluesunchanged.12OtherintegratorsforMDsimulChoosingthecorrecttimestep…1.

Thechoiceoftimestepiscrucial:tooshortandphasespaceissampledinefficiently,toolongandtheenergywillfluctuatewildlyandthesimulationmaybecomecatastrophicallyunstable(“blowup”).2.Theinstabilitiesarecausedbythemotionofatomsbeingextrapolatedintoregionswherethepotentialenergyisprohibitivelyhigh(e.g.atomsoverlapping).3.Agoodruleofthumbisthatwhensimulatinganatomicfluid,thetimestepshouldbecomparabletothemeantimebetweencollisions(about5fsforArat298K).4.Forflexiblemolecules,thetimestepshouldbeanorderofmagnitudelessthantheperiodofthefastestmotion(usuallybondstretching:C—Haround10fssouse1fs).13ChoosingthecorrecttimestepForclassicMD,therecouldbemanytrickstospeedupcalculations,allcenteringaroundreducingtheeffortinvolvedinthecalculationoftheinteratomicforces,asthisisgenerallymuchmoretime-consumingthanintegration.ForexampleTruncatethelong-rangeforces:charge-charge,charge-dipoleLook-uptablesForfirstprinciplesMD,asforcesareevaluatedfromquantummechanics,weareonlyconcernedwiththetime-step.14ForclassicMD,therecouldbeBecausetheinteractionsarecompletelyelasticandpairwiseacting,bothenergyandmomentumareconserved.Therefore,MDnaturallysamplesfromthemicrocanonicalorNVEensemble.Asmentionedpreviously,theNVEensembleisnotveryusefulforstudyingrealsystems.Wewouldliketobeabletosimulatesystemsatconstanttemperatureorconstantpressure.ThesimplestMD,likeverletmethod,isadeterministicsimulationtechniqueforevolvingsystemstoequilibriumbysolvingNewton’slawsnumerically.15BecausetheinteractionsarecMDindifferentthermodynamicensemblesInthislecture,wewilldiscusswaysofusingMDtosamplefromdifferentthermodynamicensembles,whichareidentifiedbytheirconservedquantities.

Canonical(NVT)–Fixednumberofparticles,totalvolumeandtemperature.Requirestheparticlestointeractwithathermostat.

Isobaric-isothermal(NpT)–Fixednumberofparticles,pressureandtemperature.Requiresparticlestointeractwithathermostatandbarostat.

Isobaric-isenthalpic(NpH)–Fixednumberofparticles,pressureandenthalpy.Unusual,butrequiresparticlestointeractwithabarostatonly.16MDindifferentthermodynamicAdvancedapplicationsofMDWewillthenstudysomemoreadvancedMDmethodsthataredesignedspecificallytospeedup,ormakepossible,thesimulationoflargescalemacromolecularsystems.Allthesemethodsshareacommonprinciple:theyfreezeout,ordecouple,thehighfrequencydegreesoffreedom.Thisenablestheuseofalargertimestepwithoutnumericalinstability.Thesemethodsinclude:–Unitedatomapproximation–ConstraintdynamicsandSHAKE–Rigidbodydynamics–Multipletimestepalgorithms17AdvancedapplicationsofMD17RevisionofNVEMDLet’sstartbyrevisinghowtodoNVEMD.Recallthatwecalculatedtheforcesonallatomsfromthederivativeoftheforcefield,thenintegratedthee.o.m.usingafinitedifferenceschemewithsometimestepΔt.Wethenrecalculatedtheforcesontheatoms,andrepeatedtheprocesstogenerateadynamicaltrajectoryintheNVEensemble.Becausethemeankineticenergyisconstant,theaveragekinetictemperatureTKisalsoconstant.However,inthermalequilibrium,weknowthatinstantaneousTKwillfluctuate.IfwewanttosamplefromtheNVTensemble,weshouldkeepthestatisticaltemperatureconstant.18RevisionofNVEMD18ExtendedLagrangiansThereareessentiallytwowaystokeepthestatisticaltemperatureconstant,andthereforesamplefromthetrueNVTensemble.–Stochastically,usinghybridMC/MDmethods–Dynamically,viaanextendedLagrangianWewilldescribethelattermethodinthislectureAnextendedLagrangianissimplyawayofincludingadegreeoffreedomwhichrepresentsthereservoir,andthencarryingoutasimulationonthisextendedsystem.Energycanflowdynamicallybackandforthfromthereservoir,whichhasacertainthermal‘inertia’associatedwithit.AllwehavetodoisaddsometermstoNewton’sequationsofmotionforthesystem.19ExtendedLagrangians19ExtendedLagrangiansThestandardLagrangianLiswrittenasthedifferenceofthekineticandpotentialenergies:Newton’slawsthenfollowbysubstitutingthisintotheEuler-Lagrangeequation:Newton’sequationsandLagrangianformalismareequivalent,butthelatterusesgeneralisedcoordinates...20ExtendedLagrangians..20CanonicalMDSo,ourextendedLagrangianincludesanextracoordinateζ,whichisafrictionalcoefficientthatevolvesintimesoastominimisethedifferencebetweentheinstantaneouskineticandstatisticaltemperatures.Themodifiedequationsofmotionare:TheconservedquantityistheHelmholtzfreeenergy.(modifiedformofNewtonII)21CanonicalMD(modifiedformofCanonicalMDByadjustingthethermostatrelaxationtimetT

(usuallyintherange0.5to2ps)thesimulationwillreachanequilibriumstatewithconstantstatisticaltemperatureTS.TSisnowaparameterofoursystem,asopposedtothemeasuredinstantaneousvalueofTKwhichfluctuatesaccordingtotheamountofthermalenergyinthesystematanyparticulartime.ToohighavalueoftTandenergywillflowveryslowlybetweenthesystemandthereservoir(overdamped).ToolowavalueoftTandtemperaturewilloscillateaboutitsequilibriumvalue(underdamped).ThisistheNosé-Hooverthermostatmethod.22CanonicalMD22CanonicalMDTherearemanyothermethodsforachievingconstanttemperature,butnotallofthemsamplefromthetrueNVTensembleduetoalackofmicroscopicreversibility.Wecallthesepseudo-NVTmethods,andtheyinclude:–BerendsenmethodVelocitiesarerescaleddeterministicallyaftereachstepsothatthesystemisforcedtowardsthedesiredtemperature–GaussianconstraintsMakesthekineticenergyaconstantofthemotionbyminimisingtheleastsquaresdifferencebetweentheNewtonianandconstrainedtrajectoriesThesemethodsareoftenfaster,butonlyconvergeonthetruecanonicalaveragepropertiesasO(1/N).23CanonicalMD23Isothermal-isobaricMDWecanapplytheextendedLagrangianapproachtosimulationsatconstantpressurebysimplyaddingyetanothercoordinatetooursystem.Weuseη,whichisafrictionalcoefficientthatevolvesintimetominimisethedifferencebetweentheinstantaneouspressurep(t),measuredbyavirialexpression,andthepressureofanexternalreservoirpext.TheequationsofmotionforthesystemcanthenbeobtainedbysubstitutingthemodifiedLagrangianintotheEuler-Lagrangeequations.Thesenowincludetworelaxationtimes:oneforthethermostattT,andoneforthebarostattp.24Isothermal-isobaricMD24Isothermal-isobaricMDTheisknownastheNosé-Hoovermethod(Melchionnatype)andtheequationsofmotionare:25Isothermal-isobaricMD25Isothermal-isobaricMD26Isothermal-isobaricMD26Constraintdynamicsfreezethebondstretchingmotionsofthehydrogens(oranyotherbond,inprinciple).Weapplyasetofholonomicconstraintstothesystem,whichar

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論