Mathc initiation/c58ba
Installer ce fichier dans votre répertoire de travail.
/* save as fa.h */
double f(
double x,
double y)
 return( (x + y) );
/* ---------------------------------- */
char feq[] = "x + y";
/* ---------------------------------- */
double u(
double x)
 return( ( 0) );
/* ---------------------------------- */
char ueq[] = "0";
/* ---------------------------------- */
double v(
double x)
 return( sqrt(x) );
/* ---------------------------------- */
char veq[] = "sqrt(x)";
/* ---------------------------------- */
double g(
double x,
double y)
 return( x*x* (x + y) );
/* ---------------------------------- */
char geq[] = "x**2 (x + y)";
/* ---------------------------------- */
double h(
double x,
double y)
 return( y*y* (x + y) );
/* ---------------------------------- */
char heq[] = "y**2 (x + y)";
/* ---------------------------------- */
double gplsh(
double x,
double y)
 return( (x*x + y*y)* (x + y) );
/* ---------------------------------- */
char gplsheq[] = "(x**2 + y**2) (x + y)";
/* ---------------------------------- */
 Déclaration des fichiers h.

Mathc initiation/c58bb
Installer ce fichier dans votre répertoire de travail.
/* save as fb.h */
double f(
double x,
double y)
 return( x );
/* ---------------------------------- */
char feq[] = "x";
/* ---------------------------------- */
double u(
double y)
 return( (y*y) );
/* ---------------------------------- */
char ueq[] = "y**2";
/* ---------------------------------- */
double v(
double y)
 return( (4) );
/* ---------------------------------- */
char veq[] = "4";
/* ---------------------------------- */
double g(
double x,
double y)
 return (x*x* x );
/* ---------------------------------- */
char geq[] = "x**2 x";
/* ---------------------------------- */
double h(
double x,
double y)
 return (y*y* x );
/* ---------------------------------- */
char heq[] = "y**2 x";
/* ---------------------------------- */
double gplsh(
double x,
double y)
 return( (x*x + y*y)* (x) );
/* ---------------------------------- */
char gplsheq[] = "(x**2 + y**2) (x)";
/* ---------------------------------- */
 Déclaration des fichiers h.

Mathc initiation/c58ca
Installer et compiler ces fichiers dans votre répertoire de travail.
/* save as c17a.c */
int main(void)
double a = 0;
double b = 9; 
double nx = 2*20;
double ny = 2*20; 
double Ix = 0; 
double Iy = 0; 
double I0 = 0; 
 clrscrn();
 printf(" Find the polar moment of inertia 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\n");
 printf(" f : (x,y)-> %s \n\n", feq);
 printf(" These give : \n\n");
 printf(" v : (x)-> %s \n", veq);
 printf(" u : (x)-> %s \n\n", ueq);
 printf(" b : %+.1f \n", b);
 printf(" a : %+.1f \n\n", a);
 stop();
 clrscrn();
 Ix = simpson_dydx(h,a,b,nx,u,v,ny);
 printf(" Compute the moment of inertia Ix.\n");
 printf(" (b (v(x)\n");
 printf(" Ix = int( int( y**2 f(x,y) dy dx = %.1f\n", Ix);
 printf(" (a (u(x)\n\n");
 Iy = simpson_dydx(g,a,b,nx,u,v,ny);
 printf(" Compute the moment of inertia Iy.\n");
 printf(" (b (v(x)\n");
 printf(" Iy = int( int( x**2 f(x,y) dy dx = %.1f\n", Iy);
 printf(" (a (u(x)\n\n");
 printf(" The polar moment of inertia : ");
 printf(" I0 = Ix + Iy = %.1f\n\n",Ix+Iy);
 I0 = simpson_dydx(gplsh,a,b,nx,u,v,ny);
 printf(" or directly.\n\n");
 printf(" (b (v(x)\n");
 printf(" I0 = int( int( (x**2 + y**2) f(x,y) dy dx = %.1f\n", I0);
 printf(" (a (u(x)\n\n");
 stop();
 return 0;
