药物计算分析导论-第二部分-11-12章Matlab.ppt_第1页
药物计算分析导论-第二部分-11-12章Matlab.ppt_第2页
药物计算分析导论-第二部分-11-12章Matlab.ppt_第3页
药物计算分析导论-第二部分-11-12章Matlab.ppt_第4页
药物计算分析导论-第二部分-11-12章Matlab.ppt_第5页
已阅读5页,还剩41页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

2003年 浙江大学中药科学与工程学系 Chap 11MoreAdvancedTimeIntegrationOfAnODE 2003年 浙江大学中药科学与工程学系 ThisLecture MoreaccurateschemesMorecomplicatedODEsVariabletimestepandembeddedmethodsusedtomakesureerrorsarewithinatolerance 2003年 浙江大学中药科学与工程学系 Adams BashforthSchemes IntheforwardEulerschemeweonlyusedthevalueoftherighthandsideattheprevioustimestep i e weonlyusedalinearapproximationtothetimederivative 2003年 浙江大学中药科学与工程学系 ABSchemes Idea wesetwhereIfinterpolatesfn fn 1 fn 2 fn 1 Nstagesi e 2003年 浙江大学中药科学与工程学系 f0 f1 f2 f3 Weinterpolatethefunctionthroughthefirst4points Thenweintegrateunderthecurvebetweent 3andt 4 2003年 浙江大学中药科学与工程学系 ABSchemes EssentiallyweuseinterpolationandaNewton Cotesquadratureformulatoformulate 2003年 浙江大学中药科学与工程学系 Runge KuttaSchemes SeevanLoanforderivationofRunge Kutta2andRunge Kutta4 Thefollowing simple schemeduetoJameson SchmidtandTurkel 1981 2003年 浙江大学中药科学与工程学系 Runge KuttaSchemes Beware itonlyworkswhenfisafunctionofyandnottheresistheorderofthescheme 2003年 浙江大学中药科学与工程学系 ErrorEstimate Matlabhasanumberoftimeintegratorsbuiltin ode23ode45andothers 2003年 浙江大学中药科学与工程学系 ode23 Forn 1 timestepsode23usestwoestimatesforyn 1 A2ndorderRKschemeanda3rdorderRKschemeareusedtobuildtwoguessesforyn 1 Ifthedifferencebetweenthesetwoestimatesarewithinatoleranceode23progressesontocalculatingyn 2Ifthedifferenceisgreaterthanthespecifiedtolerance ode23reducesthedtandtriesagain Itrepeatsuntilthedifferenceislowerthanthetolerance End 2003年 浙江大学中药科学与工程学系 T Y ode23 odefun tspan y0 withtspan t0tf integratesthesystemofdifferentialequationsfromtimet0totfwithinitialconditionsy0 Y0Avectorofinitialconditions OdefunAfunctionthatevaluatestheright handsideofthedifferentialequations 2003年 浙江大学中药科学与工程学系 PlanetsExampleUsingode23 Idea replaceourhomegrownEulerForwardschemewithMatlab sode23schemeintheplanets1 mscript 2003年 浙江大学中药科学与工程学系 Parametersfortheplanetsasbefore 2003年 浙江大学中药科学与工程学系 Initialvelocities GatherX Y VX VYintoonevector 2003年 浙江大学中药科学与工程学系 T CoordVel ode23 forcing TimeLimits CoordVel CalltoMatlabode23function functionwhichcalculatesf y 0FinalTime VectorholdsX Y VX VY WorksinMatlabv6 1 0 atleast 2003年 浙江大学中药科学与工程学系 Calltoode23 Findoutthetimeateachtimestep Extractfinalcoordinatesandvelocities Plotplanetorbits d size X returnsthesizesofeachdimensionofarrayXinavectordwithndims X elements 2003年 浙江大学中药科学与工程学系 Theroutinewhichcalculatestheforcingfunction 2003年 浙江大学中药科学与工程学系 TeamExercise Grabplanets2 mandforcing mRunthescriptUsetheTstepsvectortofindoutthetimestepforeachintegrationstage Plotagraphshowingthetimestep dt ateachtimestep Usehelptofindouthowtochangethetoleranceusedbyode23 hintyouwillneedtouseodeset Rerunthesimulationwithatoleranceof0 1 2003年 浙江大学中药科学与工程学系 2003年 浙江大学中药科学与工程学系 Application One DimensionalElectrostaticMotion 2003年 浙江大学中药科学与工程学系 ChargeRepulsion NowwewillconsiderthecaseofchargedparticleswiththesamesignchargeInsteadofattractingeachother thechargesrepeleachother 2003年 浙江大学中药科学与工程学系 ParticleAccelerations a1 a2 Eachparticlehasavectoraccelerationdirectlyawayfromtheotherparticle 2003年 浙江大学中药科学与工程学系 TeamProject Q1 Modifytheplanets2 mandforcing mtosimulatethefollowing ThereareNelectricallychargedparticlesconfinedtomoveinthex directiononlyDistributethechargesinitiallyatequispacedpointsin 1 1 Theequationsofmotionofthechargesare 2003年 浙江大学中药科学与工程学系 TeamProject Q1cont Includethefollowinginoneprojectwriteupperteam Ascatterplot withxasthehorizontalaxisandtastheverticalaxis showingthepathsofallthechargedparticlesusingode23Replaceode23withode45andrerunPlottheode23andode45 t x pathsonthesamegraph Plottheode23andode45timestepsizesonthesamegraphNamesofteammembers 2003年 浙江大学中药科学与工程学系 Chap 12Electrostatics CollidingDisksProject 2003年 浙江大学中药科学与工程学系 BigTeamProject Ok wehavebeenwarmingupwithsomesmallprojectsNowforsomethingalittlemoreinvolved 2003年 浙江大学中药科学与工程学系 ThePhysics Thedomainofinterestisatwo dimensionalperiodicboxofsidelengthLItispopulatedwithNcirclesofmassMeachandradiusR 2003年 浙江大学中药科学与工程学系 x y x 0 y 0 x L y L Domain 2003年 浙江大学中药科学与工程学系 x y x 0 y 0 x L y L Particles R 2003年 浙江大学中药科学与工程学系 DefiningASetofMotionRules Rule1 ThedisksareinitiallyrandomlydistributedThediskshaverandominitialvelocity withtheabsolutevalueofeachcomponentofvelocityboundedby1 Rule2 EffectivelyNewton sfirst allparticlesdonotaccelerateuntiltheycollide 2003年 浙江大学中药科学与工程学系 ParticlesCollide 2 1 Before 2 1 After 2003年 浙江大学中药科学与工程学系 Rule4 Momentum 动量 isconservedinacollision Rule5 Angularmomentum 动量矩 isconservedinthecollision Rule6 Totalkineticenergy 动能 isconservedThetotalkineticenergyoftheparticlesisthesamebeforeandafterthecollision 2003年 浙江大学中药科学与工程学系 ModelSimplification WearegoingtouseRules4 5 and6todeterminethechangeinvelocityoftwodiskswhentheycollide Wecansimplifythisproblembyconsideringacoordinateframewhichis co movingwiththecenterofoneofthedisks saydisk1 atitsoriginwithx axisalignedindirectionofthesegmentconnectingthetwodiskcenters 2003年 浙江大学中药科学与工程学系 InCo MovingFrame 2 1 Before 2003年 浙江大学中药科学与工程学系 MathVersionof4 inco movingframe Conservationoflinearmomentum Whichreducesto 2003年 浙江大学中药科学与工程学系 MathVersionof5 inco movingframe Conservationofangularmomentum Andsincethecenteroftwocannotbeattheoriginthisimplies 2003年 浙江大学中药科学与工程学系 MathVersionof6 inco movingframe Conservationofkineticenergy Reducesto 2003年 浙江大学中药科学与工程学系 Summaryof4 5 6 4 5 6 2003年 浙江大学中药科学与工程学系 Solutions Collision Nocollision 2003年 浙江大学中药科学与工程学系 InCo MovingFrame 2 1 Before 2 1 After 2003年 浙江大学中药科学与工程学系 RevertingToNon movingFrame Therulesessentiallysaythatiftwoequalmassdiskscollidethen theyexchangevelocityintheircenter to centervectortheyretaintheirownvelocityinthedirectionofthetangenttotheircenter to centervector 2003年 浙江大学中药科学与工程学系 GeneralFormula 2003年 浙江大学中药科学与工程学系 SummaryofCollisionFormula Giventherelativepositionoftwodisksbeforethecollisionandtheirvelocitieswecandeterminethepost collisionvelocities 2003年 浙江大学中药科学与工程学系 Changeinve

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论