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