/* ---------------------------------- */
 Le moment d'inertie est une mesure de la résistance d'un objet à l'accélération angulaire. Le moment d'inertie polaire est une mesure de la résistance d'un objet à la torsion.
Exemple de sortie écran :
 Find the polar moment of inertia 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 : 
 v : (x)-> sqrt(x) 
 u : (x)-> 0 
 b : +9.0 
 a : +0.0 
 Press return to continue. 
Exemple de sortie écran :
 Compute the moment of inertia Ix.
 (b (v(x)
 Ix = int( int( y**2 f(x,y) dy dx = 269.0
 (a (u(x)
 Compute the moment of inertia Iy.
 (b (v(x)
 Iy = int( int( x**2 f(x,y) dy dx = 5194.1
 (a (u(x)
 The polar moment of inertia : I0 = Ix + Iy = 5463.2
 or directly.
 (b (v(x)
 I0 = int( int( (x**2 + y**2) f(x,y) dy dx = 5463.2
 (a (u(x)
 Press return to continue.

Mathc initiation/c58cb
Installer et compiler ces fichiers dans votre répertoire de travail.
/* save as c17b.c */
int main(void)
double a = -2;
double b = 2; 
double nx = 2*20;
double ny = 2*20; 
double Ix = 0; 
double Iy = 0; 
double I0 = 0; 
/* ---------------------------------- */
 clrscrn();
 printf(" Find the polar moment of inertia 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 f(x,y) (the area mass density at (x,y)) \n\n\n");
 printf(" f : (x,y)-> %s \n\n", feq);
 printf(" These give : \n\n");
 printf(" v : (y)-> %s \n", veq);
 printf(" u : (y)-> %s \n\n", ueq);
 printf(" b : %+.1f \n", b);
 printf(" a : %+.1f \n\n", a);
 stop();
 clrscrn();
 Ix = simpson_dxdy(h,u,v,nx,a,b,ny);
 printf(" Compute the moment of inertia Ix.\n");
 printf(" (b (v(y)\n");
 printf(" Ix = int( int( y**2 f(x,y) dx dy = %.1f\n", Ix);
 printf(" (a (u(y)\n\n");
 Iy = simpson_dxdy(g,u,v,nx,a,b,ny);
 printf(" Compute the moment of inertia Iy.\n");
 printf(" (b (v(y)\n");
 printf(" Iy = int( int( x**2 f(x,y) dx dy = %.1f\n", Iy);
 printf(" (a (u(y)\n\n");
 printf(" The polar moment of inertia : ");
 printf(" I0 = Ix + Iy = %.1f\n\n",Ix+Iy);
 I0 = simpson_dxdy(gplsh,u,v,nx,a,b,ny);
 printf(" or directly.\n\n");
 printf(" (b (v(y)\n");
 printf(" I0 = int( int( (x**2 + y**2) f(x,y) dx dy = %.1f\n", I0);
 printf(" (a (u(y)\n\n");
 stop();
 return 0;
/* ---------------------------------- */
 Le moment d'inertie est une mesure de la résistance d'un objet à l'accélération angulaire. Le moment d'inertie polaire est une mesure de la résistance d'un objet à la torsion.
Exemple de sortie écran :
 Find the polar moment of inertia of the lamina
 that has the shape of the region bounded by the 
 graphs of the given equations.
 x = y**2, x = 4, 
 and f(x,y) (the area mass density at (x,y)) 
 f : (x,y)-> x 
 These give : 
 v : (y)-> 4 
 u : (y)-> y**2 
 b : +2.0 
 a : -2.0 
 Press return to continue. 
Exemple de sortie écran :
 Compute the moment of inertia Ix.
 (b (v(y)
 Ix = int( int( y**2 f(x,y) dx dy = 24.4
 (a (u(y)
 Compute the moment of inertia Iy.
 (b (v(y)
 Iy = int( int( x**2 f(x,y) dx dy = 227.6
 (a (u(y)
 The polar moment of inertia : I0 = Ix + Iy = 251.9
 or directly.
 (b (v(y)
 I0 = int( int( (x**2 + y**2) f(x,y) dx dy = 251.9
 (a (u(y)
 Press return to continue.