BESSEL_K関数

 投稿者:しばっち  投稿日:2015年 8月 1日(土)21時58分13秒
  CALL GINIT(400,800)
SET WINDOW 0,10,-.1,.9
DRAW GRID(1,10)
FOR N=0 TO 5
   SET LINE COLOR N+1
   FOR X=0 TO 10 STEP 1/16
      LET Y=BESSELK(N,X)
      PLOT LINES:X,Y;
   NEXT  X
   PLOT LINES
NEXT N
END

EXTERNAL SUB GINIT(XSIZE,YSIZE)
SET BITMAP SIZE XSIZE,YSIZE
SET WINDOW 0,XSIZE-1,YSIZE-1,0
SET POINT STYLE 1
SET COLOR MODE "REGULAR"
SET COLOR MIX(0) 0,0,0
SET COLOR MIX(1) 0,0,1
SET COLOR MIX(2) 1,0,0
SET COLOR MIX(3) 1,0,1
SET COLOR MIX(4) 0,1,0
SET COLOR MIX(5) 0,1,1
SET COLOR MIX(6) 1,1,0
SET COLOR MIX(7) 1,1,1
CLEAR
END SUB

EXTERNAL  FUNCTION INTEGRAL(R,Z) !'ガウス・ラゲール
FOR I=1 TO 6
   READ X,W
   LET S=S+FF(R,Z,X)*EXP(X)*W
NEXT I
LET INTEGRAL=S
DATA     .2228466041792606894643548,4.5896467394996359356828488E-01
DATA    1.1889321016726230307431509,4.1700083077212099411337757E-01
DATA    2.9927363260593140776913253,1.1337338207404497573870619E-01
DATA    5.7751435691045105018398304,1.0399197453149074898913303E-02
DATA    9.8374674183825899177155470,2.6101720281493205947924286E-04
DATA   15.9828739806017017825457916,8.9854790642962123882529205E-07
END FUNCTION

EXTERNAL  FUNCTION FF(R,X,T)
LET FF=EXP(-X*COSH(T))*COSH(R*T)
END FUNCTION

EXTERNAL  FUNCTION BESSELK(R,X) !'Rは実数
LET S=INTEGRAL(ABS(R),X)
IF R<0 THEN LET S=S*(-1)^INT(ABS(R))
LET BESSELK=S
END FUNCTION
 

戻る