Aller au contenu

Mathc initiation/a98

Un livre de Wikilivres.


Sommaire

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 =       PI;
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,3.142].

 f : x-> sin(x)

 See the graph with Gnuplot.

 Press return to continue.


Dessinons avec gnuplot la fonction f :

 set zeroaxis lt 8
 set grid
 plot [-pi:pi] [0:1.000] sin(x) 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           : (sin(x))
 The volume         :  2 Pi (x) (sin(x)) 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  1.0,0 to  1.2, sin(1.2)
 plot [-pi:pi] [0:1.000] sin(x) lt 1
 reset


Exemple de sortie écran :

 If we apply 


    (3.142
 int(      
    (0.000


 to  : 2 * Pi (x) (sin(x)) dx


 We obtain a limit of sums of volumes of cylindrical shells.


    (3.142
 int(   2 * Pi (x) (sin(x)) dx = 19.74
    (0.000

 Press return to continue.