南开大学计算物理讲义7.ppt

  1. 1、本文档共65页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
南开大学计算物理讲义7

In this section we look at how to solve higher order ordinary differential equations. Some of the techniques discussed here are based on the techniques introduced in §7, and some rely on a combination of this material and the linear algebra of §5.;8.2.1 Initial value problems (初始值问题);(1) The Taylor Series expansion;h=0.01, T=0 ;DATA T/0.0/,X/1.0/,Y/0.0/,H/0.01/,NSTEP/100/ DO K=1,NSTEP;解析解:; Euler method;x;例;x1=t, x2=x, x3=y;Yn+1 = Yn + (k(1) + 2k(2) + 2k(3) + k(4))/6.;Xn+1 = Xn + h(F(1) + 2F(2) + 2F(3) + F(4))/6.;x1=t, x2=x, x3=y;x1=t, x2=x, x3=y;F(1)= F(Xn);;F(1)= F(Xn);;SUBROUTINE XPSYS ( X, F);SUBROUTINE RK4SYS(N, T, X, H, NSTEP) DIMENSION X(10),Y(10), F1(10), F2(10), F3(10), F4(10);dimension x(3) data n/3/,t/0.0/,x/0.0,1.0,0.0/,h/0.01/,nstep/100/ call rk4sys(n,t,x,h,nstep) stop end;8.2.1 Initial value problems (初始值问题);y = f(t, y, y’) ;where at t = t0 we know the values of x0, x1, ,xn-1 ;x1=y1, x2=y2 ,…, xn=yn;x1=t, x2=y1, x3=y2 ,…, xn+1=yn;where at t = t0 we know the values of y1, y2, … , yn ;x1=t, x2=y, x3=y’ , x4=y’’;Higher order equation sets ;8.2.2 Boundary value problems (边值问题) ;There are two relatively simple approaches to solve Boundary value problems.;8.2.2.1 Shooting method;If this does not satisfy y(1) = c1 to some acceptable tolerance, we revise our guess for y’(0) to some value a1, say, and repeat the time integration to obtain an new value for y(1). This process continues until we hit y(1)=c1 to the acceptable tolerance. ;1 Newton-Raphson ;2. Secant method (chord) ;y= - π2 (y+1)/4;x3(0)= ? ;DO WHILE(ABS(DX).GT.DL) D= F(X31)- F(X30) X32=X31-(X31-X30)* F(X31)/D X30=X31 X31=X32 DX=X31-X30;dimension y0(3), y(3);DO K=1, NMAX;SUBROUTINE XPSYS ( X, F) DIMENSION X(3), F(3) PI=4.0*ATAN(1.0) F(1)=1.0 F(2)= X(3) F(3)=-PI*PI*(X(2)+1.0)/4.0 RETURN END;Y(X)=COS(πx/2)+2SIN(πx/2)-1;8.2.2.2 Linear equations ;yi ? (Yi+1 – Yi-1)/2Dt, ;(1-1/2aDt)Y0 + (bDt2–2)Y1 + (1+1/2aDt)Y2 = cDt2,;t0;For t = t1 we must express the derivative in the boundary condition in finite d

文档评论(0)

dajuhyy + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档