|
!' y''=F(x,y,y') DY=y'
LET XS=0 !' XS~XEまで
LET XE=1
LET X=XS
LET Y=0 !'初期値 y
LET DY=0 !'初期値 y'
LET N=8 !'分割数
LET H=(XE-XS)/N
FOR I=1 TO N
LET J1=H*DY
LET K1=H*F(X,Y,DY)
LET J2=H*(DY+K1/2)
LET K2=H*F(X+H/2,Y+J1/2,DY+K1/2)
LET J3=H*(DY+K2/2)
LET K3=H*F(X+H/2,Y+J2/2,DY+K2/2)
LET J4=H*(DY+K3)
LET K4=H*F(X+H,Y+J3,DY+K3)
LET X=X+H
LET Y=Y+(J1+2*J2+2*J3+J4)/6
LET DY=DY+(K1+2*K2+2*K3+K4)/6
PRINT X,Y;9.80665/2*X*X
NEXT I
END
EXTERNAL FUNCTION F(X,Y,DY) !' y''=f(x,y,y')
LET F=9.80665 !' y''=9.80665
END FUNCTION
|
|