|
!' 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 K1=F(X,Y)
LET K2=F(X+H/3,Y+H*K1/3)
LET K3=F(X+2/3*H,Y+2/3*H*K2)
LET Y=Y+H*(K1+3*K3)/4
LET X=X+H
LET XX(I)=X
LET YY(I)=Y
PRINT X;Y;X^2
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=2*X
END FUNCTION
以下略
EXTERNAL SUB CALC(N,XX(),YY(),A())
END SUB
EXTERNAL SUB DISPLAY(N,A())
END SUB
EXTERNAL FUNCTION NUM(X)
END FUNCTION
|
|