Bonjour,
je possède un algorithme qui calcule la triple intégrale à l'aide de la méthode de gauss,le programme fonctionne parfaitement, le voila:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
! programme principal
!-------------------------------------------------------------------
      !implicit none
      external quad3d,qtrapx,qtrapy,qtrapz,y1,y2,z1,z2,func
      double precision qtrapx,qtrapy,qtrapz,y1,y2,z1,z2,func
	!double precision x1,x2,ss,pk
 
	x1=0.0
      x2=100.0
 
      call quad3d(x1,x2,ss)
 
      pk=ss
 
      write(6,*)pk
 
      end
 
! subroutine qui calcul une integrale triple
!-------------------------------------------------------------------
      subroutine quad3d(x1,x2,ss)
      real ss,x1,x2,h
      external h
      call qgausx(h,x1,x2,ss)
      return
      end
      function f(zz)
      real f,zz,func,x,y,z
      common /xyz/ x,y,z
      z=zz
      f=func(x,y,z)
      return
      end
 
      function g(yy)
      real g,yy,x,y,z,f,z1,z2
	external f
      common /xyz/ x,y,z
      y=yy
      call qgausz(f,z1(x,y),z2(x,y),ss)
      g=ss
      return
      end
 
      function h(xx)
      real h,xx,g,y1,y2,x,y,z
      external g
      common /xyz/ x,y,z
      real ss
      x=xx
      call qgausy(g,y1(x),y2(x),ss)
      h=ss
      return
      end
 
 
! LA fonction à integrer
!---------------------------------------------------------------------
 
      FUNCTION func(x,y,z)
 
      !func= x*(x+3*y)
	func=1.0
 
      RETURN
 
      END
 
! LA fonction z1(x)
!---------------------------------------------------------------------
 
      FUNCTION z1(x,y)
 
      z1= 0.0
 
      RETURN
 
      END
 
! LA fonction z2(x)
!---------------------------------------------------------------------
 
      FUNCTION z2(x,y)
 
      z2=100.0-x-y
 
      RETURN
 
       END
 
 
! LA fonction y1(x)
!---------------------------------------------------------------------
 
      FUNCTION y1(x)
 
      y1= 0.0
 
      RETURN
 
      END
 
! LA fonction y2(x)
!---------------------------------------------------------------------
 
      FUNCTION y2(x)
 
      y2= 100.0-x
 
      RETURN
 
       END
 
! INTEGRATION PAR LA METHODE DE GAUSS
!-----------------------------------------------------------------
      SUBROUTINE qgausx(func,a,b,ss)
      REAL a,b,ss,func
      EXTERNAL func
      INTEGER j
      REAL dx,xm,xr,w(5),x(5)
      SAVE W,x
      DATA w/.2955242247,.2692667193,.2190863625,.149451349,.0666713449/
      DATA x/.1488743389,.433395394,.6794095682,.8650633666,.9739065285/
      xm=0.5*(b+a)
      xr=0.5*(b-a)
      ss=0
      do 11 j=1,5
      dx=xr*x(j)
      ss=ss+w(j)*(func(xm+dx)+func(xm-dx))
11    continue
      ss=xr*ss
      return
      END
 
 
! INTEGRATION PAR LA METHODE DE GAUSS
 
      SUBROUTINE qgausy(func,a,b,ss)
      REAL a,b,ss,func
      EXTERNAL func
      INTEGER j
      REAL dx,xm,xr,w(5),x(5)
      SAVE W,x
      DATA w/.2955242247,.2692667193,.2190863625,.149451349,.0666713449/
      DATA x/.1488743389,.433395394,.6794095682,.8650633666,.9739065285/
      xm=0.5*(b+a)
      xr=0.5*(b-a)
      ss=0
      do 11 j=1,5
      dx=xr*x(j)
      ss=ss+w(j)*(func(xm+dx)+func(xm-dx))
11    continue
      ss=xr*ss
      return
      END
 
! INTEGRATION PAR LA METHODE DE GAUSS
 
      SUBROUTINE qgausz(func,a,b,ss)
      REAL a,b,ss,func
      EXTERNAL func
      INTEGER j
      REAL dx,xm,xr,w(5),x(5)
      SAVE W,x
      DATA w/.2955242247,.2692667193,.2190863625,.149451349,.0666713449/
      DATA x/.1488743389,.433395394,.6794095682,.8650633666,.9739065285/
      xm=0.5*(b+a)
      xr=0.5*(b-a)
      ss=0
      do 11 j=1,5
      dx=xr*x(j)
      ss=ss+w(j)*(func(xm+dx)+func(xm-dx))
11    continue
      ss=xr*ss
      return
      END


j'ai voulu comprendre le mode de fonctionnement et ce que j'ai compris c'est que cette méthode s'approche à la méthode de quadrature de gauss legendre qui est applicable seulement sur un intervalle d'intégration de -1 à 1, par contre mon programme fonctionne pour des intervalles beaucoup plus grands à l'aide d'un changement de variable je suppose mais je n'ai pas compris comment cela s'est fait.
svp aidez moi à comprendre comment fonctionne cet algorithme