|
!' y'=F(x,y)
OPTION BASE 0
LET XS=0 !' XS~XEまで
LET XE=1
LET X=XS
LET Y=1 !'初期値
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/2,Y+H/2*K1)
LET K3=F(X+H,Y+H*(2*K2-K1))
LET Y=Y+H*(K1+4*K2+K3)/6
LET X=X+H
LET XX(I)=X
LET YY(I)=Y
PRINT X;Y;X^3+3*X^2+X+1
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+6*X+1
END FUNCTION
以下略
EXTERNAL SUB CALC(N,XX(),YY(),A())
END SUB
EXTERNAL SUB DISPLAY(N,A())
END SUB
EXTERNAL FUNCTION NUM(X)
END FUNCTION
|
|