Aller au contenu

Mathc initiation/c35ca

Un livre de Wikilivres.


Sommaire


Installer et compiler ces fichiers dans votre répertoire de travail.

c00a.c
/* ---------------------------------- */
/* save as c00a.c                     */
/* ---------------------------------- */
#include  "x_hfile.h"
#include       "fa.h"
/* --------------------------------- */
int main(void)
{
double az = 0,
       bz = 1,
       nz = 2*50, nx = 2*50, ny = 2*50;

double M =  trapezoid_dxdydz(f,
                             ux, vx, nx,
                             sy, ty, ny,
                             az, bz, nz);
 
 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);

 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);
 
 printf(" Code Mathematica : \n\n"
        " integral y z   dx dy dz from 0 to "
        "(1-y-z) from 0 to 1 from 0 to (1-z)\n\n\n");
 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.