?? d4r23.frm
字號:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5430
ClientLeft = 60
ClientTop = 345
ClientWidth = 4425
LinkTopic = "Form1"
ScaleHeight = 5430
ScaleWidth = 4425
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 375
Left = 2520
TabIndex = 0
Top = 4560
Width = 1335
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'PROGRAM D4R23
'Driver for routine BESSI1
Open "D:\VB常用數(shù)值算法集\DATA\FNCVAL.DAT" For Input As #1
Do
Line Input #1, Text$
Loop While Text$ <> "Modified Bessel Function I1"
Line Input #1, NVAL$
NVAL = Val(NVAL$)
Print Text$
Print
Print " X Actual BESSI1(X)"
For I = 1 To NVAL
Line Input #1, DUM$
X = Val(Mid(DUM$, 1, 6))
Value = Val(Mid(DUM$, 7))
Print Tab(4); Format$(X, "#0.##");
Print Tab(12); Format$(Value, ".0000000E+00");
Print Tab(28); Format$(BESSI1(X), ".0000000E+00")
Next I
Close #1
End Sub
Function BESSI1(X)
P1 = 0.5: P2 = 0.87890594
P3 = 0.51498869: P4 = 0.15084934
P5 = 0.02658733: P6 = 0.00301532
P7 = 0.00032411
Q1 = 0.39894228: Q2 = -0.03988024
Q3 = -0.00362018: Q4 = 0.00163801
Q5 = -0.01031555: Q6 = 0.02282967
Q7 = -0.02895312: Q8 = 0.01787654
Q9 = -0.00420059
If Abs(X) < 3.75 Then
Y = (X / 3.75) ^ 2
AAA = Y * (P4 + Y * (P5 + Y * (P6 + Y * P7)))
BESSI1 = X * (P1 + Y * (P2 + Y * (P3 + AAA)))
Else
AX = Abs(X)
Y = 3.75 / AX
AAA = Exp(AX) / Sqr(AX)
BBB = Y * (Q5 + Y * (Q6 + Y * (Q7 + Y * (Q8 + Y * Q9))))
BESSI1 = AAA * (Q1 + Y * (Q2 + Y * (Q3 + Y * (Q4 + BBB))))
End If
End Function
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -