Mathc initiation/a33
La méthode des cylindres creux, est une méthode de calcul du volume d'un solide de révolution par intégration le long d'un axe «perpendiculaire» à l'axe de révolution. [wikipedia]
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)
{
int n = 2*1000;
double a = 1.;
double b = 2.;
double dx = .1;
double step = .001;
double M = 0.;
clrscrn();
printf(" Compute the volume of a solid of revolution,\n"
" generated by revolving R about the y-axis, \n"
" by using cylindrical shells. \n\n"
" Draw the region R bounded by the graph of f,\n"
" the graph of g,and x = a and x = b \n\n");
printf(" Let f >= g be continous on [%.3f,%.3f].\n\n", a, b);
printf(" f : x-> %s\n\n", feq);
printf(" g : x-> %s\n\n\n\n", geq);
printf(" To see the graphs, use ... "
" load \"a_main.plt\" ... with Gnuplot.\n\n\n\n");
G_g_ab(-3, /* xmin */
3, /* xmax */
0, /* ymin */
3.5, /* ymax */
a,
b,
feq,
geq,
f,
g
);
stop();
clrscrn();
printf(" Draw a typical vertical rectangle. \n\n\n\n"
" To see the graphs, use ... "
" load \"a_main.plt\" ... with Gnuplot.\n\n\n\n");
printf(" Thickness of shell : dx\n");
printf(" Average radius : (%s) \n", heq);
printf(" Altitude : (%s) - (%s)\n", feq, geq);
printf(" The volume : 2 Pi (%s) [(%s) - (%s)] dx\n\n\n",heq, feq, geq);
printf(" Volume of a cylindrical shell = 2Pi(average radius)(altitude)(thickness)");
printf(" \n\n\n\n\n");
G_SolidRevolCylindShellfg
( -3, /* xmin */
3, /* xmax */
0, /* ymin */
3.5, /* ymax */
a,
b,
dx,
step,
f,
g
);
stop();
clrscrn();
printf(" If we apply \n\n\n");
printf(" (%.3f\n", b);
printf(" int( \n");
printf(" (%.3f\n\n\n", a);
printf(" to : 2 * Pi (%s) [(%s) - (%s)] dx\n\n\n",
heq, feq, geq);
printf(" We obtain a limit of sums of volumes of cylindrical shells.\n\n\n");
M = simpson(VCylindricalShell,a,b,n);
printf(" (%.3f\n", b);
printf(" int( 2 * Pi (%s) [(%s) - (%s)] dx = %.12f\n",
heq, feq, geq, M);
printf(" (%.3f\n\n\n", a);
stop();
return 0;
}
/* ---------------------------------- */
/* ---------------------------------- */
Exemple de sortie écran :
Compute the volume of a solid of revolution,
generated by revolving R about the y-axis,
by using cylindrical shells.
Draw the region R bounded by the graph of f,
the graph of g,and x = a and x = b
Let Let f >= g be continous on [1.000,2.000].
f : x-> sin(x)+2.
g : x-> cos(x)+2.
To see the graphs, use ... load "a_main.plt" ... with Gnuplot.
Press return to continue.
Exemple de sortie écran :
Draw a typical vertical rectangle.
To see the graphs, use ... load "a_main.plt" ... with Gnuplot.
Thickness of shell : dx
Average radius : (x)
Altitude : (sin(x)+2.) - (cos(x)+2.)
The volume : 2 Pi (x) [(sin(x)+2.) - (cos(x)+2.)] dx
Volume of a cylindrical shell = 2Pi(average radius)(altitude)(thickness)
Press return to continue.
Exemple de sortie écran :
If we apply
(2.000
int(
(1.000
to : 2 * Pi (x) [(sin(x)+2.) - (cos(x)+2.)] dx
We obtain a limit of sums of volumes of cylindrical shells.
(2.000
int( 2 * Pi (x) [(sin(x)+2.) - (cos(x)+2.)] dx = 8.920537854312
(1.000
Press return to continue.