Aller au contenu

Mathc initiation/004q

Un livre de Wikilivres.

Sommaire

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

c0b3.c
/* --------------------------------- */
/* save as c0b3.c                    */
/* --------------------------------- */
#include   "x_afile.h"
#include        "fb.h"
/* --------------------------------- */
int main(void)
{
double  Mass =  simpson_dzdydx(R,
                               z0, z1, LOOP,
                               y0, y1, LOOP,
                               x0, x1, LOOP);
 
 clrscrn();
 printf(" The function of density is :\n\n"
        " R : x,y,z  -> %.0f\n\n", R(0,0,0));

 printf(" f  : x,y,z -> %s\n\n",  feq);
 
 printf(" z1 : x,y   -> %s  \n", z1eq);
 printf(" z0 : x,y   -> %s\n\n", z0eq);
  
 printf(" y1 : x     -> %s  \n", y1eq);
 printf(" y0 : x     -> %s\n\n", y0eq);

 printf(" x1 :       -> %s  \n", x1eq); 
 printf(" x0 :       -> %s\n\n", x0eq);

 printf(" The mass is :\n\n");
 printf("        (%+.1f  (%s     (%s    \n",   x1, y1eq, z1eq);
 printf(" M = int(   int(    int(      %.0f  dz dy dx = %.2f\n", 
                                               R(0,0,0), Mass);
 printf("        (%+.1f  (%s     (%s\n\n\n",   x0, y0eq, z0eq);
 stop();
 
 clrscrn();
 printf(" Code Mathematica : The mass is \n\n"
        " integral %.0f dz dy dx from (+cos(x)*sin(y) - 4) to"
        " (+cos(x)*sin(y) + 4) from 0  to 3 from  0  to 3\n\n\n", 
          R(0,0,0));
        
 stop();

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

Exemple de sortie écran :

 The function of density is :

 R : x,y,z  -> 1

 f  : x,y,z -> 1

 z1 : x,y   -> (+cos(x)*sin(y) + 4)  
 z0 : x,y   -> (+cos(x)*sin(y) - 4)

 y1 : x     -> +3  
 y0 : x     -> -0

 x1 :       -> +3  
 x0 :       -> -0

 The mass is :

        (+3.0  (+3     ((+cos(x)*sin(y) + 4)    
 M = int(   int(    int(      1  dz dy dx = 72.00
        (-0.0  (-0     ((+cos(x)*sin(y) - 4)


 Press return to continue.