Fortran Code For 8-Dimension Definite Integral (F-77)
Fortran Code For 8-Dimension Definite Integral (F-77)
It was a challenge to extend the triple integral formula[2] , based on Simpson’s 1/3rd formula, to higher
dimension. Deriva ons were done from 2 to 8-dimension definite integral. I am sharing an F-77 code
for the benefit of the society and applied researchers. The formula on can be converted to MATLAB
or any other programming language. The input file for 8-dimension integral is having 6561
coefficients. The speed and accuracy of results are mee ng the requirements.
Key words
Simpson’s 1/3rd integra on formula, integra on coefficients, code, execu on me, accuracy of results
N.T.Dadlani
Applied researcher
Introduc on
I was curious to know what is the link between two successive integra on formula [1,2]. It led me to
this development. Now, I can even write code for 20-dimension definite integral. Since, coefficients are
stored in a file, the execu on of main file hardly takes one second. I am appending code and its output.
Many applica ons may be tackled now.
Execu on
Code has been wri en in Fortran-77 and proper loops have been provided for itera on. The
coefficients have been derived ,as below, for various dimensions of definite integral:
2-dimension: 9 coefficients
3-dimension: 27 coefficients
4-dimension: 81 -do-
Conclusion:
The code has been successfully compiled and linked with INTEL classic compiler and checked the
output for 8-dimension integral. The execu on was done in less than one second. The results are
perfectly ok.
Applied research in mathema cs 17-11-2024
The above technique can be used for numerical differen a on to find out the coefficients of
differen a on.
Bibliography
1 [J. M. McCormick & M. G. Salvadori] Numerical Methods in Fortran,
Pren ce Hall
Annexures
XA := 0 XB := 1 YA := 0 YB := 1
1 1
2 7
( x + y) dx dy =
6
0 0
================================
XA := 0 XB := 1 YA := 0 YB := 1 ZA := 0 ZB := 1
1 1 1
2 5
( x + y + z ) dx dy dz =
2
0 0 0
============================================================
XA := 0 XB := 1 YA := 0 YB := 1 ZA := 0 ZB := 1
WA := 0 WB := 1
1 1 1 1
2 13
( x + y + z + w) dx dy dz dw =
3
0 0 0 0
=======================================================
XA := 0 XB := 1 YA := 0 YB := 1 ZA := 0 ZB := 1
WA := 0 WB := 1 VA := 0 VB := 1
1 1 1 1 1
2 20
( x + y + z + w + v) dx dy dz dw dv = = 6.667
3
0 0 0 0 0
========================================================
XA := 0 XB := 1 YA := 0 YB := 1 ZA := 0 ZB := 1
WA := 0 WB := 1 VA := 0 VB := 1 UA := 0 UB := 1
1 1 1 1 1 1
2 19
( x + y + z + w + v + u ) dx dy dz dw dv du = 9.5
2
0 0 0 0 0 0
========================================================
num_intg8.xmcd 1
17-11-2024
XA := 0 XB := 1 YA := 0 YB := 1 ZA := 0 ZB := 1
WA := 0 WB := 1 VA := 0 VB := 1 UA := 0 UB := 1
SA := 0 SB := 1
1 1 1 1 1 1 1
2 77
( x + y + z + w + v + u + s) dx dy dz dw dv du ds = = 12.833
6
0 0 0 0 0 0 0
===========================================================
XA := 0 XB := 1 YA := 0 YB := 1 ZA := 0 ZB := 1
WA := 0 WB := 1 VA := 0 VB := 1 UA := 0 UB := 1
SA := 0 SB := 1 RA := 0 RB := 1
1 1 1 1 1 1 1 1
2 50
( x + y + z + w + v + u + s + r) dx dy dz dw dv du ds dr =
3
0 0 0 0 0 0 0 0
Present case
==================================================================
XA := 0 XB := 1 YA := 0 YB := 1 ZA := 0 ZB := 1
WA := 0 WB := 1 VA := 0 VB := 1 UA := 0 UB := 1
SA := 0 SB := 1 RA := 0 RB := 1 QA := 0 QB := 1
PA := 0 PB := 1
1 1 1 1 1 1 1 1 1 1
2
x + y + z ... dx dy dz dw dv du ds dr dq dp = 22.44
+ w + v + u ...
+ s + r + q ...
+ p
0 0 0 0 0 0 0 0 0 0
num_intg8.xmcd 2
17-11-2024
C INTEG8.FOR (20-02-2017)
C Ref:- Numerical methods in Fortran
C J.M.McCormick and M.G.Salvadori
C Program no.9.9a/Page 316
C Theory on page 121
C
C 8-Dimension Definite Integral, TERMS=3^8=6561, SUMM(K), K=4
C
DIMENSION CO (6561),FZ(6561),SUMM(4),X(3),Y(3),Z(3),
1 W(3),V(3),U(3),S(3),R(3)
C
NI=50
NO=66
C
OPEN (UNIT=50,FILE='INTEG8.TXT')
OPEN (UNIT=66,FILE='INTEG8.OP')
C
DO 20 N=1,6561
READ(NI,*) CO(N)
WRITE (NO,010) CO(N)
010 FORMAT (16X,8HCO(N) = ,E)
20 CONTINUE
C
C WRITE(*,*)'NUMX,NUMY,...,XA ,XB ,YA , YB... '
17-11-2024
LIMITS OF INTEGRATION
NUMX = 1 NUMY = 1
XA = 0.0000000E+00 XB = 0.1000000E+01
YA = 0.0000000E+00 YB = 0.1000000E+01
K XH YH INTEGRAL
1 0.50000 0.50000 0.1666689E+02
2 0.25000 0.25000 0.1667004E+02