Sommaire


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

c18cyx.c
'
/* ---------------------------------- */
/* save as c18cyx.c                    */
/* --------------------------------- */
#include  "x_hfile.h"
#include      "fc.h"
/* --------------------------------- */
int main(void)
{
double ax = 0;
double bx = 2;
double  h = H;

int    nx = 2*20;
int    ny = 2*20; 
/* --------------------------------- */                 
 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) dy dx\n"
        "    (c                           (a   (u(y) \n\n\n\n\n");
 
 printf(" Use the Green's theorem to evaluate :   \n\n");  
 
 printf("    (                             (%.3f   (%s\n",    bx, veq);
 printf(" int( %s dx + %s dy = int(     int( %s dy dx\n", 
                       Meq, Neq, N_x_mns_M_y_eq);
 printf("    (c                            (%.3f   (%s\n\n\n\n\n", ax, 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(y) = %s   \n", veq); 
 printf(" u(y) = %s \n\n", ueq);

 printf(" With simpson_dydx().\n\n");
 printf("    (%.1f  (%s\n", bx, veq);
 printf(" int(    int( %s  dy dx = %.5f\n", N_x_mns_M_y_eq, 
             simpson_dydx(N_x_mns_M_y, ax,bx,nx, u,v,ny) );
 printf("    (%.1f  (%s\n\n\n", ax, ueq);
 
  printf(" With green_dydx().\n\n");
 printf("    (%.1f  (%s\n", bx, veq);
 printf(" int(    int( (N_x - M_y)  dy dx = %.5f\n", 
             green_dydx(M,N, ax,bx,nx,h, u,v,ny) );
 printf("    (%.1f  (%s\n\n\n", ax, 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) dy dx
    (c                           (a   (u(y) 




 Use the Green's theorem to evaluate :   

    (                             (2.000   (2*y
 int( (5*x*y) dx + (x**3) dy = int(     int( (3*x**2)-(5*x) dy dx
    (c                            (0.000   (y**2




 Press return to continue.

Exemple de sortie écran :

 M(x,y) = (5*x*y) 
 N(x,y) = (x**3) 

 N_x_mns_M_y(x,y) = (3*x**2)-(5*x)  

 v(y) = 2*y   
 u(y) = y**2 

 With simpson_dydx().

    (2.0  (2*y
 int(    int( (3*x**2)-(5*x)  dy dx = -1.86667
    (0.0  (y**2


 With green_dydx().

    (2.0  (2*y
 int(    int( (N_x - M_y)  dy dx = -1.86667
    (0.0  (y**2


 Press return to continue.
Cet article est issu de Wikibooks. Le texte est sous licence Creative Commons - Attribution - Partage dans les Mêmes. Des conditions supplémentaires peuvent s'appliquer aux fichiers multimédias.