Aller au contenu

Mathc initiation/002l

Un livre de Wikilivres.

Application

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

c00b1.c
/* --------------------------------- */
/* save as c00b1.c                   */
/* --------------------------------- */
#include  "x_hfile.h"
#include      "fb1.h"
/* --------------------------------- */
int main(void)
{
double  M =  simpson_dxdydz(f,
                            x0, x1, LOOP,
                            y0, y1, LOOP,
                            z0, z1, LOOP);
 
 clrscrn();
 printf(" f : x,y,z -> %s\n\n", feq);

 printf(" x1 : y,z  -> %s  \n", x1eq);
 printf(" x0 : y,z  -> %s\n\n", x0eq);
 
 printf(" y1 : z    -> %s  \n", y1eq);
 printf(" y0 : z    -> %s\n\n", y0eq);
  
 printf(" z1 :      -> %s  \n", z1eq);
 printf(" z0 :      -> %s\n\n", z0eq);
 
 printf("        (%s     (%s      (%s    \n", z1eq, y1eq,  x1eq);
 printf(" A = int(   int(    int(      %s  dx dy dz = %.6f\n",feq, M);
 printf("        (%s     (%s      (%s\n\n\n", z0eq, y0eq,  x0eq);

 printf(" Code Mathematica : \n\n"
        " integral (x+z/5)   dx dy dz"
        " from (y/3) to (y/3+1)  from 0 to 5 from 0 to 6 \n\n");
 stop();

 return 0;
}
/* --------------------------------- */
/* --------------------------------- */

Exemple de sortie écran :

 f : x,y,z ->  (x+z/5)

 x1 : y,z  -> y/3+1  
 x0 : y,z  -> y/3 

 y1 : z    -> 6  
 y0 : z    -> 0

 z1 :      -> 5  
 z0 :      -> 0

        (5     (6      (y/3+1    
 A = int(   int(    int(       (x+z/5)  dx dy dz = 60.000000
        (0     (0      (y/3 


 Code Mathematica : 

 integral (x+z/5)   dx dy dz from (y/3) to (y/3+1)  from 0 to 5 from 0 to 6 

 Press return to continue.