Mathc initiation/Fichiers c : c54cd
Apparence
Installer et compiler ces fichiers dans votre répertoire de travail.
c18dxy.c |
---|
/* --------------------------------- */
/* save as c18dxy.c */
/* --------------------------------- */
#include "x_hfile.h"
#include "fd.h"
/* --------------------------------- */
int main(void)
{
clrscrn();
printf(" The Green's theorem : \n\n");
printf(" ( (b (v(y)\n"
" int( M(x,y) + dx N(x,y) dy = int( int( (N_x - M_y) dx dy\n"
" (c (a (u(y) \n\n\n\n\n");
printf(" Use the Green's theorem to evaluate : \n\n");
printf(" ( (%.1f (%s\n", by, veq);
printf(" int( %s dx + %s dy = int( int( %s dx dy\n",
Meq, Neq, N_x_mns_M_y_eq);
printf(" (c (%.1f (%s\n\n\n\n\n", ay, ueq);
stop();
clrscrn();
printf(" M(x,y) = %s \n", Meq);
printf(" N(x,y) = %s \n\n", Neq);
printf(" N_x_mns_M_y(x,y) = %s \n\n", N_x_mns_M_y_eq);
printf(" v(x) = %s \n", veq);
printf(" u(x) = %s \n\n", ueq);
printf(" With simpson_dxdy().\n\n");
printf(" (%.1f (%s\n", by, veq);
printf(" int( int( %s dx dy = %.5f\n", N_x_mns_M_y_eq,
simpson_dxdy(N_x_mns_M_y, u,v,LOOP, ay,by,LOOP) );
printf(" (%.1f (%s\n\n\n", ay, ueq);
printf(" With green_dxdy().\n\n");
printf(" (%.1f (%s\n", by, veq);
printf(" int( int( (N_x - M_y) dx dy = %.5f\n",
green_dxdy(M,N, u,v,LOOP, ay,by,LOOP) );
printf(" (%.1f (%s\n\n\n", ay, ueq);
stop();
return 0;
}
/* --------------------------------- */
/* --------------------------------- */
Nous avons une fonction pour calculer directement l'intégrale double de Green. Elle calcule elle même les dérivées partielles nécessaires.
Exemple de sortie écran :
The Green's theorem :
( (b (v(y)
int( M(x,y) + dx N(x,y) dy = int( int( (N_x - M_y) dx dy
(c (a (u(y)
Use the Green's theorem to evaluate :
( (0.0 (-y
int( (x**2+y) dx + (x*y**2) dy = int( int( (y**2)-1 dx dy
(c (-1.0 (y**2
Press return to continue.
Exemple de sortie écran :
M(x,y) = (x**2+y)
N(x,y) = (x*y**2)
N_x_mns_M_y(x,y) = (y**2)-1
v(x) = -y
u(x) = y**2
With simpson_dxdy().
(0.0 (-y
int( int( (y**2)-1 dx dy = -0.11667
(-1.0 (y**2
With green_dxdy().
(0.0 (-y
int( int( (N_x - M_y) dx dy = -0.11667
(-1.0 (y**2
Press return to continue.