相关代码 |
|
Sub QGAUS(A, B, SS) Dim X(5), W(5) X(1) = 0.1488743389 X(2) = 0.4333953941 X(3) = 0.6794095682 X(4) = 0.8650633666 X(5) = 0.9739065285 W(1) = 0.2955242247 W(2) = 0.2692667193 W(3) = 0.2190863625 W(4) = 0.1494513491 W(5) = 0.0666713443 XM = 0.5 * (A + B) XR = 0.5 * (B - A) SS = 0# For J = 1 To 5 DX = XR * X(J) SS = SS + W(J) * (FUNC(XM + DX) + FUNC(XM - DX)) Next J SS = XR * SS End Sub