[转帖]简单的积分器
<P>function = odeAdamsPC(odefun,tspan,y0)<BR>% <BR>% = ODEADAMSPC(ODEFUN,TSPAN,Y0) , 4th order Adams <BR>% Predictor-Corrector Method<BR>% <BR>% 参考书目<BR>% Book_A<<数值方法(MATLAB版)>>Version 3 John H.Mathews<BR>% Book_B<<数值计算方法>> Version 2 徐涛 <BR>% <BR>% Supported by <BR>% <a href="http://www.dytrol.com/mailtsunshengli@sohu.com,2005-11-01" target="_blank" ><FONT color=#000000>sunshengli@sohu.com,2005-11-01</FONT></A><BR>% </P><P><BR>tout=; </P>
<P>% RK4起步<BR>if length(tspan)<=4<BR> = odeRK4(odefun,tspan,y0);<BR> tout=; <BR>else <BR> = odeRK4(odefun,tspan(1:4),y0);<BR>end<BR>yout = ;</P>
<P>% 4th order Adams Predictor-Correctot Methods<BR>y0= ystart(:,4);<BR>for n=5:length(tspan)<BR> t = tspan(n);<BR> h = tspan(n)-tspan(n-1);<BR> F = feval( odefun,tspan(n-4:n-1),yout(:,n-4:n-1) );<BR> % Predictor<BR> p= y0 + h/24*(55*F(:,4) - 59*F(:,3) + 37*F(:,2) - 9*F(:,1));<BR> F= ;<BR> % Corrector<BR> y0 = y0 + h/24*(9*F(:,4) + 19*F(:,3) - 5*F(:,2) + 1*F(:,1));<BR> F(:,4) = feval(odefun,t,y0);<BR> yout=;<BR>end<BR></P> 简单吗?我看不懂呢
页:
[1]