Aller au contenu

Mathc initiation/003y

Un livre de Wikilivres.


Sommaire

Installer et compiler ces fichiers dans votre répertoire de travail.

c00g2.c
/* --------------------------------- */
/* save as c00g2.c                   */
/* --------------------------------- */
#include  "x_afile.h"
#include      "fg2.h"
/* --------------------------------- */
int main(void)
{
double m =  J_uwv(             f,
                           X,  Y,  Z,
                           a0, a1, LOOP,
                           r0, r1, LOOP,
                           b0, b1, LOOP); 
 clrscrn();
 
 printf("     f :  x,y,z -> %s\n\n", feq);
 
 printf(" X  :  r,k,z -> %s       \tThe change of variables.\n",Xeq);
 printf(" Y  :  r,k,z -> %s                                 \n",Yeq);
 printf(" Z  :  r,k,z -> %s                               \n\n",Zeq);

 printf(" a1 :    b,r -> %s \t\t\t\tThe spherical coordinates.\n",a1eq);
 printf(" a0 :    b,r -> %s        [0..2PI]\n\n",  a0eq);

 printf(" r1 :      r -> %s                  \n",  r1eq);
 printf(" r0 :      r -> %s         [0..oo]\n\n",  r0eq);

 printf(" b1 :        -> %s                  \n",  b1eq);
 printf(" b0 :        -> %s         [0..PI]\n\n",  b0eq);
 
 printf("      (%s (%s    (%s      \n",                 b1eq,r1eq,a1eq);
 printf(" m=int(  int(  int( f(X,Y,Z) [r**2 sin(b)] dadrdb  = %.6f\n",m);
 printf("      (%s    (%s    (%s\n\n",                  b0eq,r0eq,a0eq);

 printf(" Code Mathematica : \n"
        " integral (r*cos(b))*(r**2 *sin(b)) da dr db"
        " from 0 to Pi/2 from 0 to (1) from 0 to (2*Pi)\n\n");     
 stop();

 return 0;
}
/* --------------------------------- */
/* --------------------------------- */
a = xy;... ... b = zr;... ... r = r

Exemple de sortie écran :

     f :  x,y,z -> (z)

 X  :  r,k,z -> (r*sin(b)*cos(a))       	The change of variables.
 Y  :  r,k,z -> (r*sin(b)*sin(a))                                 
 Z  :  r,k,z -> (r*cos(b))                               

 a1 :    b,r -> 2PI 				The spherical coordinates.
 a0 :    b,r -> 0        [0..2PI]

 r1 :      r -> 1                  
 r0 :      r -> 0         [0..oo]

 b1 :        -> PI/2                  
 b0 :        -> 0         [0..PI]

      (PI/2 (1    (2PI      
 m=int(  int(  int( f(X,Y,Z) [r**2 sin(b)] dadrdb  = 0.785398
      (0    (0    (0

 Code Mathematica : 
 integral (r*cos(b))*(r**2 *sin(b)) da dr db from 0 to Pi/2 from 0 to (1) from 0 to (2*Pi)

 Press return to continue.