Mathc initiation/c57ca


Sommaire


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

Crystal Clear mimetype source c.png c17a.c
'
/* ---------------------------------- */
/* save as c17a.c                    */
/* --------------------------------- */
#include "x_hfile.h"
#include      "fa.h"
/* --------------------------------- */
int main(void)
{
double a = 0;
double b = 9;
int    n = 2*20;
int   ny = 2*20;

double m = 0;
double Mx= 0;
double My= 0;

 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 = sqrt(x), x = 9, y = 0,  \n\n");
 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",   b);
 printf(" a :         %+.1f \n\n",   a);
 printf(" u :   (x)-> %s      \n", ueq);
 printf(" v :   (x)-> %s    \n\n", veq);

 stop();

 clrscrn();

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

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

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

 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();

 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), x = 9, y = 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 

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

 Press return to continue.


Exemple de sortie écran :

 Compute the mass m.
         (b     (v(x)
 m =  int(   int(     f(x,y)  dy dx = 117.5
         (a     (u(x)

 Compute the moment Mx.
         (b     (v(x)
 Mx = int(   int(    y  f(x,y)  dy dx = 153.9
         (a     (u(x)

 Compute the moment My.
         (b     (v(x)
 My = int(   int(     x  f(x,y)  dy dx = 746.4
         (a     (u(x)

   The center of mass is (X,Y)

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

 Press return to continue.