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)
{
CTRL_splot w = i_ctrl_splot(-1,10,-1,4, 0,0, 0,0, 0,0);

double step =  .01;

double  m = simpson_dydx(f,  u,v,LOOP, ax,bx,LOOP);
double My = simpson_dydx(xf, u,v,LOOP, ax,bx,LOOP);
double Mx = simpson_dydx(yf, u,v,LOOP, ax,bx,LOOP);

pt2d    d = i_pt2d(My/m, Mx/m);

 clrscrn();

 printf(" Find the mass and the center of mass of the lamina\n");
 printf(" that has the shape of the region bounded by the   \n");
 printf(" graphs of the given equations.\n\n");

 printf(" y = %s, y = %s, x = %+.1f, x = %+.1f,  \n\n", veq, ueq, bx ,ax);
 printf(" and f(x,y)  (the area mass density at (x,y)) \n\n");
 printf(" f : (x,y)-> %s    \n\n", feq);
 printf(" These give :      \n\n");
 printf(" b :         %+.1f   \n",  bx);
 printf(" a :         %+.1f \n\n",  ax);
 printf(" v :   (x)-> %s      \n", veq);
 printf(" u :   (x)-> %s    \n\n", ueq);
 stop();
 
 clrscrn();

 printf("   Compute the mass m.\n\n");
 printf("         (b     (v(x)\n");
 printf(" m =  int(   int(     f(x,y)  dy dx\n");
 printf("         (a     (u(x)\n\n");

 printf("   Compute the moment Mx.\n\n");
 printf("         (b     (v(x)\n");
 printf(" Mx = int(   int(    y  f(x,y)  dy dx\n");
 printf("         (a     (u(x)\n\n");

 printf("   Compute the moment My.\n\n");
 printf("         (b     (v(x)\n");
 printf(" My = int(   int(     x  f(x,y)  dy dx\n");
 printf("         (a     (u(x)\n\n");

 printf("   The center of mass is (X,Y)\n\n");
 printf("     X = My/m      Y = Mx/m \n\n");
 stop();

 clrscrn();

 printf("   Compute the mass m.\n\n"); 
 printf("        (%.3f  (%s\n",      bx,veq);
 printf(" m = int(    int(       %s  dy dx = %.3f\n", feq, m);
 printf("        (%.3f  (%s\n\n",  ax,ueq); 
 
 printf("   Compute the moment Mx.\n\n");
 printf("         (%.3f  (%s\n",      bx,veq);
 printf(" Mx = int(    int(       %s  dy dx = %.3f\n", yfeq, Mx);
 printf("         (%.3f  (%s\n\n",  ax,ueq);

 printf("   Compute the moment My.\n\n");
 printf("         (%.3f  (%s\n",      bx,veq);
 printf(" My = int(    int(       %s  dy dx = %.3f\n", xfeq, My);
 printf("         (%.3f  (%s\n\n",  ax,ueq);
 
 printf("   The center of mass is (X,Y)\n\n");
 printf("     X = My/m = %.2f     Y = Mx/m = %.2f\n\n",My/m,Mx/m);
 stop();

 clrscrn();
 
         G_uv(w,
              ax,bx,
              d,
              step,
              v,u);
 stop();
 
 return 0;
}
/* --------------------------------- */
/* --------------------------------- */


En mécanique, le centre de masse d'une plaque homogène est le point par rapport auquel la masse est uniformément répartie. Pratiquement, dans le cas d'un champ de pesanteur uniforme le centre de masse est confondu avec le centre de gravité de la plaque.

Calculons le centre de masse d'une plaque non homogène.

Exemple de sortie écran :

 Find the mass and the center of mass of the lamina
 that has the shape of the region bounded by the   
 graphs of the given equations.

 y = sqrt(x), y = 0.0, x = +9.0, x = +0.0,  

 and f(x,y)  (the area mass density at (x,y)) 

 f : (x,y)-> (x + y)    

 These give :      

 b :         +9.0   
 a :         +0.0 

 v :   (x)-> sqrt(x)      
 u :   (x)-> 0.0    

 Press return to continue.
the center of mass of the lamina. Gnuplot. Language C

Exemple de sortie écran :

   Compute the mass m.

         (b     (v(x)
 m =  int(   int(     f(x,y)  dy dx
         (a     (u(x)

   Compute the moment Mx.

         (b     (v(x)
 Mx = int(   int(    y  f(x,y)  dy dx
         (a     (u(x)

   Compute the moment My.

         (b     (v(x)
 My = int(   int(     x  f(x,y)  dy dx
         (a     (u(x)

   The center of mass is (X,Y)

     X = My/m      Y = Mx/m 

 Press return to continue.


Exemple de sortie écran :

   Compute the mass m.

        (9.000  (sqrt(x)
 m = int(    int(       (x + y)  dy dx = 117.450
        (0.000  (0.0

   Compute the moment Mx.

         (9.000  (sqrt(x)
 Mx = int(    int(       (y)* (x + y)  dy dx = 153.900
         (0.000  (0.0

   Compute the moment My.

         (9.000  (sqrt(x)
 My = int(    int(       (x)* (x + y)  dy dx = 746.357
         (0.000  (0.0

   The center of mass is (X,Y)

     X = My/m = 6.35     Y = Mx/m = 1.31

 Press return to continue.