Mathc initiation/Fichiers c : c32cc


Sommaire


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


Crystal Clear mimetype source c.png c17c
'
/* ---------------------------------- */
/* save as c17c.c                     */
/* ---------------------------------- */
#include  "x_hfile.h"
#include       "fc.h"
/* ---------------------------------- */
int main(void)
{
double a,b,n,
       ay,by,ny,
       Mxy,Myx;

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

 a = 0;         ay =  0; 
 b = 1;         by =  1./2.; 
 n = 2*10;      ny =  2*10;


 Myx = simpson_dydx(f,a,  b,  n,
                        ay, by, ny);

 Mxy = simpson_dxdy(f,a,  b,  n, 
                        ay, by, ny);


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

 stop();

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


Vous pouvez vérifier avec Octave version 5.2 :

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

>> I = dblquad (@(x, y) sin(cos(x.*y)), 1, 0, .5, 0)

I =  0.41688


Exemple de sortie écran :

 f : (x,y)-> sin(cos(x*y)


 With the simpsonal's rule.

    (1.000  (0.500
 int(   int(       sin(cos(x*y)  Dy Dx = 0.416884
    (0.000  (0.000


    (0.500  (1.000
 int(   int(       sin(cos(x*y)  Dx Dy = 0.416884
    (0.000  (0.000


 Press return to continue.