Mathc initiation/c57cc
Installer et compiler ces fichiers dans votre répertoire de travail.
c00c.c |
---|
/* --------------------------------- */
/* save as c00c.c */
/* --------------------------------- */
#include "x_hfile.h"
#include "fc.h"
/* --------------------------------- */
int main(void)
{
CTRL_splot w = i_ctrl_splot(-1,1,0.4,1.5, 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 = 1/cos(x), y = 1./2., x = +0.8, x = -0.8,
and f(x,y) (the area mass density at (x,y))
f : (x,y)-> 4
These give :
b : +0.8
a : -0.8
v : (x)-> 1/cos(x)
u : (x)-> 1./2.
Press return to continue.
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.
(0.785 (1/cos(x)
m = int( int( 4 dy dx = 3.909
(-0.785 (1./2.
Compute the moment Mx.
(0.785 (1/cos(x)
Mx = int( int( (y)* (4) dy dx = 3.215
(-0.785 (1./2.
Compute the moment My.
(0.785 (1/cos(x)
My = int( int( (x)* (4) dy dx = 0.000
(-0.785 (1./2.
The center of mass is (X,Y)
X = My/m = 0.00 Y = Mx/m = 0.82
Press return to continue.