Mathc initiation/Fichiers h : c32ca


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  ax =    0,   ay =    0, 
        bx =    2,   by =    3, 
        nx = 2*10,   ny = 2*10,
        
       Mxy =    0,  Myx =    0;

 clrscrn();
 printf(" f : (x,y)-> %s\n\n\n", feq);

 Myx = simpson_dydx(f, ay,by,ny, ax,bx,nx);
 Mxy = simpson_dxdy(f, ax,bx,nx, ay,by,ny);

 printf(" With the simpsonal's rule.\n\n");
 printf("    (%.3f  (%.3f\n",     bx,by);
 printf(" int(   int(       %s    Dy Dx = %.6f\n", feq, Myx);
 printf("    (%.3f  (%.3f\n\n\n", ax,ay);
 
 printf("    (%.3f  (%.3f\n",     by,bx);
 printf(" int(   int(       %s    Dx Dy = %.6f\n", feq, Mxy);
 printf("    (%.3f  (%.3f\n\n\n", ay,ax);

 stop();

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


Vous pouvez vérifier avec Octave version 5.2 :

I = dblquad (f, xa, xb, ya, yb)

>> I = dblquad (@(x, y) 1./5. * sqrt(225-25*x.*x-9*y.*y), 0, 2, 0, 3)

I =  15.282


Exemple de sortie écran :

 f : (x,y)-> 1./5. * sqrt(225-25*x**2-9*y**2)


 With the simpsonal's rule.

    (2.000  (3.000
 int(   int(       1./5. * sqrt(225-25*x**2-9*y**2)  Dy Dx = 15.282213
    (0.000  (0.000


    (3.000  (2.000
 int(   int(       1./5. * sqrt(225-25*x**2-9*y**2)  Dx Dy = 15.282213
    (0.000  (0.000


 Press return to continue.