Mathc initiation/c35ca
Installer et compiler ces fichiers dans votre répertoire de travail.
/* save as c17a.c */
int main(void)
double az,bz,nz, 
 nx, ny, M;
 clrscrn();
 printf(" f : x,y,z -> %s\n\n", feq);
 printf(" v : y,z -> %s \n", veq);
 printf(" u : y,z -> %s\n\n", ueq);
 printf(" t : z -> %s \n", teq);
 printf(" s : z -> %s\n\n", seq);
 az = 0;
 bz = 1;
 nz = 2*50; nx = 2*50; ny = 2*50;
 M = trapezoid_dxdydz( f,
 az, bz, nz,
 sy, ty, ny,
 ux, vx, nx);
 printf(" With the trapezoidal's rule.\n\n\n");
 printf(" (%+.1f (%s (%s \n", bz, teq, veq);
 printf(" A = int( int( int( %s dx dy dz = %.6f\n",feq, M);
 printf(" (%+.1f (%s (%s\n\n\n", az, seq, ueq);
 stop();
 return 0;
/* --------------------------------- */
Exemple de sortie écran :
 f : x,y,z -> y*z
 v : y,z -> 1-y-z 
 u : y,z -> 0
 t : z -> 1-z 
 s : z -> 0
 With the trapezoidal's rule.
 (+1.0 (1-z (1-y-z 
 A = int( int( int( y*z dx dy dz = 0.008331
 (+0.0 (0 (0
 Press return to continue.

Mathc initiation/c35cb
Installer et compiler ces fichiers dans votre répertoire de travail.
/* save as c17b.c */
int main(void)
double ay,by,ny,
 nx,nz,M;
 clrscrn();
 printf(" f : x,y,z -> %s\n\n", feq);
 printf(" v : y,z -> %s \n", veq);
 printf(" u : y,z -> %s\n\n", ueq);
 printf(" t : y -> %s \n", teq);
 printf(" s : y -> %s\n\n", seq);
 ay = -1;
 by = 1;
 ny = 2*150; nx = 2*150; nz = 2*150;
 M = trapezoid_dxdzdy( f,
 ay,by,ny,
 sz,tz,nz,
 ux,vx,nx);
 printf(" With the trapezoidal's rule.\n\n\n");
 printf(" (%+.1f (%s (%s \n", by, teq, veq);
 printf(" A = int( int( int( %s dx dz dy = %.6f\n",feq, M);
 printf(" (%+.1f (%s (%s\n\n\n", ay, seq, ueq);
 stop();
 return 0;
/* --------------------------------- */
Exemple de sortie écran :
 f : x,y,z -> 1
 v : y,z -> 2-y-z 
 u : y,z -> 0
 t : y -> sqrt(1-y**2) 
 s : y -> -sqrt(1-y**2)
 With the trapezoidal's rule.
 (+1.0 (sqrt(1-y**2) (2-y-z 
 A = int( int( int( 1 dx dz dy = 6.281905
 (-1.0 (-sqrt(1-y**2) (0
 Press return to continue.

Mathc initiation/c35cc
Installer et compiler ces fichiers dans votre répertoire de travail.
/* save as c17c.c */
int main(void)
double az,bz,nz,
 nx,ny,M;
 clrscrn();
 printf(" f : x,y,z -> %s\n\n", feq);
 printf(" v : x,z -> %s \n", veq);
 printf(" u : x,z -> %s\n\n", ueq);
 printf(" t : z -> %s \n", teq);
 printf(" s : z -> %s\n\n", seq);
 az = 0;
 bz = 1;
 nz = 2*50;nx = 2*50;ny = 2*50;
 M = trapezoid_dydxdz( f,
 az, bz, nz,
 sx, tx, nx,
 uy, vy, ny);
 printf(" With the trapezoidal's rule.\n\n\n");
 printf(" (%+.1f (%s (%s \n", bz, teq, veq);
 printf(" A = int( int( int( %s dy dx dz = %.6f\n",feq, M);
 printf(" (%+.1f (%s (%s\n\n\n", az, seq, ueq);
 stop();
 return 0;
/* --------------------------------- */
Exemple de sortie écran :
 f : x,y,z -> 1
 v : x,z -> z**2+x**2+1 
 u : x,z -> 0
 t : z -> 2-2*z 
 s : z -> 0
 With the trapezoidal's rule.
 (+1.0 (2-2*z (z**2+x**2+1 
 A = int( int( int( 1 dy dx dz = 1.833417
 (+0.0 (0 (0
 Press return to continue.

Mathc initiation/c35cd
Installer et compiler ces fichiers dans votre répertoire de travail.
/* save as c17d.c */
int main(void)
double ax,bx,nx, 
 ny,nz,M;
 clrscrn();
 printf(" f : x,y,z -> %s\n\n", feq);
 printf(" v : x,z -> %s \n", veq);
 printf(" u : x,z -> %s\n\n", ueq);
 printf(" t : x -> %s \n", teq);
 printf(" s : x -> %s\n\n", seq);
 ax = -1;
 bx = 1;
 nx = 2*50;ny = 2*50;nz = 2*50;
 M = trapezoid_dydzdx( f,
 ax,bx,nx,
 sz,tz,nz,
 uy,vy,ny);
 printf(" With the trapezoidal's rule.\n\n\n");
 printf(" (%+.1f (%s (%s \n", bx, teq, veq);
 printf(" A = int( int( int( %s dy dz dx = %.6f\n",feq, M);
 printf(" (%+.1f (%s (%s\n\n\n", ax, seq, ueq);
 stop();
 return 0;
/* --------------------------------- */
Exemple de sortie écran :
 f : x,y,z -> 1
 v : x,z -> 6-z 
 u : x,z -> 0
 t : x -> 4-x**2 
 s : x -> 3*x**2
 With the trapezoidal's rule.
 (+1.0 (4-x**2 (6-z 
 A = int( int( int( 1 dy dz dx = 20.265067
 (-1.0 (3*x**2 (0
 Press return to continue.

Mathc initiation/c35ce
Installer et compiler ces fichiers dans votre répertoire de travail.
/* save as c17e.c */
int main(void)
double ay,by,ny, 
 nx,nz,M;
 clrscrn();
 printf(" f : x,y,z -> %s\n\n", feq);
 printf(" v : x,y -> %s \n", veq);
 printf(" u : x,y -> %s\n\n", ueq);
 printf(" t : y -> %s \n", teq);
 printf(" s : y -> %s\n\n", seq);
 ay = 0;
 by = 4;
 ny = 2*50; nx = 2*50; nz = 2*50;
 M = trapezoid_dzdxdy( f,
 ay, by,ny,
 sx, tx,nx,
 uz, vz,nz);
 printf(" With the trapezoidal's rule.\n\n\n");
 printf(" (%+.1f (%s (%s \n", by, teq, veq);
 printf(" A = int( int( int( %s dz dx dy = %.6f\n",feq, M);
 printf(" (%+.1f (%s (%s\n\n\n", ay, seq, ueq);
 stop();
 return 0;
/* --------------------------------- */
Exemple de sortie écran :
 f : x,y,z -> 1
 v : x,y -> 4-y 
 u : x,y -> 0
 t : y -> sqrt(y) 
 s : y -> -sqrt(y)
 With the trapezoidal's rule.
 (+4.0 (sqrt(y) (4-y 
 A = int( int( int( 1 dz dx dy = 17.052845
 (+0.0 (-sqrt(y) (0
 Press return to continue.

Mathc initiation/c35cf
Installer et compiler ces fichiers dans votre répertoire de travail.
/* save as c17f.c */
int main(void)
double ax,bx,nx, ny, nz, M;
 clrscrn();
 printf(" f : x,y,z -> %s\n\n", feq);
 printf(" v : x,y -> %s \n", veq); 
 printf(" u : x,y -> %s\n\n", ueq);
 printf(" t : x -> %s \n", teq); 
 printf(" s : x -> %s\n\n", seq);
 ax = 0; 
 bx = 1; 
 nx = 2*50; ny = 2*50; nz = 2*50;
 M = trapezoid_dzdydx( f,
 ax, bx, nx,
 sy, ty, ny,
 uz, vz, nz);
 printf(" With the trapezoidal's rule.\n\n\n");
 printf(" (%+.1f (%s (%s \n", bx, teq, veq);
 printf(" A = int( int( int( %s dz dy dx = %.6f\n",feq, M);
 printf(" (%+.1f (%s (%s\n\n\n", ax, seq, ueq);
 stop();
 return 0;
/* --------------------------------- */
Exemple de sortie écran :
 f : x,y,z -> x*y
 v : x,y -> x**2*y**3 
 u : x,y -> x*y
 t : x -> x**2 
 s : x -> x
 With the trapezoidal's rule.
 (+1.0 (x**2 (x**2*y**3 
 A = int( int( int( x*y dz dy dx = 0.010582
 (+0.0 (x (x*y
 Press return to continue.

Mathc initiation/c36a1
Installer ce fichier dans votre répertoire de travail.
/* save as x_hfile.h */
 Déclaration des fichiers h.

Mathc initiation/c36a2
Installer ce fichier dans votre répertoire de travail.
/* save as x_def.h */
void clrscrn(void)
 printf("\n\n\n\n\n\n\n\n\n\n\n"
 "\n\n\n\n\n\n\n\n\n\n\n"
 "\n\n\n\n\n\n\n\n\n\n\n");
/* ---------------------------------- */
void stop(void)
 printf(" Press return to continue. ");
 getchar();
/* --------------------------------- */
Dans ce fichier il y a les utilitaires.

Mathc initiation/c36a3
Installer ce fichier dans votre répertoire de travail.
/* save as x_xyz.h */
double intx_dxdydz(
double (*P_f)(double x, double y, double z),
double z,
double y,
double (*Pux)(double y, double z),
double (*Pvx)(double y, double z),
 int nx
 int i = 0;
double m = 0.;
double M = 0.;
 for(i = 0; i <= nx; i++)
 M += m * (*P_f)( ((*Pux)(y,z)) + i*(((*Pvx)(y,z))-((*Pux)(y,z)))/nx, y, z);
 return( ((((*Pvx)(y,z)) -((*Pux)(y,z)))*M) / (3*nx) );
/* --------------------------------- */
double inty_dxdydz(
double (*P_f)(double x, double y, double z),
double z,
double (*Psy)(double x),
double (*Pty)(double x),
 int ny,
double (*Pux)(double y, double z),
double (*Pvx)(double y, double z),
 int nx
 int i = 0;
double m = 0.;
double M = 0.;
 for(i = 0; i <= ny; i++)
 M += m * intx_dxdydz((*P_f),
 z,
 (((*Psy)(z))+i*(((*Pty)(z))-((*Psy)(z)))/ny),
 (*Pux),
 (*Pvx),
 nx);
 return( ((((*Pty)(z)) -((*Psy)(z)))*M) / (3*ny) );
/* --------------------------------- */
double sympson_dxdydz(
double (*P_f)(double x, double y, double z),
double az,
double bz,
 int nz,
double (*Psy)(double x),
double (*Pty)(double x),
 int ny,
double (*Pux)(double y, double z),
double (*Pvx)(double y, double z),
 int nx
 int i = 0;
double m = 0.;
double M = 0.;
 for(i = 0; i <= nz; i++)
 M += m * inty_dxdydz((*P_f),
 (az+i*(bz-az)/nz),
 (*Psy),
 (*Pty),
 ny,
 (*Pux),
 (*Pvx),
 nx);
 return( ((bz -az)*M) / (3*nz) );
/* --------------------------------- */