Aller au contenu

Mathc initiation/c35ce

Un livre de Wikilivres.


Sommaire


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)
{
double  ay = 0,
        by = 4,
        ny = 2*100, nx = 2*100, nz = 2*100;

double  M = trapezoid_dzdxdy(f,
                             uz, vz,nz,
                             sx, tx,nx,
                             ay, by,ny);
 
 clrscrn();
 printf(" f : x,y,z -> %s\n\n", feq);
 
 printf(" v : x,y   -> %s \n", veq);
 printf(" u : x,y   -> %s\n\n", ueq);

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

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

 printf(" Code Mathematica : \n\n"
        " integral 1 dz dx dy from (0) to"
        " (4-y) from +0 to 4 from (-sqrt(y)) to (sqrt(y))\n\n\n");
        
 stop();

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


Exemple de sortie écran :

 f : x,y,z -> 1

 v : x,y   -> 4-y 
 u : x,y   -> 0

 t : y     -> sqrt(y)  
 s : y     -> -sqrt(y)

 With the trapezoidal's rule.


        (+4.0  (sqrt(y)     (4-y    
 A = int(   int(    int(      1  dz dx dy = 17.052845
        (+0.0  (-sqrt(y)     (0


 Press return to continue.