Mathc initiation/c57cb


Sommaire


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

Crystal Clear mimetype source c.png c17b.c
'
/* ---------------------------------- */
/* save as c17b.c                    */
/* --------------------------------- */
#include "x_hfile.h"
#include      "fb.h"
/* --------------------------------- */
int main(void)
{
double ay = -2;
double by =  2;
int    ny =  2*20;

int    nx =  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(" x = y**2, x = 4,  \n\n");
 printf(" and if f(x,y), the area mass density at the point P(x,y),      \n");
 printf(" is directly proportional to the distance from the y-axis to P\n\n");
 printf(" f : (x,y)-> %s    \n\n", feq);
 printf(" These give :      \n\n");
 printf(" by :         %+.1f   \n",  by);
 printf(" ay :         %+.1f \n\n",  ay);
 printf("  u :   (y)-> %s      \n", ueq);
 printf("  v :   (y)-> %s    \n\n", veq);
 stop();

 clrscrn();

   m = simpson_dxdy(f,u,v,nx,ay,by,ny);
 printf(" Compute the mass m.\n");
 printf("         (by     (v(y)\n");
 printf(" m =  int(   int(     f(x,y)  dx dy = %.1f\n", m);
 printf("         (ay     (u(y)\n\n");

   Mx = simpson_dxdy(h,u,v,nx,ay,by,ny);
 printf(" Compute the moment Mx.\n");
 printf("         (by     (v(y)\n");
 printf(" Mx = int(   int(    y  f(x,y)  dx dy = %.1f\n", Mx);
 printf("         (ay     (u(y)\n\n");

   My = simpson_dxdy(g,u,v,nx,ay,by,ny);
 printf(" Compute the moment My.\n");
 printf("         (by     (v(y)\n");
 printf(" My = int(   int(     x  f(x,y)  dx dy = %.1f\n", My);
 printf("         (ay     (u(y)\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.

 x = y**2, x = 4,  

 and if f(x,y), the area mass density at the point P(x,y),      
 is directly proportional to the distance from the y-axis to P

 f : (x,y)-> x    

 These give :      

 by :         +2.0   
 ay :         -2.0 

  u :   (y)-> y**2      
  v :   (y)-> 4    

 Press return to continue.


Exemple de sortie écran :

 Compute the mass m.
         (by     (v(y)
 m =  int(   int(     f(x,y)  dx dy = 25.6
         (ay     (u(y)

 Compute the moment Mx.
         (by     (v(y)
 Mx = int(   int(    y  f(x,y)  dx dy = 0.0
         (ay     (u(y)

 Compute the moment My.
         (by     (v(y)
 My = int(   int(     x  f(x,y)  dx dy = 73.1
         (ay     (u(y)

   The center of mass is (X,Y)

     X = My/m = 2.86     Y = Mx/m = 0.00

 Press return to continue.