Aller au contenu

Mathc initiation/c35cc

Un livre de Wikilivres.


Sommaire


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

c00c.c
/* ---------------------------------- */
/* save as c00c.c                    */
/* --------------------------------- */
#include  "x_hfile.h"
#include       "fc.h"
/* --------------------------------- */
int main(void)
{
double  az = 0,
        bz = 1,
        nz = 2*50,  nx = 2*50,  ny = 2*50;

double  M = trapezoid_dydxdz(f,
                             uy, vy, ny,
                             sx, tx, nx,
                             az, bz, nz);
 
 clrscrn();
 printf(" f : x,y,z -> %s\n\n", feq);
 
 printf(" v : x,z   -> %s  \n", veq);
 printf(" u : x,z   -> %s\n\n", ueq);

 printf(" t : z     -> %s  \n", teq);
 printf(" s : z     -> %s\n\n", seq);

 printf(" With the trapezoidal's rule.\n\n\n");
 printf("        (%+.1f  (%s  (%s    \n", bz, teq, veq);
 printf(" A = int(   int(    int(      %s  dy dx dz = %.6f\n",feq, M);
 printf("        (%+.1f  (%s      (%s\n\n\n", az, seq, ueq);

 printf(" Code Mathematica : \n\n"
        " integral 1 dy dx dz from (0) to "
        "(z**2+x**2+1) from 0 to 1 from 0 to (2-2*z)\n\n\n");
        
 stop();

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


Exemple de sortie écran :

 f : x,y,z -> 1

 v : x,z   -> z**2+x**2+1  
 u : x,z   -> 0

 t : z     -> 2-2*z  
 s : z     -> 0

 With the trapezoidal's rule.


        (+1.0  (2-2*z  (z**2+x**2+1    
 A = int(   int(    int(      1  dy dx dz = 1.833417
        (+0.0  (0     (0


 Press return to continue.