Aller au contenu

Mathc initiation/001Y

Un livre de Wikilivres.


Sommaire

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

c00a.c
/* --------------------------------- */
/* save as c00a.c                    */
/* --------------------------------- */
#include  "x_hfile.h"
#include       "fa.h"
/* --------------------------------- */
int main(void)
{
double M = simpson_dydx(f, ay,by,LOOP, ax,bx,LOOP);
 
 clrscrn();
 
 printf("An odd function with respect to x\n\n");
 
 printf(" f  : (x,y)-> %s  \n\n",  feq);
 
 printf(" by :   (x)-> %s    \n", byeq); 
 printf(" ay :   (x)-> %s  \n\n", ayeq);
 
 printf(" bx :         %s    \n", bxeq);
 printf(" ax :         %s\n\n\n", axeq);

 printf(" With the simpson's rule.\n\n");
 printf("    (%+.3f  (%s\n",      bx,byeq);
 printf(" int(    int(       %s  dy dx = %.6f\n", feq, M);
 printf("    (%+.3f  (%s\n\n\n",  ax,ayeq);

 stop();

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

La fonction f est impaire par rapport à x. Les bornes de x doivent être comprises entre -a et a. Les bornes pour y peuvent être quelconques.

Verifier avec mathematica : Free: wolframalpha.com

integral (x**3 + x*y**2 + x) dy dx from -1 to 1 from (+2) to (+5)

Exemple de sortie écran :

An odd function with respect to x

 f  : (x,y)-> x**3 + x y**2 + x  

 by :   (x)-> +5    
 ay :   (x)-> +2  

 bx :         +1    
 ax :         -1


 With the simpson's rule.

    (+1.000  (+5
 int(    int(       x**3 + x y**2 + x  dy dx = 0.000000
    (-1.000  (+2


 Press return to continue.