Mathc initiation/Fichiers c : c32cd


Sommaire


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


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

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

 a = 1;         ay = -1; 
 b = 4;         by =  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) (2*x+6*x.*x.*y), 1, 4, -1, 2)

I =  234.00


Exemple de sortie écran :

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


 With the simpsonal's rule.

    (4.000  (2.000
 int(   int(       2*x+6*x**2*y  Dy Dx = 234.000000
    (1.000  (-1.000


    (2.000  (4.000
 int(   int(       2*x+6*x**2*y  Dx Dy = 234.000000
    (-1.000  (1.000


 Press return to continue.