Aller au contenu

Mathc initiation/004v

Un livre de Wikilivres.


Sommaire

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

c0d1.c
/* --------------------------------- */
/* save as c0d1.c                    */
/* --------------------------------- */
#include   "x_afile.h"
#include        "fd.h"
/* --------------------------------- */
int main(void)
{
double  Ix =  simpson_dzdydx( yzR, z0,z1,LOOP, y0,y1,LOOP, x0,x1,LOOP);
double  Iy =  simpson_dzdydx( xzR, z0,z1,LOOP, y0,y1,LOOP, x0,x1,LOOP);
double  Iz =  simpson_dzdydx( xyR, 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);
 stop();

 clrscrn();
 
 printf(" The Moments of inertia of the solid are :\n\n\n");
 printf("         (%+.1f  (%s     (%s    \n",   x1, y1eq, z1eq);
 printf(" Ix = int(   int(    int( %s%.0f dz dy dx = %.2f\n",
                                              yzReq, R(0,0,0),Ix);
 printf("         (%+.1f  (%s     (%s\n\n\n", x0, y0eq, z0eq);

 printf("         (%+.1f  (%s     (%s    \n",   x1, y1eq, z1eq);
 printf(" Iy = int(   int(    int( %s%.0f dz dy dx = %.2f\n",
                                              xzReq, R(0,0,0),Iy);
 printf("         (%+.1f  (%s     (%s\n\n\n", x0, y0eq, z0eq);

 printf("         (%+.1f  (%s     (%s    \n",   x1, y1eq, z1eq);
 printf(" Iz = int(   int(    int( %s%.0f dz dy dx = %.2f\n",
                                             xyReq, R(0,0,0),Iz);
 printf("         (%+.1f  (%s     (%s\n\n\n", x0, y0eq, z0eq);
 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

 Press return to continue. 


 The Moments of inertia of the solid are :


         (+3.0  (+3     ((+cos(x)*sin(y) + 4)    
 Ix = int(   int(    int( (y**2 + z**2)*1 dz dy dx = 617.96
         (-0.0  (-0     ((+cos(x)*sin(y) - 4)


         (+3.0  (+3     ((+cos(x)*sin(y) + 4)    
 Iy = int(   int(    int( (x**2 + z**2)*1 dz dy dx = 617.96
         (-0.0  (-0     ((+cos(x)*sin(y) - 4)


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


 Press return to continue.

Exemple de sortie écran :

 The function of density is :

  R : x,y,z -> 100

 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

 Press return to continue. 


 The Moments of inertia of the solid are :


         (+3.0  (+3     ((+cos(x)*sin(y) + 4)    
 Ix = int(   int(    int( (y**2 + z**2)*100 dz dy dx = 61796.10
         (-0.0  (-0     ((+cos(x)*sin(y) - 4)


         (+3.0  (+3     ((+cos(x)*sin(y) + 4)    
 Iy = int(   int(    int( (x**2 + z**2)*100 dz dy dx = 61796.10
         (-0.0  (-0     ((+cos(x)*sin(y) - 4)


         (+3.0  (+3     ((+cos(x)*sin(y) + 4)    
 Iz = int(   int(    int( (x**2 + y**2)*100 dz dy dx = 43200.00
         (-0.0  (-0     ((+cos(x)*sin(y) - 4)


 Press return to continue.