Aller au contenu

Mathc initiation/0022

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 M = simpson_dxdy(f, ax,bx,LOOP, ay,by,LOOP);
 
 clrscrn();

 printf("An odd function with respect to y\n\n");
  
 printf(" f  : (x,y)-> %s  \n\n", feq);
 printf(" bx :   (y)-> %s   \n", bxeq);
 printf(" ax :   (y)-> %s \n\n", axeq);

 printf(" by :         %s    \n", byeq);
 printf(" ay :         %s\n\n\n", ayeq);

 printf(" With the simpson's rule.\n\n");
 printf("    (%+.3f  (%s\n",      by,bxeq);
 printf(" int(    int(       %s  dx dy = %.6f\n", feq, M);
 printf("    (%+.3f  (%s\n\n\n",  ay,axeq);

 stop();

 return 0;
}
/* --------------------------------- */
/* --------------------------------- */
La fonction f est impaire par rapport à y. 

Les bornes de y doivent être comprises entre -a et a. [ici : (-y**2) et (+y**2)]

Remarque  : Il y a un nombre impaire de fonctions impaires. 

            [y x**2] -> [y (y**2)**2]-> [y (y**4)] (1+4=5)

Verifier avec mathematica : Free: wolframalpha.com

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

Exemple de sortie écran :

An odd function with respect to y

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

 bx :   (y)-> (+y**2)   
 ax :   (y)-> (-y**2) 

 by :         +1    
 ay :         -1


 With the simpson's rule.

    (+1.000  ((+y**2)
 int(    int(       y x**2 + 4 y x  dx dy = 0.000000
    (-1.000  ((-y**2)


 Press return to continue.