Aller au contenu

Mathc initiation/a35

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.

c00e.c
/* ---------------------------------- */
/* save as c00e.c                     */
/* ---------------------------------- */
#include  "x_hfile.h"
#include       "fe.h"
/* ---------------------------------- */
int main(void)
{
   int    n =   2*1000;
double    a =       .3;
double    b =      1.7;
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(-2,     /* xmin  */
                        2,     /* xmax  */
                        0,     /* 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
                      (-2,     /* xmin  */
                        2,     /* xmax  */
                        0,     /* 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.300,1.700].

 f : x-> 2.*x - x**2

 g : x-> .5



 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           : (2.*x - x**2) - (.5)
 The volume         :  2 Pi (x) [(2.*x - x**2) - (.5)] dx


 Volume of a cylindrical shell = 2Pi(average radius)(altitude)(thickness) 




 Press return to continue.


Exemple de sortie écran :

 If we apply 


    (1.700
 int(      
    (0.300


 to  : 2 * Pi (x) [(2.*x - x**2) - (.5)] dx


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


    (1.700
 int(   2 * Pi (x) [(2.*x - x**2) - (.5)] dx = 2.961474674784
    (0.300


 Press return to continue.