欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    药物计算分析导论章.pptx

    • 资源ID:74452036       资源大小:480.80KB        全文页数:46页
    • 资源格式: PPTX        下载积分:20金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要20金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    药物计算分析导论章.pptx

    会计学1药物计算分析导论章药物计算分析导论章2003年This LectureThis Lecturen nMore accurate schemesMore accurate schemesn nMore complicated ODEsMore complicated ODEsn nVariable time step and embedded methods used to make sure Variable time step and embedded methods used to make sure errors are within a tolerance.errors are within a tolerance.第1页/共46页2003年Adams-Bashforth SchemesAdams-Bashforth Schemesn nIn the forward Euler scheme we only used the value of the right hand side at the In the forward Euler scheme we only used the value of the right hand side at the previous time step.previous time step.n ni.e.we only used a linear approximation to the time derivativei.e.we only used a linear approximation to the time derivative第2页/共46页2003年AB SchemesAB Schemesn nIdea:we set Idea:we set n nwhere If interpolates fwhere If interpolates fn n,f,fn-1n-1,f,fn-2n-2,.,f,.,fn+1-Nstagesn+1-Nstages n ni.e.:i.e.:第3页/共46页2003年f0f1f2f3We interpolate the function through thefirst 4 points.Then we integrate under the curve between t=3 and t=4.第4页/共46页2003年AB SchemesAB Schemes Essentially we use Essentially we use interpolation and a interpolation and a Newton-Cotes quadrature Newton-Cotes quadrature formula to formulate:formula to formulate:第5页/共46页2003年Runge-Kutta SchemesRunge-Kutta Schemesn nSee van Loan for derivation of Runge-Kutta2 and Runge-See van Loan for derivation of Runge-Kutta2 and Runge-Kutta4.Kutta4.n nThe following(simple)scheme due to Jameson,Schmidt The following(simple)scheme due to Jameson,Schmidt and Turkel(1981):and Turkel(1981):第6页/共46页2003年Runge-Kutta SchemesRunge-Kutta Schemesn nBeware,it only works when Beware,it only works when f f is a function of is a function of y y and and notnot t tn nhere here s s is the order of the scheme.is the order of the scheme.第7页/共46页2003年Error EstimateError Estimaten nMatlab has a number of time integrators built in.Matlab has a number of time integrators built in.n node23ode23n node45ode45n nand others.and others.第8页/共46页2003年ode23ode23n nFor n=1:#timestepsFor n=1:#timestepsn node23 uses two estimates for yode23 uses two estimates for yn+1n+1.n nA 2A 2ndnd order RK scheme and a 3 order RK scheme and a 3rdrd order RK scheme are used to build two order RK scheme are used to build two guesses for yguesses for yn+1n+1.n nIf the difference between these two estimates are within a tolerance ode23 If the difference between these two estimates are within a tolerance ode23 progresses on to calculating yprogresses on to calculating yn+2n+2n nIf the difference is greater than the specified tolerance,ode23 reduces the dt If the difference is greater than the specified tolerance,ode23 reduces the dt and tries again.It repeats until the difference is lower than the tolerance.and tries again.It repeats until the difference is lower than the tolerance.n nEndEnd第9页/共46页2003年T,Y=ode23(odefun,tspan,yT,Y=ode23(odefun,tspan,y0 0)nwith tspan=t0 tf integrates the system of differential equations from time t0 to tf with initial conditions y0.nY0 A vector of initial conditions.nOdefun A function that evaluates the right-hand side of the differential equations.第10页/共46页2003年Planets Example Using ode23Planets Example Using ode23n nIdea:replace our home grown Euler Forward scheme with MatlabIdea:replace our home grown Euler Forward scheme with Matlab s ode23 s ode23 scheme in the scheme in the planets1.mplanets1.m script.script.第11页/共46页2003年Parameters forthe planets asbefore第12页/共46页2003年Initial velocitiesGatherX,Y,VX,VYinto one vector第13页/共46页2003年 T,CoordVel=ode23(forcing,TimeLimits,CoordVel(:);Call to Matlab ode23 functionfunction whichcalculates f(y)0 FinalTime Vector holdsX,Y,VX,VYWorks in Matlab v6.1.0 at least第14页/共46页2003年Call to ode23Find out the time at each time stepExtract final coordinates and velocitiesPlot planet orbitsd=size(X)returns the sizes of each dimension of array X in a vector d with ndims(X)elements.第15页/共46页2003年The routine whichcalculates the forcing function.第16页/共46页2003年Team ExerciseTeam Exercisen nGrab Grab planets2.mplanets2.m and and forcing.mforcing.mn nRun the scriptRun the scriptn nUse the Tsteps vector to find out the time step for each Use the Tsteps vector to find out the time step for each integration stage.Plot a graph showing the time step(dt)integration stage.Plot a graph showing the time step(dt)at each time step.at each time step.n nUse Use helphelp to find out how to change the tolerance used by to find out how to change the tolerance used by ode23ode23 (hint you will need to use (hint you will need to use odesetodeset)n nRerun the simulation with a tolerance of 0.1 Rerun the simulation with a tolerance of 0.1 第17页/共46页2003年第18页/共46页2003年Application:One-Dimensional Electrostatic Application:One-Dimensional Electrostatic MotionMotion第19页/共46页2003年Charge RepulsionCharge Repulsionn nNow we will consider the case of charged particles with the same sign Now we will consider the case of charged particles with the same sign chargechargen nInstead of attracting each other,the charges repel each other.Instead of attracting each other,the charges repel each other.第20页/共46页2003年Particle AccelerationsParticle Accelerationsa1a2Each particle has a vector accelerationdirectly away from the other particle第21页/共46页2003年Team ProjectTeam ProjectQ1)Modify the Q1)Modify the planets2.mplanets2.m and and forcing.mforcing.m to simulate the following:to simulate the following:n nThere are N electrically charged particles There are N electrically charged particles confined to move in the x-confined to move in the x-direction onlydirection onlyn nDistribute the charges initially at equispaced points in-1,1Distribute the charges initially at equispaced points in-1,1n nThe equations of motion of the charges are:The equations of motion of the charges are:第22页/共46页2003年Team ProjectTeam ProjectQ1cont)Include the following in one project write up per team:Q1cont)Include the following in one project write up per team:n nA scatter plot,with x as the horizontal axis and t as the vertical axis,showing A scatter plot,with x as the horizontal axis and t as the vertical axis,showing the paths of all the charged particles using ode23the paths of all the charged particles using ode23n nReplace ode23 with ode45 and rerunReplace ode23 with ode45 and rerunn nPlot the ode23 and ode45(t,x)paths on the same graph.Plot the ode23 and ode45(t,x)paths on the same graph.n nPlot the ode23 and ode45 time step sizes on the same graphPlot the ode23 and ode45 time step sizes on the same graphn nNames of team membersNames of team members第23页/共46页2003年Chap.12 Chap.12 Electrostatics-Colliding Disks ProjectElectrostatics-Colliding Disks Project第24页/共46页2003年Big Team ProjectBig Team Projectn nOk Ok we have been warming up with some small projects we have been warming up with some small projectsn nNow for something a little more involvedNow for something a little more involved第25页/共46页2003年The PhysicsThe Physicsn nThe domain of interest is a two-dimensional periodic The domain of interest is a two-dimensional periodic box of side length Lbox of side length Ln nIt is populated with N circles of mass M each and It is populated with N circles of mass M each and radius Rradius R第26页/共46页2003年xyx=0y=0 x=Ly=LDomain第27页/共46页2003年xyx=0y=0 x=Ly=LParticlesR第28页/共46页2003年Defining A Set of Motion RulesDefining A Set of Motion RulesRule 1Rule 1The disks are initially randomly distributedThe disks have random initial velocity(with the absolute value of each component of velocity bounded by 1)Rule 2Rule 2Effectively Newtons first:all particles do not accelerate until they collide第29页/共46页2003年Particles CollideParticles Collide21Before21After第30页/共46页2003年Rule 4Rule 4n nMomentum(Momentum(动量动量)is conserved in a collision)is conserved in a collisionRule 5Rule 5Angular momentum(动量矩)is conserved in the collisionRule 6Rule 6Total kinetic energy(动能)is conserved The total kinetic energy of the particles is the same before and after the collision.第31页/共46页2003年Model SimplificationModel Simplificationn nWe are going to use Rules 4,5,and 6 to determine the change in We are going to use Rules 4,5,and 6 to determine the change in velocity of two disks when they collide.velocity of two disks when they collide.n nWe can simplify this problem by considering a coordinate frame We can simplify this problem by considering a coordinate frame which is:which is:n n co-moving with the center of one of the disks(say disk1)at co-moving with the center of one of the disks(say disk1)at its originits originn n with x-axis aligned in direction of the segment connecting the with x-axis aligned in direction of the segment connecting the two disk centerstwo disk centers第32页/共46页2003年In Co-Moving FrameIn Co-Moving Frame21Before第33页/共46页2003年Math Version of 4Math Version of 4(in co-moving frame)(in co-moving frame)n nConservation of Conservation of linear momentumlinear momentum:n nWhich reduces to:Which reduces to:第34页/共46页2003年Math Version of 5Math Version of 5(in co-moving frame)(in co-moving frame)n nConservation of Conservation of angular angular momentum:momentum:n nAnd since the center of two can not be at the origin And since the center of two can not be at the origin this implies:this implies:第35页/共46页2003年Math Version of 6Math Version of 6(in co-moving frame)(in co-moving frame)n nConservation of Conservation of kinetic energykinetic energy:n nReduces to:Reduces to:第36页/共46页2003年Summary of 4,5,6Summary of 4,5,6456第37页/共46页2003年SolutionsSolutionsCollisionNo collision第38页/共46页2003年In Co-Moving FrameIn Co-Moving Frame21Before21After第39页/共46页2003年Reverting To Non-moving FrameReverting To Non-moving Frame The rules essentially say that if two equal The rules essentially say that if two equalmass disks collide then:mass disks collide then:1)1)they exchange velocity in their center-to-center vector they exchange velocity in their center-to-center vector 2)2)they retain their own velocity in the direction of the tangent to they retain their own velocity in the direction of the tangent to their center-to-center vectortheir center-to-center vector第40页/共46页2003年General FormulaGeneral Formula*第41页/共46页2003年Summary of Collision FormulaSummary of Collision Formulan nGiven the relative position of two disks before the collision and their velocities we can determine the post-collision velocities第42页/共46页2003年Change invelocity ofdisk 1Exchange of linear andangular momentum第43页/共46页2003年Project DescriptionProject Descriptionn nUsing Euler forward as time steppingUsing Euler forward as time steppingn nInitiate the random initial positions and velocities of the disksInitiate the random initial positions and velocities of the disksn nMove the particles with time step dtMove the particles with time step dtn nEach time step check to see if any disk intersects any other diskEach time step check to see if any disk intersects any other diskn nif two disks intersect use the collision formula to determine their new velocitiesif two disks intersect use the collision formula to determine their new velocitiesn nIncrement(Increment(增大增大)the disk positions with dt multiplying their velocitiesthe disk positions with dt multiplying their velocities第44页/共46页2003年Project Description contProject Description cont Use mod on the updated positions to make sure that the disks stay within the box Repeat until quite a few collisions show up Plot the locations of the particles in a two-dimensional plot use hold so that the time history of the disks shows upmod(x,y)is X X mod Y Y 第45页/共46页

    注意事项

    本文(药物计算分析导论章.pptx)为本站会员(莉***)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开