Mathc initiation/a31
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.
c00a.c |
---|
/* ---------------------------------- */
/* save as c00a.c */
/* ---------------------------------- */
#include "x_hfile.h"
#include "fa.h"
/* ---------------------------------- */
int main(void)
{
int n = 2*1000;
double a = 0.;
double b = 1.;
double dx = .05;
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(-1.5, /* xmin */
1.5, /* xmax */
-0.5, /* ymin */
1.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
(-1.5, /* xmin */
1.5, /* xmax */
-0.5, /* ymin */
1.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 f >= g be continous on [0.000,1.000].
f : x-> x**(1./2.)
g : x-> 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 : (x**(1./2.)) - (x**2)
The volume : 2 Pi (x) [(x**(1./2.)) - (x**2)] dx
Volume of a cylindrical shell = 2Pi(average radius)(altitude)(thickness)
Press return to continue.
Exemple de sortie écran :
If we apply
(1.000
int(
(0.000
to : 2 * Pi (x) [(x**(1./2.)) - (x**2)] dx
We obtain a limit of sums of volumes of cylindrical shells.
(1.000
int( 2 * Pi (x) [(x**(1./2.)) - (x**2)] dx = 0.942477796571
(0.000
Press return to continue.