Mathc initiation/a99
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.
c00b.c |
---|
/* ---------------------------------- */
/* save as c00b.c */
/* ---------------------------------- */
#include "x_hfile.h"
#include "fb.h"
/* ---------------------------------- */
int main(void)
{
int n = 2*1000;
double a = 0.;
double b = 2.;
double M = 0.;
clrscrn();
printf(" Compute the volume of a solid of revolution,\n");
printf(" generated by revolving R about the y-axis, \n");
printf(" by using cylindrical shells. \n\n");
printf(" Draw the region R bounded by the graph of f,\n");
printf(" the x-axis, x = a and x = b (0 <= a <= b)\n\n");
printf(" Let f >= 0 be continous on [%.3f,%.3f].\n\n", a, b);
printf(" f : x-> %s\n\n", feq);
printf(" See the graph with Gnuplot.\n\n");
stop();
clrscrn();
printf(" Draw a typical vertical rectangle. \n\n");
printf(" See the graph with Gnuplot.\n\n");
printf(" Thickness of shell : dx \n");
printf(" Average radius : (%s)\n", heq);
printf(" Altitude : (%s)\n", feq);
printf(" The volume : 2 Pi (%s) (%s) dx\n\n\n",heq, feq);
printf(" Volume of a cylindrical shell = 2Pi(average radius)(altitude)(thickness)");
printf(" \n\n\n\n\n");
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) dx\n\n\n", heq, feq);
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) dx = %.2f\n",heq,feq,M);
printf(" (%.3f\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 x-axis, x = a and x = b (0 <= a <= b)
Let f >= 0 be continous on [0.000,2.000].
f : x-> 2.*x - x**2
See the graph with Gnuplot.
Press return to continue.
Dessinons avec gnuplot la fonction f :
set zeroaxis lt 8
set grid
plot [-2.000:2.000] [0:1.000] 2.*x-x**2 lt 1
reset
Exemple de sortie écran :
Draw a typical vertical rectangle.
See the graph with Gnuplot.
Thickness of shell : dx
Average radius : (x)
Altitude : (2.*x - x**2)
The volume : 2 Pi (x) (2.*x - x**2) dx
Volume of a cylindrical shell = 2Pi(average radius)(altitude)(thickness)
Press return to continue.
Dessinons un rectangle pour construire l'équation du volume:
set zeroaxis lt 8
set grid
set object 3 rect from 0.5,0 to 0.6, 2.* 0.6 - 0.6**2
plot [-2.000:2.000] [0:1.000] 2.*x-x**2 lt 1
reset
Exemple de sortie écran :
If we apply
(2.000
int(
(0.000
to : 2 * Pi (x) (2.*x - x**2) dx
We obtain a limit of sums of volumes of cylindrical shells.
(2.000
int( 2 * Pi (x) (2.*x - x**2) dx = 8.38
(0.000
Press return to continue.