正在加载图片...
§4 Multistep method Adams 4th-Order predictor-corrector Algorithm To approximate thethe solution of the initial-value problem y=f(x,vacmtll-u At (N+l)equally s Input: endpoir 应为(cH1-p),但因cH1尚未 Output: approxm 算出,只好用(c-n;)取代之 Step I Set h=(b-a)7N, u Step 2 Fori=1, 2,3 Compute yi using classical Kutta method; Output(xi, yil? Step 3 Fori=4,.,n do steps 4-10 Step 5 pi1=y; +h(55f 1+37f1-2-9f3)/24;/ predict* Step 6 m 4 1=Pi+251(c, p, )/270; /*modify * Step 7 c=y, +h(9f(x u,m 41)+19f-5fi-+fi_)/24;/*correct*/ Step 8 Vii=Ci 1-19(Ci1-Pi1)/270;/*modify the final value*/ Step 9 output(x +1, v2+1); Step 10 forj=0, 1,2,3 Set xi=x+1; yi=V+1; /Prepare for next iteration Step 11 STOP.§4 Multistep Method Adams 4th-Order predictor-corrector Algorithm To approximate the the solution of the initial-value problem At (N+1) equally spaced numbers in the interval [a, b]. Input: endpoints a, b; integer N; initial value y0 . Output: approximation y at the (N+1) values of x. Step 1 Set h = (b - a) / N ; x0 = a; y0 = y0; Output ( x0 , y0 ); Step 2 For i = 1, 2, 3 Compute yi using classical Runge-Kutta method; Output ( xi , yi ); Step 3 For i = 4, …, N do steps 4-10 Step 5 ; /* predict */ Step 6 ; /* modify */ Step 7 ; /* correct */ Step 8 ; /* modify the final value */ Step 9 Output ( xi+1 , yi+1 ); Step 10 For j = 0, 1, 2, 3 Set xi = xi+1 ; yi = yi+1 ; /* Prepare for next iteration */ Step 11 STOP. 0 y'= f (x, y), a  x  b, y(a) = y pi+1 = yi + h(55 f i - 59 f i-1 + 37 f i-2 - 9 f i-3 )/ 24 mi+1 = pi+1 + 251(ci - pi )/ 270 (9 ( , ) 19 5 )/ 24 i+1 = i + i+1 i+1 + i - i-1 + i-2 c y h f x m f f f yi+1 = ci+1 -19(ci+1 - pi+1 )/ 270 应为( ci+1 - pi+1 ), 但因ci+1 尚未 算出,只好用( ci - pi )取代之
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有