|
!' y'=F(x,y)
OPTION BASE 0
LET XS=0 !' XS~XEまで
LET XE=1
LET X=XS
LET Y=0 !'初期値
LET N=8 !'分割数
LET H=(XE-XS)/N
DIM XX(N),YY(N),A(N)
FOR I=1 TO N
LET Y=Y+H*(F(X,Y)+H/2*(FX(X,Y)+FY(X,Y)*F(X,Y)))
LET X=X+H
LET XX(I)=X
LET YY(I)=Y
PRINT X;Y;X^4/4
NEXT I
CALL CALC(N,XX,YY,A)
CALL DISPLAY(N-1,A)
END
EXTERNAL FUNCTION F(X,Y) !' y'=f(x,y)
LET F=X^3
END FUNCTION
EXTERNAL FUNCTION FX(X,Y)
LET H=1/256
LET FX=(F(X-2*H,Y)-8*F(X-H,Y)+8*F(X+H,Y)-F(X+2*H,Y))/(12*H)
END FUNCTION
EXTERNAL FUNCTION FY(X,Y)
LET H=1/256
LET FY=(F(X,Y-2*H)-8*F(X,Y-H)+8*F(X,Y+H)-F(X,Y+2*H))/(12*H)
END FUNCTION
以下略
EXTERNAL SUB CALC(N,XX(),YY(),A())
END SUB
EXTERNAL SUB DISPLAY(N,A())
END SUB
EXTERNAL FUNCTION NUM(X)
END FUNCTION
|
|