Mathc initiation/a394
Installer et compiler ces fichiers dans votre répertoire de travail.
c00a2.c |
---|
/* ---------------------------------- */
/* save as c00a2.c */
/* ---------------------------------- */
#include "x_hfile.h"
#include "fa2.h"
/* ---------------------------------- */
int main(void)
{
double Hx = simpson(hx,ax,bx,LOOP);
double Hy = simpson(hy,ay,by,LOOP);
clrscrn();
printf(" If the variables are separable,\n"
" you can use the product of two simple integrals,\n"
" instead of a double integral.\n\n See c00a.c\n\n\n");
printf(" (%s\n"
" Hx = int( (%s) * dx = %.6f\n"
" (%s\n\n", bxeq, hxeq, Hx, axeq);
printf(" (%s\n"
" Hy = int( (%s) * dy = %.6f\n"
" (%s\n\n\n", byeq, hyeq, Hy, ayeq);
printf(" The result is Hx * Hy = %.6f.\n\n"
" Verify with the file c00a.c \n\n", Hx * Hy);
stop();
return 0;
}
/* ---------------------------------- */
/* ---------------------------------- */
Exemple de sortie écran :
If the variables are separable,
you can use the product of two simple integrals,
instead of a double integral.
See c00a.c
(3
Hx = int( (x**2) * dx = 9.000000
(0
(2
Hy = int( (cos(y)) * dy = 0.909297
(0
The result is Hx * Hy = 8.183677.
Verify with the file c00a.c
Press return to continue.