Mathc initiation/c33a4


Sommaire


Installer ce fichier dans votre répertoire de travail.


Crystal Clear mimetype source h.png x_dxdy.h
utilitaire
/* ---------------------------------- */
/* save as x_dxdy.h                  */
/* ---------------------------------- */
double int_dx(
double (*P_f)(double x, double y),
double (*P_u)(double y),         
double (*P_v)(double y),         
   int n,
double y
)
{
   int i = 0;
double m = 0.;
double M = 0.;

 for(i = 0; i <= n; i++)
 {
    if(i ==0 || i== n){m = 1.;}
  else                {m = 2.;}

  M += m * (*P_f)( ((*P_u)( y)) + i*(((*P_v)( y))-((*P_u)( y)))/n, y);
 }                 /*    x      */

  return( ((((*P_v)( y)) -((*P_u)( y)))*M) / (2*n) );
}
/* ---------------------------------- */
double trapezoid_dxdy(
double (*P_f)(double x, double y),
double (*P_u)(double y),
double (*P_v)(double y),
   int n,
double ay,
double by,
   int ny
)
{
   int i = 0;
double m = 0.;
double M = 0.;

 for(i = 0; i <= ny; i++)
 {
    if(i ==0 || i== ny){m = 1.;}
  else                {m = 2.;}

  M += m * int_dx((*P_f), (*P_u),(*P_v),n, (ay+i*(by-ay)/ny));
 }                               /*     y       */

  return( ((by-ay)*M) / (2*ny) );
}
/* ---------------------------------- */


Les fonctions pour calculer les intégrales de la forme dxdy.