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