Mathc initiation/c36a8


Sommaire


Installer ce fichier dans votre répertoire de travail.

Crystal Clear mimetype source h.png x_zyx.h
'
/* ---------------------------------- */
/* save as x_zyx.h                   */
/* --------------------------------- */
double intz_dzdydx(
double (*P_f)(double x, double y, double z),
double x,

double y,

double (*Puz)(double x, double y),
double (*Pvz)(double x, double y),
   int    nz
)
{
   int i = 0;
double m = 0.;
double M = 0.;

 for(i = 0; i <= nz; i++)
 {
       if(i ==0 || i== nz){m = 1.;}
  else if(fmod(i,2) == 0){m = 2.;}
  else                   {m = 4.;}

  M += m * (*P_f)( x, y, ((*Puz)(x,y)) + i*(((*Pvz)(x,y))-((*Puz)(x,y)))/nz);
 }

  return( ((((*Pvz)(x,y)) -((*Puz)(x,y)))*M) / (3*nz) );
}
/* --------------------------------- */
double inty_dzdydx(
double (*P_f)(double x, double y, double z),
double x,

double (*Psy)(double x),
double (*Pty)(double x),
   int    ny,
   
double (*Puz)(double x, double y),
double (*Pvz)(double x, double y),
   int    nz
)
{
   int i = 0;
double m = 0.;
double M = 0.;

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

  M += m * intz_dzdydx((*P_f),
                                x,
                                
                           (((*Psy)(x))+i*(((*Pty)(x))-((*Psy)(x)))/ny),
                           
                             (*Puz),
                             (*Pvz),
                                nz);
 }

 return( ((((*Pty)(x)) -((*Psy)(x)))*M) / (3*ny) );
}
/* --------------------------------- */
double sympson_dzdydx(
double (*P_f)(double x, double y, double z),

double ax,
double bx,
   int nx,
   
double (*Psy)(double x),
double (*Pty)(double x),
   int    ny,
   
double (*Puz)(double x, double y),
double (*Pvz)(double x, double y),
   int    nz
)
{
   int i = 0;
double m = 0.;
double M = 0.;

 for(i = 0; i <= nx; i++)
 {
       if(i ==0 || i== nx){m = 1.;}
  else if(fmod(i,2) == 0){m = 2.;}
  else                   {m = 4.;}

  M += m * inty_dzdydx((*P_f),
  
                             (ax+i*(bx-ax)/nx),
                             
                             (*Psy),
                             (*Pty),
                                ny,
                                
                             (*Puz),
                             (*Pvz),
                                nz);
 }

  return( ((bx -ax)*M) / (3*nx) );
}
/* --------------------------------- */
/* --------------------------------- */


Les fonctions pour calculer les intégrales de la forme dzdydx