Mathc initiation/a398
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);
double Hz = simpson(hz,az,bz,LOOP);
clrscrn();
printf(" If the variables are separable,\n"
" you can use the product of three simple integrals,\n"
" instead of a triple integral "
" ... See c00a.c\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(" (%s\n"
" Hz = int( (%s) * dz = %.6f\n"
" (%s\n\n\n", bzeq, hzeq, Hz, azeq);
printf(" The result is Hx * Hy * Hz = %.6f.\n\n"
" Verify with the file c00a.c \n\n", Hx * Hy * Hz);
stop();
return 0;
}
/* ---------------------------------- */
/* ---------------------------------- */
Exemple de sortie écran :
If the variables are separable,
you can use the product of three simple integrals,
instead of a triple integral ... See c00a.c
(1
Hx = int( (x**2) * dx = 0.333333
(0
(PI/4
Hy = int( (cos(y)) * dy = 0.707107
(0
(PI/3
Hz = int( (sin(y)) * dz = 0.500000
(0
The result is Hx * Hy * Hz = 0.117851.
Verify with the file c00a.c
Press return to continue.