|
!' y'''=F(x,y,y',y'') DY=y' DY2=y''
LET XS=0 !' XS~XEまで
LET XE=1
LET X=XS
LET Y=0 !'初期値 y
LET DY=0 !'初期値 y'
LET DY2=0 !'初期値 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*F(X,Y,DY,DY2)
LET J2=H*(DY+K1/2)
LET K2=H*(DY2+L1/2)
LET L2=H*F(X+H/2,Y+J1/2,DY+K1/2,DY2+L1/2)
LET J3=H*(DY+K2/2)
LET K3=H*(DY2+L2/2)
LET L3=H*F(X+H/2,Y+J2/2,DY+K2/2,DY2+L2/2)
LET J4=H*(DY+K3)
LET K4=H*(DY2+L3)
LET L4=H*F(X+H,Y+J3,DY+K3,DY2+L3)
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
PRINT X,Y;-1/3*EXP(-X)+1/16*EXP(-2*X)+1/48*EXP(2*X)-1/4*X+1/4
NEXT I
END
EXTERNAL FUNCTION F(X,Y,DY,DY2) !' y'''=f(x,y,y',y'')
LET F=-DY2+4*DY+4*Y+X !' y'''+y''-4y'-4y-x=0
END FUNCTION
|
|