Aller au contenu

Mathc initiation/a402

Un livre de Wikilivres.


Sommaire


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

c00c2.c
/* ---------------------------------- */
/* save as c00c2.c                    */
/* ---------------------------------- */
#include "x_hfile.h"
#include     "fc2.h"
/* ---------------------------------- */
int main(void)
{
double Hx = simpson(hx,ax,bx,LOOP);
double Hy = simpson(hy,ay,by,LOOP);
double Hz = simpson(hz,az,bz,LOOP);

 clrscrn();
 
 printf(" If the variables are separable,\n"
        " you can use the product of three simple integrals,\n"
        " instead of a triple integral "
        "                         ... See c00a.c\n\n");
        
 printf("          (%s\n"
        " Hx  = int(  (%s) * dx = %.6f\n"
        "          (%s\n\n",    bxeq, hxeq, Hx, axeq);

 printf("          (%s\n"
        " Hy  = int(  (%s) * dy = %.6f\n"
        "          (%s\n\n\n",  byeq, hyeq, Hy, ayeq);
        
 printf("          (%s\n"
        " Hz  = int(  (%s) * dz = %.6f\n"
        "          (%s\n\n\n",  bzeq, hzeq, Hz, azeq);
        
printf(" The result is  Hx * Hy * Hz = %.6f.\n\n"
       " Verify with the file c00a.c   \n\n", Hx * Hy * Hz);
        
 stop();

 return 0;
} 
/* ---------------------------------- */
/* ---------------------------------- */


Exemple de sortie écran :

 If the variables are separable,
 you can use the product of three simple integrals,
 instead of a triple integral                          ... See c00a.c

          (2
 Hx  = int(  (1) * dx = 2.000000
          (0

          (3
 Hy  = int(  (1) * dy = 3.000000
          (0


          (+PI/3
 Hz  = int(  (sin(y)) * dz = 0.500000
          (0


 The result is  Hx * Hy * Hz = 3.000000.

 Verify with the file c00a.c   

 Press return to continue.